diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a712b5619a..d9941d92e87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,45 @@ +# Instructions for Logging Issues + +## 1. Read the FAQ + +Please [read the FAQ](https://github.com/Microsoft/TypeScript/wiki/FAQ) before logging new issues, even if you think you have found a bug. + +Issues that ask questions answered in the FAQ will be closed without elaboration. + +## 2. Search for Duplicates + +[Search the existing issues](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue) before logging a new one. + +## 3. Do you have a question? + +The issue tracker is for **issues**, in other words, bugs and suggestions. +If you have a *question*, please use [http://stackoverflow.com/questions/tagged/typescript](Stack Overflow), [https://gitter.im/Microsoft/TypeScript](Gitter), your favorite search engine, or other resources. +Due to increased traffic, we can no longer answer questions in the issue tracker. + +## 4. Did you find a bug? + +When logging a bug, please be sure to include the following: + * What version of TypeScript you're using (run `tsc --v`) + * If at all possible, an *isolated* way to reproduce the behavior + * The behavior you expect to see, and the actual behavior + +You can try out the nightly build of TypeScript (`npm install typescript@next`) to see if the bug has already been fixed. + +## 5. Do you have a suggestion? + +We also accept suggestions in the issue tracker. +Be sure to [check the FAQ](https://github.com/Microsoft/TypeScript/wiki/FAQ) and [search](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue) first. + +In general, things we find useful when reviewing suggestins are: +* A description of the problem you're trying to solve +* An overview of the suggested solution +* Examples of how the suggestion would work in various places + * Code examples showing e.g. "this would be an error, this wouldn't" + * Code examples showing the generated JavaScript (if applicable) +* If relevant, precedent in other languages can be useful for establishing context and expected behavior + +# Instructions for Contributing Code + ## Contributing bug fixes TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. diff --git a/Jakefile.js b/Jakefile.js index b62cbed3279..7b85aacaa89 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -163,13 +163,15 @@ var harnessSources = harnessCoreSources.concat([ })); var librarySourceMap = [ - { target: "lib.core.d.ts", sources: ["core.d.ts"] }, + { target: "lib.core.d.ts", sources: ["header.d.ts", "core.d.ts"] }, { target: "lib.dom.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "dom.generated.d.ts"], }, { target: "lib.webworker.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "webworker.generated.d.ts"], }, { target: "lib.scriptHost.d.ts", sources: ["importcore.d.ts", "scriptHost.d.ts"], }, - { target: "lib.d.ts", sources: ["core.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], }, - { target: "lib.core.es6.d.ts", sources: ["core.d.ts", "es6.d.ts"]}, - { target: "lib.es6.d.ts", sources: ["es6.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] } + { target: "lib.d.ts", sources: ["header.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], }, + { target: "lib.core.es6.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts"]}, + { target: "lib.es6.d.ts", sources: ["header.d.ts", "es6.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] }, + { target: "lib.core.es7.d.ts", sources: ["header.d.ts", "core.d.ts", "es6.d.ts", "es7.d.ts"]}, + { target: "lib.es7.d.ts", sources: ["header.d.ts", "es6.d.ts", "es7.d.ts", "core.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] } ]; var libraryTargets = librarySourceMap.map(function (f) { @@ -893,6 +895,7 @@ function getLinterOptions() { function lintFileContents(options, path, contents) { var ll = new Linter(path, contents, options); + console.log("Linting '" + path + "'.") return ll.lint(); } diff --git a/doc/TypeScript Language Specification.docx b/doc/TypeScript Language Specification.docx index 78c86917551..4b8d3998f90 100644 Binary files a/doc/TypeScript Language Specification.docx and b/doc/TypeScript Language Specification.docx differ diff --git a/doc/spec.md b/doc/spec.md index 30de2c5a6b6..fa69d321056 100644 --- a/doc/spec.md +++ b/doc/spec.md @@ -3885,7 +3885,7 @@ function g(x: number) { the inferred return type for 'f' and 'g' is Any because the functions reference themselves through a cycle with no return type annotations. Adding an explicit return type 'number' to either breaks the cycle and causes the return type 'number' to be inferred for the other. -An explicitly typed function whose return type isn't the Void or the Any type must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement. +An explicitly typed function whose return type isn't the Void type, the Any type, or a union type containing the Void or Any type as a constituent must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement. The type of 'this' in a function implementation is the Any type. diff --git a/lib/lib.core.d.ts b/lib/lib.core.d.ts index 50fd8a8e495..145564d7044 100644 --- a/lib/lib.core.d.ts +++ b/lib/lib.core.d.ts @@ -14,7 +14,6 @@ and limitations under the License. ***************************************************************************** */ /// - ///////////////////////////// /// ECMAScript APIs ///////////////////////////// diff --git a/lib/lib.core.es6.d.ts b/lib/lib.core.es6.d.ts index 0470c4827cd..753c3bbf65f 100644 --- a/lib/lib.core.es6.d.ts +++ b/lib/lib.core.es6.d.ts @@ -14,7 +14,6 @@ and limitations under the License. ***************************************************************************** */ /// - ///////////////////////////// /// ECMAScript APIs ///////////////////////////// @@ -5121,15 +5120,15 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; all(values: Iterable>): Promise; /** diff --git a/lib/lib.d.ts b/lib/lib.d.ts index 155d864619e..5b2c53c7cc1 100644 --- a/lib/lib.d.ts +++ b/lib/lib.d.ts @@ -14,7 +14,6 @@ and limitations under the License. ***************************************************************************** */ /// - ///////////////////////////// /// ECMAScript APIs ///////////////////////////// @@ -5296,7 +5295,7 @@ interface Console { select(element: Element): void; time(timerName?: string): void; timeEnd(timerName?: string): void; - trace(): void; + trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; } @@ -5555,9 +5554,9 @@ interface DataTransferItemList { length: number; add(data: File): DataTransferItem; clear(): void; - item(index: number): File; + item(index: number): DataTransferItem; remove(index: number): void; - [index: number]: File; + [index: number]: DataTransferItem; } declare var DataTransferItemList: { @@ -6610,6 +6609,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * @param content The text and HTML tags to write. */ writeln(...content: string[]): void; + createElement(tagName: "picture"): HTMLPictureElement; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -7022,6 +7023,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec webkitRequestFullscreen(): void; getElementsByClassName(classNames: string): NodeListOf; matches(selector: string): boolean; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -7811,6 +7813,7 @@ interface HTMLCanvasElement extends HTMLElement { * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; + toBlob(): Blob; } declare var HTMLCanvasElement: { @@ -10965,7 +10968,7 @@ interface IDBDatabase extends EventTarget { objectStoreNames: DOMStringList; onabort: (ev: Event) => any; onerror: (ev: Event) => any; - version: string; + version: number; close(): void; createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; @@ -11681,7 +11684,7 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: number; + readyState: string; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; endOfStream(error?: number): void; @@ -14410,17 +14413,16 @@ declare var Storage: { } interface StorageEvent extends Event { - key: string; - newValue: any; - oldValue: any; - storageArea: Storage; url: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; + key?: string; + oldValue?: string; + newValue?: string; + storageArea?: Storage; } declare var StorageEvent: { prototype: StorageEvent; - new(): StorageEvent; + new (type: string, eventInitDict?: StorageEventInit): StorageEvent; } interface StyleMedia { @@ -16018,7 +16020,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window msMatchMedia(mediaQuery: string): MediaQueryList; msRequestAnimationFrame(callback: FrameRequestCallback): number; msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): any; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; postMessage(message: any, targetOrigin: string, ports?: any): void; print(): void; prompt(message?: string, _default?: string): string; @@ -16620,6 +16622,14 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface StorageEventInit extends EventInit { + key?: string; + oldValue?: string; + newValue?: string; + url: string; + storageArea?: Storage; +} + interface IDBObjectStoreParameters { keyPath?: string | string[]; autoIncrement?: boolean; @@ -16674,6 +16684,14 @@ declare var HTMLTemplateElement: { new(): HTMLTemplateElement; } +interface HTMLPictureElement extends HTMLElement { +} + +declare var HTMLPictureElement: { + prototype: HTMLPictureElement; + new(): HTMLPictureElement; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface ErrorEventHandler { @@ -16870,7 +16888,7 @@ declare function msCancelRequestAnimationFrame(handle: number): void; declare function msMatchMedia(mediaQuery: string): MediaQueryList; declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; declare function postMessage(message: any, targetOrigin: string, ports?: any): void; declare function print(): void; declare function prompt(message?: string, _default?: string): string; diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts index b2ad2c73df6..542149d7719 100644 --- a/lib/lib.dom.d.ts +++ b/lib/lib.dom.d.ts @@ -1472,7 +1472,7 @@ interface Console { select(element: Element): void; time(timerName?: string): void; timeEnd(timerName?: string): void; - trace(): void; + trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; } @@ -1731,9 +1731,9 @@ interface DataTransferItemList { length: number; add(data: File): DataTransferItem; clear(): void; - item(index: number): File; + item(index: number): DataTransferItem; remove(index: number): void; - [index: number]: File; + [index: number]: DataTransferItem; } declare var DataTransferItemList: { @@ -2786,6 +2786,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * @param content The text and HTML tags to write. */ writeln(...content: string[]): void; + createElement(tagName: "picture"): HTMLPictureElement; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -3198,6 +3200,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec webkitRequestFullscreen(): void; getElementsByClassName(classNames: string): NodeListOf; matches(selector: string): boolean; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -3987,6 +3990,7 @@ interface HTMLCanvasElement extends HTMLElement { * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; + toBlob(): Blob; } declare var HTMLCanvasElement: { @@ -7141,7 +7145,7 @@ interface IDBDatabase extends EventTarget { objectStoreNames: DOMStringList; onabort: (ev: Event) => any; onerror: (ev: Event) => any; - version: string; + version: number; close(): void; createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; @@ -7857,7 +7861,7 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: number; + readyState: string; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; endOfStream(error?: number): void; @@ -10586,17 +10590,16 @@ declare var Storage: { } interface StorageEvent extends Event { - key: string; - newValue: any; - oldValue: any; - storageArea: Storage; url: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; + key?: string; + oldValue?: string; + newValue?: string; + storageArea?: Storage; } declare var StorageEvent: { prototype: StorageEvent; - new(): StorageEvent; + new (type: string, eventInitDict?: StorageEventInit): StorageEvent; } interface StyleMedia { @@ -12194,7 +12197,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window msMatchMedia(mediaQuery: string): MediaQueryList; msRequestAnimationFrame(callback: FrameRequestCallback): number; msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): any; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; postMessage(message: any, targetOrigin: string, ports?: any): void; print(): void; prompt(message?: string, _default?: string): string; @@ -12796,6 +12799,14 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface StorageEventInit extends EventInit { + key?: string; + oldValue?: string; + newValue?: string; + url: string; + storageArea?: Storage; +} + interface IDBObjectStoreParameters { keyPath?: string | string[]; autoIncrement?: boolean; @@ -12850,6 +12861,14 @@ declare var HTMLTemplateElement: { new(): HTMLTemplateElement; } +interface HTMLPictureElement extends HTMLElement { +} + +declare var HTMLPictureElement: { + prototype: HTMLPictureElement; + new(): HTMLPictureElement; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface ErrorEventHandler { @@ -13046,7 +13065,7 @@ declare function msCancelRequestAnimationFrame(handle: number): void; declare function msMatchMedia(mediaQuery: string): MediaQueryList; declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; declare function postMessage(message: any, targetOrigin: string, ports?: any): void; declare function print(): void; declare function prompt(message?: string, _default?: string): string; diff --git a/lib/lib.es6.d.ts b/lib/lib.es6.d.ts index ef3399ba804..70f464ad48e 100644 --- a/lib/lib.es6.d.ts +++ b/lib/lib.es6.d.ts @@ -13,6 +13,7 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ +/// declare type PropertyKey = string | number | symbol; interface Symbol { @@ -1296,15 +1297,15 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; all(values: Iterable>): Promise; /** @@ -1346,8 +1347,6 @@ interface PromiseConstructor { } declare var Promise: PromiseConstructor; -/// - ///////////////////////////// /// ECMAScript APIs ///////////////////////////// @@ -6629,7 +6628,7 @@ interface Console { select(element: Element): void; time(timerName?: string): void; timeEnd(timerName?: string): void; - trace(): void; + trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; } @@ -6888,9 +6887,9 @@ interface DataTransferItemList { length: number; add(data: File): DataTransferItem; clear(): void; - item(index: number): File; + item(index: number): DataTransferItem; remove(index: number): void; - [index: number]: File; + [index: number]: DataTransferItem; } declare var DataTransferItemList: { @@ -7943,6 +7942,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * @param content The text and HTML tags to write. */ writeln(...content: string[]): void; + createElement(tagName: "picture"): HTMLPictureElement; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -8355,6 +8356,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec webkitRequestFullscreen(): void; getElementsByClassName(classNames: string): NodeListOf; matches(selector: string): boolean; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -9144,6 +9146,7 @@ interface HTMLCanvasElement extends HTMLElement { * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; + toBlob(): Blob; } declare var HTMLCanvasElement: { @@ -12298,7 +12301,7 @@ interface IDBDatabase extends EventTarget { objectStoreNames: DOMStringList; onabort: (ev: Event) => any; onerror: (ev: Event) => any; - version: string; + version: number; close(): void; createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; @@ -13014,7 +13017,7 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: number; + readyState: string; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; endOfStream(error?: number): void; @@ -15743,17 +15746,16 @@ declare var Storage: { } interface StorageEvent extends Event { - key: string; - newValue: any; - oldValue: any; - storageArea: Storage; url: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; + key?: string; + oldValue?: string; + newValue?: string; + storageArea?: Storage; } declare var StorageEvent: { prototype: StorageEvent; - new(): StorageEvent; + new (type: string, eventInitDict?: StorageEventInit): StorageEvent; } interface StyleMedia { @@ -17351,7 +17353,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window msMatchMedia(mediaQuery: string): MediaQueryList; msRequestAnimationFrame(callback: FrameRequestCallback): number; msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): any; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; postMessage(message: any, targetOrigin: string, ports?: any): void; print(): void; prompt(message?: string, _default?: string): string; @@ -17953,6 +17955,14 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface StorageEventInit extends EventInit { + key?: string; + oldValue?: string; + newValue?: string; + url: string; + storageArea?: Storage; +} + interface IDBObjectStoreParameters { keyPath?: string | string[]; autoIncrement?: boolean; @@ -18007,6 +18017,14 @@ declare var HTMLTemplateElement: { new(): HTMLTemplateElement; } +interface HTMLPictureElement extends HTMLElement { +} + +declare var HTMLPictureElement: { + prototype: HTMLPictureElement; + new(): HTMLPictureElement; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface ErrorEventHandler { @@ -18203,7 +18221,7 @@ declare function msCancelRequestAnimationFrame(handle: number): void; declare function msMatchMedia(mediaQuery: string): MediaQueryList; declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; declare function postMessage(message: any, targetOrigin: string, ports?: any): void; declare function print(): void; declare function prompt(message?: string, _default?: string): string; diff --git a/lib/lib.webworker.d.ts b/lib/lib.webworker.d.ts index 1138538a1b8..33e0d0f9ded 100644 --- a/lib/lib.webworker.d.ts +++ b/lib/lib.webworker.d.ts @@ -286,7 +286,7 @@ interface Console { select(element: any): void; time(timerName?: string): void; timeEnd(timerName?: string): void; - trace(): void; + trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; } @@ -526,7 +526,7 @@ interface IDBDatabase extends EventTarget { objectStoreNames: DOMStringList; onabort: (ev: Event) => any; onerror: (ev: Event) => any; - version: string; + version: number; close(): void; createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; diff --git a/lib/tsc.js b/lib/tsc.js index 543deadb433..2208201fef0 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -19,7 +19,7 @@ var ts; function OperationCanceledException() { } return OperationCanceledException; - })(); + }()); ts.OperationCanceledException = OperationCanceledException; (function (ExitStatus) { ExitStatus[ExitStatus["Success"] = 0] = "Success"; @@ -636,7 +636,8 @@ var ts; if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { directoryComponents.length--; } - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + var joinStartIndex; + for (joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } @@ -773,6 +774,12 @@ var ts; return copiedList; } ts.copyListRemovingItem = copyListRemovingItem; + function createGetCanonicalFileName(useCaseSensitivefileNames) { + return useCaseSensitivefileNames + ? (function (fileName) { return fileName; }) + : (function (fileName) { return fileName.toLowerCase(); }); + } + ts.createGetCanonicalFileName = createGetCanonicalFileName; })(ts || (ts = {})); var ts; (function (ts) { @@ -911,7 +918,7 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - function createWatchedFileSet(interval, chunkSize) { + function createPollingWatchedFileSet(interval, chunkSize) { if (interval === void 0) { interval = 2500; } if (chunkSize === void 0) { chunkSize = 30; } var watchedFiles = []; @@ -925,13 +932,13 @@ var ts; if (!watchedFile) { return; } - _fs.stat(watchedFile.fileName, function (err, stats) { + _fs.stat(watchedFile.filePath, function (err, stats) { if (err) { - watchedFile.callback(watchedFile.fileName); + watchedFile.callback(watchedFile.filePath); } else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { - watchedFile.mtime = getModifiedTime(watchedFile.fileName); - watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0); + watchedFile.mtime = getModifiedTime(watchedFile.filePath); + watchedFile.callback(watchedFile.filePath, watchedFile.mtime.getTime() === 0); } }); } @@ -954,11 +961,11 @@ var ts; nextFileToCheck = nextToCheck; }, interval); } - function addFile(fileName, callback) { + function addFile(filePath, callback) { var file = { - fileName: fileName, + filePath: filePath, callback: callback, - mtime: getModifiedTime(fileName) + mtime: getModifiedTime(filePath) }; watchedFiles.push(file); if (watchedFiles.length === 1) { @@ -977,7 +984,77 @@ var ts; removeFile: removeFile }; } + function createWatchedFileSet() { + var dirWatchers = ts.createFileMap(); + var fileWatcherCallbacks = ts.createFileMap(); + return { addFile: addFile, removeFile: removeFile }; + function reduceDirWatcherRefCountForFile(filePath) { + var dirPath = ts.getDirectoryPath(filePath); + if (dirWatchers.contains(dirPath)) { + var watcher = dirWatchers.get(dirPath); + watcher.referenceCount -= 1; + if (watcher.referenceCount <= 0) { + watcher.close(); + dirWatchers.remove(dirPath); + } + } + } + function addDirWatcher(dirPath) { + if (dirWatchers.contains(dirPath)) { + var watcher_1 = dirWatchers.get(dirPath); + watcher_1.referenceCount += 1; + return; + } + var watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher.referenceCount = 1; + dirWatchers.set(dirPath, watcher); + return; + } + function addFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + fileWatcherCallbacks.get(filePath).push(callback); + } + else { + fileWatcherCallbacks.set(filePath, [callback]); + } + } + function addFile(filePath, callback) { + addFileWatcherCallback(filePath, callback); + addDirWatcher(ts.getDirectoryPath(filePath)); + return { filePath: filePath, callback: callback }; + } + function removeFile(watchedFile) { + removeFileWatcherCallback(watchedFile.filePath, watchedFile.callback); + reduceDirWatcherRefCountForFile(watchedFile.filePath); + } + function removeFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + var newCallbacks = ts.copyListRemovingItem(callback, fileWatcherCallbacks.get(filePath)); + if (newCallbacks.length === 0) { + fileWatcherCallbacks.remove(filePath); + } + else { + fileWatcherCallbacks.set(filePath, newCallbacks); + } + } + } + function fileEventHandler(eventName, relativeFileName, baseDirPath) { + var filePath = typeof relativeFileName !== "string" + ? undefined + : ts.toPath(relativeFileName, baseDirPath, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)); + if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) { + for (var _i = 0, _a = fileWatcherCallbacks.get(filePath); _i < _a.length; _i++) { + var fileCallback = _a[_i]; + fileCallback(filePath); + } + } + } + } + var pollingWatchedFileSet = createPollingWatchedFileSet(); var watchedFileSet = createWatchedFileSet(); + function isNode4OrLater() { + return parseInt(process.version.charAt(1)) >= 4; + } var platform = _os.platform(); var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; function readFile(fileName, encoding) { @@ -1019,7 +1096,7 @@ var ts; } } function getCanonicalPath(path) { - return useCaseSensitiveFileNames ? path.toLowerCase() : path; + return useCaseSensitiveFileNames ? path : path.toLowerCase(); } function readDirectory(path, extension, exclude) { var result = []; @@ -1059,14 +1136,22 @@ var ts; }, readFile: readFile, writeFile: writeFile, - watchFile: function (fileName, callback) { - var watchedFile = watchedFileSet.addFile(fileName, callback); + watchFile: function (filePath, callback) { + var watchSet = isNode4OrLater() ? watchedFileSet : pollingWatchedFileSet; + var watchedFile = watchSet.addFile(filePath, callback); return { - close: function () { return watchedFileSet.removeFile(watchedFile); } + close: function () { return watchSet.removeFile(watchedFile); } }; }, watchDirectory: function (path, callback, recursive) { - return _fs.watch(path, { persistent: true, recursive: !!recursive }, function (eventName, relativeFileName) { + var options; + if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + options = { persistent: true, recursive: !!recursive }; + } + else { + options = { persistent: true }; + } + return _fs.watch(path, options, function (eventName, relativeFileName) { if (eventName === "rename") { callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(path, relativeFileName))); } @@ -1325,7 +1410,6 @@ var ts; Cannot_find_parameter_0: { code: 1225, category: ts.DiagnosticCategory.Error, key: "Cannot_find_parameter_0_1225", message: "Cannot find parameter '{0}'." }, Type_predicate_0_is_not_assignable_to_1: { code: 1226, category: ts.DiagnosticCategory.Error, key: "Type_predicate_0_is_not_assignable_to_1_1226", message: "Type predicate '{0}' is not assignable to '{1}'." }, Parameter_0_is_not_in_the_same_position_as_parameter_1: { code: 1227, category: ts.DiagnosticCategory.Error, key: "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", message: "Parameter '{0}' is not in the same position as parameter '{1}'." }, - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: { code: 1228, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", message: "A type predicate is only allowed in return type position for functions and methods." }, A_type_predicate_cannot_reference_a_rest_parameter: { code: 1229, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_a_rest_parameter_1229", message: "A type predicate cannot reference a rest parameter." }, A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: { code: 1230, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", message: "A type predicate cannot reference element '{0}' in a binding pattern." }, An_export_assignment_can_only_be_used_in_a_module: { code: 1231, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_can_only_be_used_in_a_module_1231", message: "An export assignment can only be used in a module." }, @@ -1561,7 +1645,6 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, - A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -1590,6 +1673,16 @@ var ts; Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, + Cannot_re_export_name_that_is_not_defined_in_the_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_re_export_name_that_is_not_defined_in_the_module_2661", message: "Cannot re-export name that is not defined in the module." }, + Cannot_find_name_0_Did_you_mean_the_static_member_1_0: { code: 2662, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", message: "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?" }, + Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: { code: 2663, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", message: "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?" }, + Invalid_module_name_in_augmentation_module_0_cannot_be_found: { code: 2664, category: ts.DiagnosticCategory.Error, key: "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", message: "Invalid module name in augmentation, module '{0}' cannot be found." }, + Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope: { code: 2665, category: ts.DiagnosticCategory.Error, key: "Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope_2665", message: "Module augmentation cannot introduce new names in the top level scope." }, + Exports_and_export_assignments_are_not_permitted_in_module_augmentations: { code: 2666, category: ts.DiagnosticCategory.Error, key: "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", message: "Exports and export assignments are not permitted in module augmentations." }, + Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: { code: 2667, category: ts.DiagnosticCategory.Error, key: "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", message: "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module." }, + export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: { code: 2668, category: ts.DiagnosticCategory.Error, key: "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", message: "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible." }, + Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: { code: 2669, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", message: "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations." }, + Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: { code: 2670, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", message: "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -1754,6 +1847,7 @@ var ts; _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", message: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", message: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", message: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: { code: 7015, category: ts.DiagnosticCategory.Error, key: "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", message: "Element implicitly has an 'any' type because index expression is not of type 'number'." }, Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation_7016", message: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index_signature_of_object_type_implicitly_has_an_any_type_7017", message: "Index signature of object type implicitly has an 'any' type." }, Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: ts.DiagnosticCategory.Error, key: "Object_literal_s_property_0_implicitly_has_an_1_type_7018", message: "Object literal's property '{0}' implicitly has an '{1}' type." }, @@ -1849,6 +1943,7 @@ var ts; "protected": 111, "public": 112, "require": 127, + "global": 134, "return": 94, "set": 129, "static": 113, @@ -1869,7 +1964,7 @@ var ts; "yield": 114, "async": 118, "await": 119, - "of": 134, + "of": 135, "{": 15, "}": 16, "(": 17, @@ -3130,7 +3225,7 @@ var ts; break; } } - return token = 238; + return token = 239; } function scanJsxIdentifier() { if (tokenIsIdentifierOrKeyword(token)) { @@ -3296,7 +3391,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 250) { + while (node && node.kind !== 251) { node = node.parent; } return node; @@ -3380,6 +3475,28 @@ var ts; isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function isAmbientModule(node) { + return node && node.kind === 221 && + (node.name.kind === 9 || isGlobalScopeAugmentation(node)); + } + ts.isAmbientModule = isAmbientModule; + function isGlobalScopeAugmentation(module) { + return !!(module.flags & 2097152); + } + ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; + function isExternalModuleAugmentation(node) { + if (!node || !isAmbientModule(node)) { + return false; + } + switch (node.parent.kind) { + case 251: + return isExternalModule(node.parent); + case 222: + return isAmbientModule(node.parent.parent) && !isExternalModule(node.parent.parent.parent); + } + return false; + } + ts.isExternalModuleAugmentation = isExternalModuleAugmentation; function getEnclosingBlockScopeContainer(node) { var current = node.parent; while (current) { @@ -3387,15 +3504,15 @@ var ts; return current; } switch (current.kind) { - case 250: - case 222: - case 246: - case 220: - case 201: + case 251: + case 223: + case 247: + case 221: case 202: case 203: + case 204: return current; - case 194: + case 195: if (!isFunctionLike(current.parent)) { return current; } @@ -3406,9 +3523,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 213 && + declaration.kind === 214 && declaration.parent && - declaration.parent.kind === 246; + declaration.parent.kind === 247; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3444,23 +3561,24 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 250: + case 251: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 213: - case 165: - case 216: - case 188: + case 214: + case 166: case 217: + case 189: + case 218: + case 221: case 220: + case 250: + case 216: + case 176: + case 144: case 219: - case 249: - case 215: - case 175: - case 143: errorNode = node.name; break; } @@ -3486,11 +3604,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 219 && isConst(node); + return node.kind === 220 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 165 || isBindingPattern(node))) { + while (node && (node.kind === 166 || isBindingPattern(node))) { node = node.parent; } return node; @@ -3498,14 +3616,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 213) { + if (node.kind === 214) { node = node.parent; } - if (node && node.kind === 214) { + if (node && node.kind === 215) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 195) { + if (node && node.kind === 196) { flags |= node.flags; } return flags; @@ -3520,7 +3638,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 197 && node.expression.kind === 9; + return node.kind === 198 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -3536,7 +3654,7 @@ var ts; } ts.getJsDocComments = getJsDocComments; function getJsDocCommentsFromText(node, text) { - var commentRanges = (node.kind === 138 || node.kind === 137) ? + var commentRanges = (node.kind === 139 || node.kind === 138) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, isJsDocComment); @@ -3550,7 +3668,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (150 <= node.kind && node.kind <= 162) { + if (151 <= node.kind && node.kind <= 163) { return true; } switch (node.kind) { @@ -3561,56 +3679,56 @@ var ts; case 131: return true; case 103: - return node.parent.kind !== 179; - case 190: + return node.parent.kind !== 180; + case 191: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); case 69: - if (node.parent.kind === 135 && node.parent.right === node) { + if (node.parent.kind === 136 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 168 && node.parent.name === node) { + else if (node.parent.kind === 169 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 69 || node.kind === 135 || node.kind === 168, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); - case 135: - case 168: + ts.Debug.assert(node.kind === 69 || node.kind === 136 || node.kind === 169, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + case 136: + case 169: case 97: var parent_1 = node.parent; - if (parent_1.kind === 154) { + if (parent_1.kind === 155) { return false; } - if (150 <= parent_1.kind && parent_1.kind <= 162) { + if (151 <= parent_1.kind && parent_1.kind <= 163) { return true; } switch (parent_1.kind) { - case 190: + case 191: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 137: - return node === parent_1.constraint; - case 141: - case 140: case 138: - case 213: + return node === parent_1.constraint; + case 142: + case 141: + case 139: + case 214: return node === parent_1.type; - case 215: - case 175: + case 216: case 176: + case 177: + case 145: case 144: case 143: - case 142: - case 145: case 146: - return node === parent_1.type; case 147: + return node === parent_1.type; case 148: case 149: + case 150: return node === parent_1.type; - case 173: + case 174: return node === parent_1.type; - case 170: case 171: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; case 172: + return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; + case 173: return false; } } @@ -3621,23 +3739,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 206: + case 207: return visitor(node); - case 222: - case 194: - case 198: + case 223: + case 195: case 199: case 200: case 201: case 202: case 203: - case 207: + case 204: case 208: - case 243: - case 244: case 209: - case 211: - case 246: + case 244: + case 245: + case 210: + case 212: + case 247: return ts.forEachChild(node, traverse); } } @@ -3647,23 +3765,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186: + case 187: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 219: - case 217: case 220: case 218: - case 216: - case 188: + case 221: + case 219: + case 217: + case 189: return; default: if (isFunctionLike(node)) { var name_5 = node.name; - if (name_5 && name_5.kind === 136) { + if (name_5 && name_5.kind === 137) { traverse(name_5.expression); return; } @@ -3678,14 +3796,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 165: - case 249: - case 138: - case 247: - case 141: - case 140: + case 166: + case 250: + case 139: case 248: - case 213: + case 142: + case 141: + case 249: + case 214: return true; } } @@ -3693,11 +3811,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 145 || node.kind === 146); + return node && (node.kind === 146 || node.kind === 147); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 216 || node.kind === 188); + return node && (node.kind === 217 || node.kind === 189); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -3706,32 +3824,32 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 144: - case 175: - case 215: - case 176: - case 143: - case 142: case 145: + case 176: + case 216: + case 177: + case 144: + case 143: case 146: case 147: case 148: case 149: - case 152: + case 150: case 153: + case 154: return true; } } ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 215: - case 175: + case 147: + case 216: + case 176: return true; } return false; @@ -3739,24 +3857,24 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 201: case 202: case 203: - case 199: + case 204: case 200: + case 201: return true; - case 209: + case 210: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 194 && isFunctionLike(node.parent); + return node && node.kind === 195 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 && node.parent.kind === 167; + return node && node.kind === 144 && node.parent.kind === 168; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isIdentifierTypePredicate(predicate) { @@ -3788,39 +3906,39 @@ var ts; return undefined; } switch (node.kind) { - case 136: + case 137: if (isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 139: - if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { + case 140: + if (node.parent.kind === 139 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 176: + case 177: if (!includeArrowFunctions) { continue; } - case 215: - case 175: - case 220: - case 141: - case 140: - case 143: + case 216: + case 176: + case 221: case 142: + case 141: case 144: + case 143: case 145: case 146: case 147: case 148: case 149: - case 219: - case 250: + case 150: + case 220: + case 251: return node; } } @@ -3833,25 +3951,25 @@ var ts; return node; } switch (node.kind) { - case 136: + case 137: node = node.parent; break; - case 215: - case 175: + case 216: case 176: + case 177: if (!stopOnFunctions) { continue; } - case 141: - case 140: - case 143: case 142: + case 141: case 144: + case 143: case 145: case 146: + case 147: return node; - case 139: - if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { + case 140: + if (node.parent.kind === 139 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { @@ -3865,12 +3983,12 @@ var ts; function getEntityNameFromTypeNode(node) { if (node) { switch (node.kind) { - case 151: + case 152: return node.typeName; - case 190: + case 191: return node.expression; case 69: - case 135: + case 136: return node; } } @@ -3878,7 +3996,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 172) { + if (node.kind === 173) { return node.tag; } return node.expression; @@ -3886,54 +4004,36 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 216: + case 217: return true; - case 141: - return node.parent.kind === 216; - case 138: - return node.parent.body && node.parent.parent.kind === 216; - case 145: + case 142: + return node.parent.kind === 217; case 146: - case 143: - return node.body && node.parent.kind === 216; + case 147: + case 144: + return node.body !== undefined + && node.parent.kind === 217; + case 139: + return node.parent.body !== undefined + && (node.parent.kind === 145 + || node.parent.kind === 144 + || node.parent.kind === 147) + && node.parent.parent.kind === 217; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { - switch (node.kind) { - case 216: - if (node.decorators) { - return true; - } - return false; - case 141: - case 138: - if (node.decorators) { - return true; - } - return false; - case 145: - if (node.body && node.decorators) { - return true; - } - return false; - case 143: - case 146: - if (node.body && node.decorators) { - return true; - } - return false; - } - return false; + return node.decorators !== undefined + && nodeCanBeDecorated(node); } ts.nodeIsDecorated = nodeIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 168; + return node.kind === 169; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 169; + return node.kind === 170; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -3943,42 +4043,42 @@ var ts; case 99: case 84: case 10: - case 166: case 167: case 168: case 169: case 170: case 171: case 172: - case 191: case 173: + case 192: case 174: case 175: - case 188: case 176: - case 179: + case 189: case 177: + case 180: case 178: - case 181: + case 179: case 182: case 183: case 184: - case 187: case 185: - case 11: - case 189: - case 235: - case 236: + case 188: case 186: - case 180: + case 11: + case 190: + case 236: + case 237: + case 187: + case 181: return true; - case 135: - while (node.parent.kind === 135) { + case 136: + while (node.parent.kind === 136) { node = node.parent; } - return node.parent.kind === 154; + return node.parent.kind === 155; case 69: - if (node.parent.kind === 154) { + if (node.parent.kind === 155) { return true; } case 8: @@ -3986,47 +4086,47 @@ var ts; case 97: var parent_2 = node.parent; switch (parent_2.kind) { - case 213: - case 138: + case 214: + case 139: + case 142: case 141: - case 140: - case 249: - case 247: - case 165: + case 250: + case 248: + case 166: return parent_2.initializer === node; - case 197: case 198: case 199: case 200: - case 206: + case 201: case 207: case 208: - case 243: - case 210: - case 208: + case 209: + case 244: + case 211: + case 209: return parent_2.expression === node; - case 201: + case 202: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 214) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 215) || forStatement.condition === node || forStatement.incrementor === node; - case 202: case 203: + case 204: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 215) || forInStatement.expression === node; - case 173: - case 191: - return node === parent_2.expression; + case 174: case 192: return node === parent_2.expression; - case 136: + case 193: return node === parent_2.expression; - case 139: + case 137: + return node === parent_2.expression; + case 140: + case 243: case 242: - case 241: return true; - case 190: + case 191: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -4048,7 +4148,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 && node.moduleReference.kind === 234; + return node.kind === 224 && node.moduleReference.kind === 235; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -4057,7 +4157,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 && node.moduleReference.kind !== 234; + return node.kind === 224 && node.moduleReference.kind !== 235; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -4069,7 +4169,7 @@ var ts; } ts.isInJavaScriptFile = isInJavaScriptFile; function isRequireCall(expression) { - return expression.kind === 170 && + return expression.kind === 171 && expression.expression.kind === 69 && expression.expression.text === "require" && expression.arguments.length === 1 && @@ -4077,11 +4177,11 @@ var ts; } ts.isRequireCall = isRequireCall; function getSpecialPropertyAssignmentKind(expression) { - if (expression.kind !== 183) { + if (expression.kind !== 184) { return 0; } var expr = expression; - if (expr.operatorToken.kind !== 56 || expr.left.kind !== 168) { + if (expr.operatorToken.kind !== 56 || expr.left.kind !== 169) { return 0; } var lhs = expr.left; @@ -4097,7 +4197,7 @@ var ts; else if (lhs.expression.kind === 97) { return 4; } - else if (lhs.expression.kind === 168) { + else if (lhs.expression.kind === 169) { var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 69 && innerPropertyAccess.name.text === "prototype") { return 3; @@ -4107,30 +4207,33 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 224) { + if (node.kind === 225) { return node.moduleSpecifier; } - if (node.kind === 223) { + if (node.kind === 224) { var reference = node.moduleReference; - if (reference.kind === 234) { + if (reference.kind === 235) { return reference.expression; } } - if (node.kind === 230) { + if (node.kind === 231) { return node.moduleSpecifier; } + if (node.kind === 221 && node.name.kind === 9) { + return node.name; + } } ts.getExternalModuleName = getExternalModuleName; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 138: + case 139: + case 144: case 143: - case 142: + case 249: case 248: - case 247: + case 142: case 141: - case 140: return node.questionToken !== undefined; } } @@ -4138,9 +4241,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 263 && + return node.kind === 264 && node.parameters.length > 0 && - node.parameters[0].type.kind === 265; + node.parameters[0].type.kind === 266; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -4154,15 +4257,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 271); + return getJSDocTag(node, 272); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 270); + return getJSDocTag(node, 271); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 272); + return getJSDocTag(node, 273); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -4171,7 +4274,7 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 269) { + if (t.kind === 270) { var parameterTag = t; var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; if (name_6.text === parameterName) { @@ -4190,12 +4293,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32) { - if (node.type && node.type.kind === 264) { + if (node.type && node.type.kind === 265) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 264; + return paramTag.typeExpression.type.kind === 265; } } return node.dotDotDotToken !== undefined; @@ -4216,7 +4319,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 164 || node.kind === 163); + return !!node && (node.kind === 165 || node.kind === 164); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -4240,34 +4343,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 176: - case 165: - case 216: - case 188: - case 144: - case 219: - case 249: - case 232: - case 215: - case 175: - case 145: - case 225: - case 223: - case 228: + case 177: + case 166: case 217: - case 143: - case 142: + case 189: + case 145: case 220: - case 226: - case 138: - case 247: - case 141: - case 140: + case 250: + case 233: + case 216: + case 176: case 146: - case 248: + case 226: + case 224: + case 229: case 218: - case 137: - case 213: + case 144: + case 143: + case 221: + case 227: + case 139: + case 248: + case 142: + case 141: + case 147: + case 249: + case 219: + case 138: + case 214: return true; } return false; @@ -4275,25 +4378,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 205: - case 204: - case 212: - case 199: - case 197: - case 196: - case 202: - case 203: - case 201: - case 198: - case 209: case 206: - case 208: - case 210: - case 211: - case 195: + case 205: + case 213: case 200: + case 198: + case 197: + case 203: + case 204: + case 202: + case 199: + case 210: case 207: - case 229: + case 209: + case 211: + case 212: + case 196: + case 201: + case 208: + case 230: return true; default: return false; @@ -4302,13 +4405,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 144: - case 141: - case 143: case 145: - case 146: case 142: - case 149: + case 144: + case 146: + case 147: + case 143: + case 150: return true; default: return false; @@ -4320,7 +4423,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 228 || parent.kind === 232) { + if (parent.kind === 229 || parent.kind === 233) { if (parent.propertyName) { return true; } @@ -4334,40 +4437,40 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 141: - case 140: - case 143: case 142: - case 145: + case 141: + case 144: + case 143: case 146: - case 249: - case 247: - case 168: + case 147: + case 250: + case 248: + case 169: return parent.name === node; - case 135: + case 136: if (parent.right === node) { - while (parent.kind === 135) { + while (parent.kind === 136) { parent = parent.parent; } - return parent.kind === 154; + return parent.kind === 155; } return false; - case 165: - case 228: + case 166: + case 229: return parent.propertyName === node; - case 232: + case 233: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 223 || - node.kind === 225 && !!node.name || - node.kind === 226 || - node.kind === 228 || - node.kind === 232 || - node.kind === 229 && node.expression.kind === 69; + return node.kind === 224 || + node.kind === 226 && !!node.name || + node.kind === 227 || + node.kind === 229 || + node.kind === 233 || + node.kind === 230 && node.expression.kind === 69; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -4449,7 +4552,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 70 <= token && token <= 134; + return 70 <= token && token <= 135; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -4469,7 +4572,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 136 && + return name.kind === 137 && !isStringOrNumericLiteral(name.expression.kind) && !isWellKnownSymbolSyntactically(name.expression); } @@ -4482,7 +4585,7 @@ var ts; if (name.kind === 69 || name.kind === 9 || name.kind === 8) { return name.text; } - if (name.kind === 136) { + if (name.kind === 137) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -4519,18 +4622,18 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 138; + return root.kind === 139; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 165) { + while (node.kind === 166) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 220 || n.kind === 250; + return isFunctionLike(n) || n.kind === 221 || n.kind === 251; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function cloneNode(node, location, flags, parent) { @@ -4563,7 +4666,7 @@ var ts; } ts.cloneEntityName = cloneEntityName; function isQualifiedName(node) { - return node.kind === 135; + return node.kind === 136; } ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { @@ -4876,7 +4979,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 144 && nodeIsPresent(member.body)) { + if (member.kind === 145 && nodeIsPresent(member.body)) { return member; } }); @@ -4893,10 +4996,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 145) { + if (accessor.kind === 146) { getAccessor = accessor; } - else if (accessor.kind === 146) { + else if (accessor.kind === 147) { setAccessor = accessor; } else { @@ -4905,7 +5008,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 145 || member.kind === 146) + if ((member.kind === 146 || member.kind === 147) && (member.flags & 64) === (accessor.flags & 64)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -4916,10 +5019,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 145 && !getAccessor) { + if (member.kind === 146 && !getAccessor) { getAccessor = member; } - if (member.kind === 146 && !setAccessor) { + if (member.kind === 147 && !setAccessor) { setAccessor = member; } } @@ -5085,24 +5188,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 168: case 169: - case 171: case 170: - case 235: - case 236: case 172: - case 166: - case 174: + case 171: + case 236: + case 237: + case 173: case 167: - case 188: case 175: + case 168: + case 189: + case 176: case 69: case 10: case 8: case 9: case 11: - case 185: + case 186: case 84: case 93: case 97: @@ -5119,7 +5222,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 190 && + return node.kind === 191 && node.parent.token === 83 && isClassLike(node.parent.parent); } @@ -5140,16 +5243,16 @@ var ts; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 135 && node.parent.right === node) || - (node.parent.kind === 168 && node.parent.name === node); + return (node.parent.kind === 136 && node.parent.right === node) || + (node.parent.kind === 169 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 167) { + if (kind === 168) { return expression.properties.length === 0; } - if (kind === 166) { + if (kind === 167) { return expression.elements.length === 0; } return false; @@ -5393,9 +5496,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 137) { + if (d && d.kind === 138) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 218) { return current; } } @@ -5403,7 +5506,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return node.flags & 56 && node.parent.kind === 144 && ts.isClassLike(node.parent.parent); + return node.flags & 56 && node.parent.kind === 145 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); @@ -5413,7 +5516,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 250) { + if (kind === 251) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -5449,26 +5552,26 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 135: + case 136: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 137: + case 138: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 248: + case 249: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 138: + case 139: + case 142: case 141: - case 140: - case 247: - case 213: - case 165: + case 248: + case 214: + case 166: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -5477,24 +5580,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 152: case 153: - case 147: + case 154: case 148: case 149: + case 150: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 175: - case 215: + case 147: case 176: + case 216: + case 177: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -5505,160 +5608,153 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 151: + case 152: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 150: + case 151: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 154: - return visitNode(cbNode, node.exprName); case 155: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 156: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNodes, node.members); case 157: - return visitNodes(cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 158: + return visitNodes(cbNodes, node.elementTypes); case 159: - return visitNodes(cbNodes, node.types); case 160: + return visitNodes(cbNodes, node.types); + case 161: return visitNode(cbNode, node.type); - case 163: case 164: - return visitNodes(cbNodes, node.elements); - case 166: + case 165: return visitNodes(cbNodes, node.elements); case 167: - return visitNodes(cbNodes, node.properties); + return visitNodes(cbNodes, node.elements); case 168: + return visitNodes(cbNodes, node.properties); + case 169: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 169: + case 170: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 170: case 171: + case 172: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 172: + case 173: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 173: + case 174: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 174: - return visitNode(cbNode, node.expression); - case 177: + case 175: return visitNode(cbNode, node.expression); case 178: return visitNode(cbNode, node.expression); case 179: return visitNode(cbNode, node.expression); - case 181: - return visitNode(cbNode, node.operand); - case 186: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 180: return visitNode(cbNode, node.expression); case 182: return visitNode(cbNode, node.operand); + case 187: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 181: + return visitNode(cbNode, node.expression); case 183: + return visitNode(cbNode, node.operand); + case 184: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 191: + case 192: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 184: + case 185: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 187: + case 188: return visitNode(cbNode, node.expression); - case 194: - case 221: + case 195: + case 222: return visitNodes(cbNodes, node.statements); - case 250: + case 251: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 195: + case 196: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 214: + case 215: return visitNodes(cbNodes, node.declarations); - case 197: - return visitNode(cbNode, node.expression); case 198: + return visitNode(cbNode, node.expression); + case 199: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 199: + case 200: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 200: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 201: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.incrementor) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 202: return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || + visitNode(cbNode, node.condition) || + visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); case 203: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 204: - case 205: - return visitNode(cbNode, node.label); - case 206: - return visitNode(cbNode, node.expression); - case 207: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 205: + case 206: + return visitNode(cbNode, node.label); + case 207: + return visitNode(cbNode, node.expression); case 208: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 209: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 222: + case 223: return visitNodes(cbNodes, node.clauses); - case 243: + case 244: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 244: + case 245: return visitNodes(cbNodes, node.statements); - case 209: + case 210: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 210: - return visitNode(cbNode, node.expression); case 211: + return visitNode(cbNode, node.expression); + case 212: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 246: + case 247: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 139: + case 140: return visitNode(cbNode, node.expression); - case 216: - case 188: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); case 217: + case 189: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -5670,125 +5766,132 @@ var ts; visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 219: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 249: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); + visitNodes(cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); case 220: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 250: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 221: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 223: + case 224: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 224: + case 225: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 225: + case 226: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 226: - return visitNode(cbNode, node.name); case 227: - case 231: + return visitNode(cbNode, node.name); + case 228: + case 232: return visitNodes(cbNodes, node.elements); - case 230: + case 231: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 228: - case 232: + case 229: + case 233: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 229: + case 230: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 185: + case 186: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 192: + case 193: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 136: + case 137: return visitNode(cbNode, node.expression); - case 245: + case 246: return visitNodes(cbNodes, node.types); - case 190: + case 191: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 234: - return visitNode(cbNode, node.expression); - case 233: - return visitNodes(cbNodes, node.decorators); case 235: + return visitNode(cbNode, node.expression); + case 234: + return visitNodes(cbNodes, node.decorators); + case 236: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 236: case 237: + case 238: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 240: + case 241: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 241: - return visitNode(cbNode, node.expression); case 242: return visitNode(cbNode, node.expression); - case 239: + case 243: + return visitNode(cbNode, node.expression); + case 240: return visitNode(cbNode, node.tagName); - case 251: + case 252: return visitNode(cbNode, node.type); - case 255: - return visitNodes(cbNodes, node.types); case 256: return visitNodes(cbNodes, node.types); - case 254: + case 257: + return visitNodes(cbNodes, node.types); + case 255: return visitNode(cbNode, node.elementType); + case 259: + return visitNode(cbNode, node.type); case 258: return visitNode(cbNode, node.type); - case 257: - return visitNode(cbNode, node.type); - case 259: + case 260: return visitNodes(cbNodes, node.members); - case 261: + case 262: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 262: - return visitNode(cbNode, node.type); case 263: + return visitNode(cbNode, node.type); + case 264: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 264: - return visitNode(cbNode, node.type); case 265: return visitNode(cbNode, node.type); case 266: return visitNode(cbNode, node.type); - case 260: + case 267: + return visitNode(cbNode, node.type); + case 261: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 267: + case 268: return visitNodes(cbNodes, node.tags); - case 269: + case 270: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 270: - return visitNode(cbNode, node.typeExpression); case 271: return visitNode(cbNode, node.typeExpression); case 272: + return visitNode(cbNode, node.typeExpression); + case 273: return visitNodes(cbNodes, node.typeParameters); } } @@ -5895,9 +5998,9 @@ var ts; return; function visit(node) { switch (node.kind) { - case 195: - case 215: - case 138: + case 196: + case 216: + case 139: addJSDocComment(node); } forEachChild(node, visit); @@ -5931,7 +6034,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = new SourceFileConstructor(250, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(251, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -6222,7 +6325,7 @@ var ts; return token === 9 || token === 8 || ts.tokenIsIdentifierOrKeyword(token); } function parseComputedPropertyName() { - var node = createNode(136); + var node = createNode(137); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); @@ -6521,14 +6624,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 144: - case 149: case 145: + case 150: case 146: - case 141: - case 193: + case 147: + case 142: + case 194: return true; - case 143: + case 144: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 69 && methodDeclaration.name.originalKeywordKind === 121; @@ -6540,8 +6643,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 243: case 244: + case 245: return true; } } @@ -6550,65 +6653,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 215: + case 216: + case 196: case 195: - case 194: + case 199: case 198: - case 197: - case 210: + case 211: + case 207: + case 209: case 206: - case 208: case 205: + case 203: case 204: case 202: - case 203: case 201: - case 200: - case 207: - case 196: - case 211: - case 209: - case 199: + case 208: + case 197: case 212: + case 210: + case 200: + case 213: + case 225: case 224: - case 223: + case 231: case 230: - case 229: - case 220: - case 216: + case 221: case 217: - case 219: case 218: + case 220: + case 219: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 249; + return node.kind === 250; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 148: - case 142: case 149: - case 140: - case 147: + case 143: + case 150: + case 141: + case 148: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 213) { + if (node.kind !== 214) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 138) { + if (node.kind !== 139) { return false; } var parameter = node; @@ -6708,7 +6811,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(21)) { - var node = createNode(135, entity.pos); + var node = createNode(136, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -6725,7 +6828,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(185); + var template = createNode(186); template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12, "Template head has wrong token kind"); var templateSpans = []; @@ -6738,7 +6841,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(192); + var span = createNode(193); span.expression = allowInAnd(parseExpression); var literal; if (token === 16) { @@ -6752,7 +6855,7 @@ var ts; return finishNode(span); } function parseStringLiteralTypeNode() { - return parseLiteralLikeNode(162, true); + return parseLiteralLikeNode(163, true); } function parseLiteralNode(internName) { return parseLiteralLikeNode(token, internName); @@ -6780,12 +6883,9 @@ var ts; } return node; } - function parseTypeReferenceOrTypePredicate() { + function parseTypeReference() { var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - if (typeName.kind === 69 && token === 124 && !scanner.hasPrecedingLineBreak()) { - return parseTypePredicate(typeName); - } - var node = createNode(151, typeName.pos); + var node = createNode(152, typeName.pos); node.typeName = typeName; if (!scanner.hasPrecedingLineBreak() && token === 25) { node.typeArguments = parseBracketedList(18, parseType, 25, 27); @@ -6794,24 +6894,24 @@ var ts; } function parseTypePredicate(lhs) { nextToken(); - var node = createNode(150, lhs.pos); + var node = createNode(151, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(161); + var node = createNode(162); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(154); + var node = createNode(155); parseExpected(101); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(137); + var node = createNode(138); node.name = parseIdentifier(); if (parseOptional(83)) { if (isStartOfType() || !isStartOfExpression()) { @@ -6844,7 +6944,7 @@ var ts; } } function parseParameter() { - var node = createNode(138); + var node = createNode(139); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(22); @@ -6869,10 +6969,10 @@ var ts; signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList); if (returnTokenRequired) { parseExpected(returnToken); - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } else if (parseOptional(returnToken)) { - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } } function parseParameterList(yieldContext, awaitContext, requireCompleteParameterList) { @@ -6899,7 +6999,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 148) { + if (kind === 149) { parseExpected(92); } fillSignature(54, false, false, false, node); @@ -6939,7 +7039,7 @@ var ts; return token === 54 || token === 24 || token === 20; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(149, fullStart); + var node = createNode(150, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(16, parseParameter, 19, 20); @@ -6952,7 +7052,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(53); if (token === 17 || token === 25) { - var method = createNode(142, fullStart); + var method = createNode(143, fullStart); method.name = name; method.questionToken = questionToken; fillSignature(54, false, false, false, method); @@ -6960,7 +7060,7 @@ var ts; return finishNode(method); } else { - var property = createNode(140, fullStart); + var property = createNode(141, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -7005,14 +7105,14 @@ var ts; switch (token) { case 17: case 25: - return parseSignatureMember(147); + return parseSignatureMember(148); case 19: return isIndexSignature() ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); case 92: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(148); + return parseSignatureMember(149); } case 9: case 8: @@ -7042,7 +7142,7 @@ var ts; return token === 17 || token === 25; } function parseTypeLiteral() { - var node = createNode(155); + var node = createNode(156); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -7058,12 +7158,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(157); + var node = createNode(158); node.elementTypes = parseBracketedList(19, parseType, 19, 20); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(160); + var node = createNode(161); parseExpected(17); node.type = parseType(); parseExpected(18); @@ -7071,7 +7171,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 153) { + if (kind === 154) { parseExpected(92); } fillSignature(34, false, false, false, node); @@ -7089,7 +7189,7 @@ var ts; case 120: case 131: var node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReferenceOrTypePredicate(); + return node || parseTypeReference(); case 9: return parseStringLiteralTypeNode(); case 103: @@ -7112,7 +7212,7 @@ var ts; case 17: return parseParenthesizedType(); default: - return parseTypeReferenceOrTypePredicate(); + return parseTypeReference(); } } function isStartOfType() { @@ -7145,7 +7245,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(19)) { parseExpected(20); - var node = createNode(156, type.pos); + var node = createNode(157, type.pos); node.elementType = type; type = finishNode(node); } @@ -7167,10 +7267,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(159, parseArrayTypeOrHigher, 46); + return parseUnionOrIntersectionType(160, parseArrayTypeOrHigher, 46); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(158, parseIntersectionTypeOrHigher, 47); + return parseUnionOrIntersectionType(159, parseIntersectionTypeOrHigher, 47); } function isStartOfFunctionType() { if (token === 25) { @@ -7199,15 +7299,35 @@ var ts; } return false; } + function parseTypeOrTypePredicate() { + var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); + var type = parseType(); + if (typePredicateVariable) { + var node = createNode(151, typePredicateVariable.pos); + node.parameterName = typePredicateVariable; + node.type = type; + return finishNode(node); + } + else { + return type; + } + } + function parseTypePredicatePrefix() { + var id = parseIdentifier(); + if (token === 124 && !scanner.hasPrecedingLineBreak()) { + nextToken(); + return id; + } + } function parseType() { return doOutsideOfContext(10, parseTypeWorker); } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(152); + return parseFunctionOrConstructorType(153); } if (token === 92) { - return parseFunctionOrConstructorType(153); + return parseFunctionOrConstructorType(154); } return parseUnionTypeOrHigher(); } @@ -7326,7 +7446,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(186); + var node = createNode(187); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 37 || isStartOfExpression())) { @@ -7340,8 +7460,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(176, identifier.pos); - var parameter = createNode(138, identifier.pos); + var node = createNode(177, identifier.pos); + var parameter = createNode(139, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -7452,7 +7572,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(176); + var node = createNode(177); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256); fillSignature(54, false, isAsync, !allowAmbiguity, node); @@ -7484,7 +7604,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(184, leftOperand.pos); + var node = createNode(185, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -7497,7 +7617,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 90 || t === 134; + return t === 90 || t === 135; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -7575,43 +7695,43 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(183, left.pos); + var node = createNode(184, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(191, left.pos); + var node = createNode(192, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(181); + var node = createNode(182); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(177); - nextToken(); - node.expression = parseSimpleUnaryExpression(); - return finishNode(node); - } - function parseTypeOfExpression() { var node = createNode(178); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } - function parseVoidExpression() { + function parseTypeOfExpression() { var node = createNode(179); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } + function parseVoidExpression() { + var node = createNode(180); + nextToken(); + node.expression = parseSimpleUnaryExpression(); + return finishNode(node); + } function isAwaitExpression() { if (token === 119) { if (inAwaitContext()) { @@ -7622,7 +7742,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(180); + var node = createNode(181); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -7641,7 +7761,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 173) { + if (simpleUnaryExpression.kind === 174) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -7689,7 +7809,7 @@ var ts; } function parseIncrementExpression() { if (token === 41 || token === 42) { - var node = createNode(181); + var node = createNode(182); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -7701,7 +7821,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 || token === 42) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(182, expression.pos); + var node = createNode(183, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -7724,7 +7844,7 @@ var ts; if (token === 17 || token === 21 || token === 19) { return expression; } - var node = createNode(168, expression.pos); + var node = createNode(169, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); @@ -7743,8 +7863,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 237) { - var node = createNode(235, opening.pos); + if (opening.kind === 238) { + var node = createNode(236, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -7754,14 +7874,14 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 236); + ts.Debug.assert(opening.kind === 237); result = opening; } if (inExpressionContext && token === 25) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(183, result.pos); + var badNode = createNode(184, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -7773,13 +7893,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(238, scanner.getStartPos()); + var node = createNode(239, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 238: + case 239: return parseJsxText(); case 15: return parseJsxExpression(false); @@ -7815,7 +7935,7 @@ var ts; var attributes = parseList(13, parseJsxAttribute); var node; if (token === 27) { - node = createNode(237, fullStart); + node = createNode(238, fullStart); scanJsxText(); } else { @@ -7827,7 +7947,7 @@ var ts; parseExpected(27, undefined, false); scanJsxText(); } - node = createNode(236, fullStart); + node = createNode(237, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -7838,7 +7958,7 @@ var ts; var elementName = parseIdentifierName(); while (parseOptional(21)) { scanJsxIdentifier(); - var node = createNode(135, elementName.pos); + var node = createNode(136, elementName.pos); node.left = elementName; node.right = parseIdentifierName(); elementName = finishNode(node); @@ -7846,7 +7966,7 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(242); + var node = createNode(243); parseExpected(15); if (token !== 16) { node.expression = parseAssignmentExpressionOrHigher(); @@ -7865,7 +7985,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(240); + var node = createNode(241); node.name = parseIdentifierName(); if (parseOptional(56)) { switch (token) { @@ -7880,7 +8000,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(241); + var node = createNode(242); parseExpected(15); parseExpected(22); node.expression = parseExpression(); @@ -7888,7 +8008,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(239); + var node = createNode(240); parseExpected(26); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -7901,7 +8021,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(173); + var node = createNode(174); parseExpected(25); node.type = parseType(); parseExpected(27); @@ -7912,7 +8032,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21); if (dotToken) { - var propertyAccess = createNode(168, expression.pos); + var propertyAccess = createNode(169, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -7920,7 +8040,7 @@ var ts; continue; } if (!inDecoratorContext() && parseOptional(19)) { - var indexedAccess = createNode(169, expression.pos); + var indexedAccess = createNode(170, expression.pos); indexedAccess.expression = expression; if (token !== 20) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -7934,7 +8054,7 @@ var ts; continue; } if (token === 11 || token === 12) { - var tagExpression = createNode(172, expression.pos); + var tagExpression = createNode(173, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 ? parseLiteralNode() @@ -7953,7 +8073,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(170, expression.pos); + var callExpr = createNode(171, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -7961,7 +8081,7 @@ var ts; continue; } else if (token === 17) { - var callExpr = createNode(170, expression.pos); + var callExpr = createNode(171, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -8056,28 +8176,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(174); + var node = createNode(175); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); return finishNode(node); } function parseSpreadElement() { - var node = createNode(187); + var node = createNode(188); parseExpected(22); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 ? parseSpreadElement() : - token === 24 ? createNode(189) : + token === 24 ? createNode(190) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(166); + var node = createNode(167); parseExpected(19); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024; @@ -8087,10 +8207,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(123)) { - return parseAccessorDeclaration(145, fullStart, decorators, modifiers); + return parseAccessorDeclaration(146, fullStart, decorators, modifiers); } else if (parseContextualModifier(129)) { - return parseAccessorDeclaration(146, fullStart, decorators, modifiers); + return parseAccessorDeclaration(147, fullStart, decorators, modifiers); } return undefined; } @@ -8111,7 +8231,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 || token === 16 || token === 56); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(248, fullStart); + var shorthandDeclaration = createNode(249, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56); @@ -8122,7 +8242,7 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(247, fullStart); + var propertyAssignment = createNode(248, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -8132,7 +8252,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(167); + var node = createNode(168); parseExpected(15); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024; @@ -8146,7 +8266,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(175); + var node = createNode(176); setModifiers(node, parseModifiers()); parseExpected(87); node.asteriskToken = parseOptionalToken(37); @@ -8168,7 +8288,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(171); + var node = createNode(172); parseExpected(92); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -8178,7 +8298,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(194); + var node = createNode(195); if (parseExpected(15, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -8206,12 +8326,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(196); + var node = createNode(197); parseExpected(23); return finishNode(node); } function parseIfStatement() { - var node = createNode(198); + var node = createNode(199); parseExpected(88); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8221,7 +8341,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(199); + var node = createNode(200); parseExpected(79); node.statement = parseStatement(); parseExpected(104); @@ -8232,7 +8352,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(200); + var node = createNode(201); parseExpected(104); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8255,21 +8375,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90)) { - var forInStatement = createNode(202, pos); + var forInStatement = createNode(203, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(134)) { - var forOfStatement = createNode(203, pos); + else if (parseOptional(135)) { + var forOfStatement = createNode(204, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(201, pos); + var forStatement = createNode(202, pos); forStatement.initializer = initializer; parseExpected(23); if (token !== 23 && token !== 18) { @@ -8287,7 +8407,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 205 ? 70 : 75); + parseExpected(kind === 206 ? 70 : 75); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -8295,7 +8415,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(206); + var node = createNode(207); parseExpected(94); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -8304,7 +8424,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(207); + var node = createNode(208); parseExpected(105); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8313,7 +8433,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(243); + var node = createNode(244); parseExpected(71); node.expression = allowInAnd(parseExpression); parseExpected(54); @@ -8321,7 +8441,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(244); + var node = createNode(245); parseExpected(77); parseExpected(54); node.statements = parseList(3, parseStatement); @@ -8331,12 +8451,12 @@ var ts; return token === 71 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(208); + var node = createNode(209); parseExpected(96); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); - var caseBlock = createNode(222, scanner.getStartPos()); + var caseBlock = createNode(223, scanner.getStartPos()); parseExpected(15); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(16); @@ -8344,14 +8464,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(210); + var node = createNode(211); parseExpected(98); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(211); + var node = createNode(212); parseExpected(100); node.tryBlock = parseBlock(false); node.catchClause = token === 72 ? parseCatchClause() : undefined; @@ -8362,7 +8482,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(246); + var result = createNode(247); parseExpected(72); if (parseExpected(17)) { result.variableDeclaration = parseVariableDeclaration(); @@ -8372,7 +8492,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(212); + var node = createNode(213); parseExpected(76); parseSemicolon(); return finishNode(node); @@ -8381,13 +8501,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 && parseOptional(54)) { - var labeledStatement = createNode(209, fullStart); + var labeledStatement = createNode(210, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(197, fullStart); + var expressionStatement = createNode(198, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -8432,6 +8552,8 @@ var ts; return false; } continue; + case 134: + return nextToken() === 15; case 89: nextToken(); return token === 9 || token === 37 || @@ -8489,6 +8611,7 @@ var ts; case 125: case 126: case 132: + case 134: return true; case 112: case 110: @@ -8532,9 +8655,9 @@ var ts; case 86: return parseForOrForInOrForOfStatement(); case 75: - return parseBreakOrContinueStatement(204); - case 70: return parseBreakOrContinueStatement(205); + case 70: + return parseBreakOrContinueStatement(206); case 94: return parseReturnStatement(); case 105: @@ -8566,6 +8689,7 @@ var ts; case 112: case 115: case 113: + case 134: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -8592,6 +8716,7 @@ var ts; return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 81: return parseEnumDeclaration(fullStart, decorators, modifiers); + case 134: case 125: case 126: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -8604,7 +8729,7 @@ var ts; parseExportDeclaration(fullStart, decorators, modifiers); default: if (decorators || modifiers) { - var node = createMissingNode(233, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(234, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -8625,16 +8750,16 @@ var ts; } function parseArrayBindingElement() { if (token === 24) { - return createNode(189); + return createNode(190); } - var node = createNode(165); + var node = createNode(166); node.dotDotDotToken = parseOptionalToken(22); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(165); + var node = createNode(166); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54) { @@ -8649,14 +8774,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(163); + var node = createNode(164); parseExpected(15); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(16); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(164); + var node = createNode(165); parseExpected(19); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(20); @@ -8675,7 +8800,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(213); + var node = createNode(214); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -8684,7 +8809,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(214); + var node = createNode(215); switch (token) { case 102: break; @@ -8698,7 +8823,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token === 134 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 135 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -8713,7 +8838,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(195, fullStart); + var node = createNode(196, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -8721,7 +8846,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(216, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87); @@ -8734,7 +8859,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(144, pos); + var node = createNode(145, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(121); @@ -8743,7 +8868,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(143, fullStart); + var method = createNode(144, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -8756,7 +8881,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(141, fullStart); + var property = createNode(142, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -8852,7 +8977,7 @@ var ts; decorators = []; decorators.pos = decoratorStart; } - var decorator = createNode(139, decoratorStart); + var decorator = createNode(140, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -8908,7 +9033,7 @@ var ts; } function parseClassElement() { if (token === 23) { - var result = createNode(193); + var result = createNode(194); nextToken(); return finishNode(result); } @@ -8939,10 +9064,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 188); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 189); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 217); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -8977,7 +9102,7 @@ var ts; } function parseHeritageClause() { if (token === 83 || token === 106) { - var node = createNode(245); + var node = createNode(246); node.token = token; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); @@ -8986,7 +9111,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(190); + var node = createNode(191); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25) { node.typeArguments = parseBracketedList(18, parseType, 25, 27); @@ -9000,7 +9125,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217, fullStart); + var node = createNode(218, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107); @@ -9011,7 +9136,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218, fullStart); + var node = createNode(219, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132); @@ -9023,13 +9148,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(249, scanner.getStartPos()); + var node = createNode(250, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(219, fullStart); + var node = createNode(220, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81); @@ -9044,7 +9169,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(221, scanner.getStartPos()); + var node = createNode(222, scanner.getStartPos()); if (parseExpected(15)) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -9055,7 +9180,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(220, fullStart); + var node = createNode(221, fullStart); var namespaceFlag = flags & 65536; node.decorators = decorators; setModifiers(node, modifiers); @@ -9067,16 +9192,25 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(220, fullStart); + var node = createNode(221, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - node.name = parseLiteralNode(true); + if (token === 134) { + node.name = parseIdentifier(); + node.flags |= 2097152; + } + else { + node.name = parseLiteralNode(true); + } node.body = parseModuleBlock(); return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = modifiers ? modifiers.flags : 0; - if (parseOptional(126)) { + if (token === 134) { + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + else if (parseOptional(126)) { flags |= 65536; } else { @@ -9104,7 +9238,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 24 && token !== 133) { - var importEqualsDeclaration = createNode(223, fullStart); + var importEqualsDeclaration = createNode(224, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -9114,7 +9248,7 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(224, fullStart); + var importDeclaration = createNode(225, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || @@ -9128,13 +9262,13 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(225, fullStart); + var importClause = createNode(226, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(24)) { - importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(227); + importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(228); } return finishNode(importClause); } @@ -9144,7 +9278,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(234); + var node = createNode(235); parseExpected(127); parseExpected(17); node.expression = parseModuleSpecifier(); @@ -9162,7 +9296,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(226); + var namespaceImport = createNode(227); parseExpected(37); parseExpected(116); namespaceImport.name = parseIdentifier(); @@ -9170,14 +9304,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(21, kind === 227 ? parseImportSpecifier : parseExportSpecifier, 15, 16); + node.elements = parseBracketedList(21, kind === 228 ? parseImportSpecifier : parseExportSpecifier, 15, 16); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(232); + return parseImportOrExportSpecifier(233); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(228); + return parseImportOrExportSpecifier(229); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -9196,13 +9330,13 @@ var ts; else { node.name = identifierName; } - if (kind === 228 && checkIdentifierIsKeyword) { + if (kind === 229 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230, fullStart); + var node = createNode(231, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37)) { @@ -9210,7 +9344,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(231); + node.exportClause = parseNamedImportsOrExports(232); if (token === 133 || (token === 9 && !scanner.hasPrecedingLineBreak())) { parseExpected(133); node.moduleSpecifier = parseModuleSpecifier(); @@ -9220,7 +9354,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(229, fullStart); + var node = createNode(230, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56)) { @@ -9292,10 +9426,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 - || node.kind === 223 && node.moduleReference.kind === 234 - || node.kind === 224 - || node.kind === 229 + || node.kind === 224 && node.moduleReference.kind === 235 + || node.kind === 225 || node.kind === 230 + || node.kind === 231 ? node : undefined; }); @@ -9330,7 +9464,7 @@ var ts; function parseJSDocTypeExpression(start, length) { scanner.setText(sourceText, start, length); token = nextToken(); - var result = createNode(251); + var result = createNode(252); parseExpected(15); result.type = parseJSDocTopLevelType(); parseExpected(16); @@ -9341,12 +9475,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47) { - var unionType = createNode(255, type.pos); + var unionType = createNode(256, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56) { - var optionalType = createNode(262, type.pos); + var optionalType = createNode(263, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -9357,20 +9491,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19) { - var arrayType = createNode(254, type.pos); + var arrayType = createNode(255, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20); type = finishNode(arrayType); } else if (token === 53) { - var nullableType = createNode(257, type.pos); + var nullableType = createNode(258, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49) { - var nonNullableType = createNode(258, type.pos); + var nonNullableType = createNode(259, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -9414,27 +9548,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(266); + var result = createNode(267); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(265); + var result = createNode(266); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(264); + var result = createNode(265); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(263); + var result = createNode(264); nextToken(); parseExpected(17); result.parameters = parseDelimitedList(22, parseJSDocParameter); @@ -9447,12 +9581,12 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(138); + var parameter = createNode(139); parameter.type = parseJSDocType(); return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(261); + var result = createNode(262); result.name = parseSimplePropertyName(); while (parseOptional(21)) { if (token === 25) { @@ -9481,13 +9615,13 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(135, left.pos); + var result = createNode(136, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(259); + var result = createNode(260); nextToken(); result.members = parseDelimitedList(24, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -9495,7 +9629,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(260); + var result = createNode(261); result.name = parseSimplePropertyName(); if (token === 54) { nextToken(); @@ -9504,13 +9638,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(258); + var result = createNode(259); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(256); + var result = createNode(257); nextToken(); result.types = parseDelimitedList(25, parseJSDocType); checkForTrailingComma(result.types); @@ -9524,7 +9658,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(255); + var result = createNode(256); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18); @@ -9542,7 +9676,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(252); + var result = createNode(253); nextToken(); return finishNode(result); } @@ -9555,11 +9689,11 @@ var ts; token === 27 || token === 56 || token === 47) { - var result = createNode(253, pos); + var result = createNode(254, pos); return finishNode(result); } else { - var result = createNode(257, pos); + var result = createNode(258, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -9630,7 +9764,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(267, start); + var result = createNode(268, start); result.tags = tags; return finishNode(result, end); } @@ -9667,7 +9801,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(268, atToken.pos); + var result = createNode(269, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -9718,7 +9852,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(269, atToken.pos); + var result = createNode(270, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -9728,16 +9862,6 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270; })) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); - } - var result = createNode(270, atToken.pos); - result.atToken = atToken; - result.tagName = tagName; - result.typeExpression = tryParseTypeExpression(); - return finishNode(result, pos); - } - function handleTypeTag(atToken, tagName) { if (ts.forEach(tags, function (t) { return t.kind === 271; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } @@ -9747,10 +9871,20 @@ var ts; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } - function handleTemplateTag(atToken, tagName) { + function handleTypeTag(atToken, tagName) { if (ts.forEach(tags, function (t) { return t.kind === 272; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } + var result = createNode(272, atToken.pos); + result.atToken = atToken; + result.tagName = tagName; + result.typeExpression = tryParseTypeExpression(); + return finishNode(result, pos); + } + function handleTemplateTag(atToken, tagName) { + if (ts.forEach(tags, function (t) { return t.kind === 273; })) { + parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); + } var typeParameters = []; typeParameters.pos = pos; while (true) { @@ -9761,7 +9895,7 @@ var ts; parseErrorAtPosition(startPos, 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(137, name_8.pos); + var typeParameter = createNode(138, name_8.pos); typeParameter.name = name_8; finishNode(typeParameter, pos); typeParameters.push(typeParameter); @@ -9772,7 +9906,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(272, atToken.pos); + var result = createNode(273, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -10094,16 +10228,16 @@ var ts; : 4; } function getModuleInstanceState(node) { - if (node.kind === 217 || node.kind === 218) { + if (node.kind === 218 || node.kind === 219) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 224 || node.kind === 223) && !(node.flags & 2)) { + else if ((node.kind === 225 || node.kind === 224) && !(node.flags & 2)) { return 0; } - else if (node.kind === 221) { + else if (node.kind === 222) { var state = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -10119,7 +10253,7 @@ var ts; }); return state; } - else if (node.kind === 220) { + else if (node.kind === 221) { return getModuleInstanceState(node.body); } else { @@ -10147,6 +10281,10 @@ var ts; var labelStack; var labelIndexMap; var implicitLabels; + var hasClassExtends; + var hasAsyncFunctions; + var hasDecorators; + var hasParameterDecorators; var inStrictMode; var symbolCount = 0; var Symbol; @@ -10173,6 +10311,10 @@ var ts; labelStack = undefined; labelIndexMap = undefined; implicitLabels = undefined; + hasClassExtends = false; + hasAsyncFunctions = false; + hasDecorators = false; + hasParameterDecorators = false; } return bindSourceFile; function createSymbol(flags, name) { @@ -10195,17 +10337,17 @@ var ts; if (symbolFlags & 107455) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 221)) { symbol.valueDeclaration = node; } } } function getDeclarationName(node) { if (node.name) { - if (node.kind === 220 && node.name.kind === 9) { - return "\"" + node.name.text + "\""; + if (ts.isAmbientModule(node)) { + return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 136) { + if (node.name.kind === 137) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression.kind)) { return nameExpression.text; @@ -10216,21 +10358,21 @@ var ts; return node.name.text; } switch (node.kind) { - case 144: + case 145: return "__constructor"; - case 152: - case 147: - return "__call"; case 153: case 148: - return "__new"; + return "__call"; + case 154: case 149: + return "__new"; + case 150: return "__index"; - case 230: + case 231: return "__export"; - case 229: + case 230: return node.isExportEquals ? "export=" : "default"; - case 183: + case 184: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2: return "export="; @@ -10242,8 +10384,8 @@ var ts; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 215: case 216: + case 217: return node.flags & 512 ? "default" : undefined; } } @@ -10291,7 +10433,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2; if (symbolFlags & 8388608) { - if (node.kind === 232 || (node.kind === 223 && hasExportModifier)) { + if (node.kind === 233 || (node.kind === 224 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -10299,7 +10441,7 @@ var ts; } } else { - if (hasExportModifier || container.flags & 131072) { + if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 131072)) { var exportKind = (symbolFlags & 107455 ? 1048576 : 0) | (symbolFlags & 793056 ? 2097152 : 0) | (symbolFlags & 1536 ? 4194304 : 0); @@ -10338,10 +10480,11 @@ var ts; var kind = node.kind; var flags = node.flags; flags &= ~1572864; - if (kind === 217) { + flags &= ~62914560; + if (kind === 218) { seenThisKeyword = false; } - var saveState = kind === 250 || kind === 221 || ts.isFunctionLikeKind(kind); + var saveState = kind === 251 || kind === 222 || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -10359,9 +10502,23 @@ var ts; flags |= 1048576; } } - if (kind === 217) { + if (kind === 218) { flags = seenThisKeyword ? flags | 262144 : flags & ~262144; } + if (kind === 251) { + if (hasClassExtends) { + flags |= 4194304; + } + if (hasDecorators) { + flags |= 8388608; + } + if (hasParameterDecorators) { + flags |= 16777216; + } + if (hasAsyncFunctions) { + flags |= 33554432; + } + } node.flags = flags; if (saveState) { hasExplicitReturn = savedHasExplicitReturn; @@ -10380,40 +10537,40 @@ var ts; return; } switch (node.kind) { - case 200: + case 201: bindWhileStatement(node); break; - case 199: + case 200: bindDoStatement(node); break; - case 201: + case 202: bindForStatement(node); break; - case 202: case 203: + case 204: bindForInOrForOfStatement(node); break; - case 198: + case 199: bindIfStatement(node); break; - case 206: - case 210: + case 207: + case 211: bindReturnOrThrow(node); break; + case 206: case 205: - case 204: bindBreakOrContinueStatement(node); break; - case 211: + case 212: bindTryStatement(node); break; - case 208: + case 209: bindSwitchStatement(node); break; - case 222: + case 223: bindCaseBlock(node); break; - case 209: + case 210: bindLabeledStatement(node); break; default: @@ -10475,14 +10632,14 @@ var ts; } function bindReturnOrThrow(n) { bind(n.expression); - if (n.kind === 206) { + if (n.kind === 207) { hasExplicitReturn = true; } currentReachabilityState = 4; } function bindBreakOrContinueStatement(n) { bind(n.label); - var isValidJump = jumpToLabel(n.label, n.kind === 205 ? currentReachabilityState : 4); + var isValidJump = jumpToLabel(n.label, n.kind === 206 ? currentReachabilityState : 4); if (isValidJump) { currentReachabilityState = 4; } @@ -10503,7 +10660,7 @@ var ts; var postSwitchLabel = pushImplicitLabel(); bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 245; }); var postSwitchState = hasDefault && currentReachabilityState !== 2 ? 4 : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); } @@ -10528,37 +10685,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 188: - case 216: + case 189: case 217: - case 219: - case 155: - case 167: + case 218: + case 220: + case 156: + case 168: return 1; - case 147: case 148: case 149: - case 143: - case 142: - case 215: + case 150: case 144: + case 143: + case 216: case 145: case 146: - case 152: + case 147: case 153: - case 175: + case 154: case 176: - case 220: - case 250: - case 218: + case 177: + case 221: + case 251: + case 219: return 5; - case 246: - case 201: + case 247: case 202: case 203: - case 222: + case 204: + case 223: return 2; - case 194: + case 195: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -10574,33 +10731,33 @@ var ts; } function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 220: + case 221: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 250: + case 251: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 188: - case 216: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 219: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 155: - case 167: + case 189: case 217: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 220: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 156: + case 168: + case 218: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 152: case 153: - case 147: + case 154: case 148: case 149: - case 143: - case 142: + case 150: case 144: + case 143: case 145: case 146: - case 215: - case 175: + case 147: + case 216: case 176: - case 218: + case 177: + case 219: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -10615,11 +10772,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 250 ? node : node.body; - if (body.kind === 250 || body.kind === 221) { + var body = node.kind === 251 ? node : node.body; + if (body.kind === 251 || body.kind === 222) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 230 || stat.kind === 229) { + if (stat.kind === 231 || stat.kind === 230) { return true; } } @@ -10636,7 +10793,10 @@ var ts; } function bindModuleDeclaration(node) { setExportContextFlag(node); - if (node.name.kind === 9) { + if (ts.isAmbientModule(node)) { + if (node.flags & 2) { + errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); + } declareSymbolAndAddToSymbolTable(node, 512, 106639); } else { @@ -10678,7 +10838,7 @@ var ts; continue; } var identifier = prop.name; - var currentKind = prop.kind === 247 || prop.kind === 248 || prop.kind === 143 + var currentKind = prop.kind === 248 || prop.kind === 249 || prop.kind === 144 ? 1 : 2; var existingKind = seen[identifier.text]; @@ -10700,10 +10860,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 220: + case 221: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 250: + case 251: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -10825,17 +10985,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 250: - case 221: + case 251: + case 222: updateStrictModeStatementList(node.statements); return; - case 194: + case 195: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 216: - case 188: + case 217: + case 189: inStrictMode = true; return; } @@ -10860,7 +11020,7 @@ var ts; switch (node.kind) { case 69: return checkStrictModeIdentifier(node); - case 183: + case 184: if (ts.isInJavaScriptFile(node)) { var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { @@ -10883,94 +11043,91 @@ var ts; } } return checkStrictModeBinaryExpression(node); - case 246: + case 247: return checkStrictModeCatchClause(node); - case 177: + case 178: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 182: + case 183: return checkStrictModePostfixUnaryExpression(node); - case 181: + case 182: return checkStrictModePrefixUnaryExpression(node); - case 207: + case 208: return checkStrictModeWithStatement(node); - case 161: + case 162: seenThisKeyword = true; return; - case 150: + case 151: return checkTypePredicate(node); - case 137: - return declareSymbolAndAddToSymbolTable(node, 262144, 530912); case 138: + return declareSymbolAndAddToSymbolTable(node, 262144, 530912); + case 139: return bindParameter(node); - case 213: - case 165: + case 214: + case 166: return bindVariableDeclarationOrBindingElement(node); + case 142: case 141: - case 140: return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455); - case 247: case 248: - return bindPropertyOrMethodOrAccessor(node, 4, 107455); case 249: + return bindPropertyOrMethodOrAccessor(node, 4, 107455); + case 250: return bindPropertyOrMethodOrAccessor(node, 8, 107455); - case 147: case 148: case 149: + case 150: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 143: - case 142: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); - case 215: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, 16, 106927); case 144: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 143: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); + case 216: + return bindFunctionDeclaration(node); case 145: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 146: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 147: return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 152: case 153: + case 154: return bindFunctionOrConstructorType(node); - case 155: + case 156: return bindAnonymousDeclaration(node, 2048, "__type"); - case 167: + case 168: return bindObjectLiteralExpression(node); - case 175: case 176: - checkStrictModeFunctionName(node); - var bindingName = node.name ? node.name.text : "__function"; - return bindAnonymousDeclaration(node, 16, bindingName); - case 170: + case 177: + return bindFunctionExpression(node); + case 171: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 188: - case 216: - return bindClassLikeDeclaration(node); + case 189: case 217: - return bindBlockScopedDeclaration(node, 64, 792960); + return bindClassLikeDeclaration(node); case 218: - return bindBlockScopedDeclaration(node, 524288, 793056); + return bindBlockScopedDeclaration(node, 64, 792960); case 219: - return bindEnumDeclaration(node); + return bindBlockScopedDeclaration(node, 524288, 793056); case 220: + return bindEnumDeclaration(node); + case 221: return bindModuleDeclaration(node); - case 223: - case 226: - case 228: - case 232: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); - case 225: - return bindImportClause(node); - case 230: - return bindExportDeclaration(node); + case 224: + case 227: case 229: + case 233: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 226: + return bindImportClause(node); + case 231: + return bindExportDeclaration(node); + case 230: return bindExportAssignment(node); - case 250: + case 251: return bindSourceFileIfExternalModule(); } } @@ -10979,7 +11136,7 @@ var ts; if (parameterName && parameterName.kind === 69) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 161) { + if (parameterName && parameterName.kind === 162) { seenThisKeyword = true; } bind(type); @@ -10994,7 +11151,7 @@ var ts; bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 229 ? node.expression : node.right; + var boundExpression = node.kind === 230 ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } @@ -11033,7 +11190,7 @@ var ts; bindExportAssignment(node); } function bindThisPropertyAssignment(node) { - if (container.kind === 175 || container.kind === 215) { + if (container.kind === 176 || container.kind === 216) { container.symbol.members = container.symbol.members || {}; declareSymbol(container.symbol.members, container.symbol, node, 4, 107455); } @@ -11055,7 +11212,15 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 216) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { + hasClassExtends = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } + if (node.kind === 217) { bindBlockScopedDeclaration(node, 32, 899519); } else { @@ -11098,6 +11263,12 @@ var ts; } } function bindParameter(node) { + if (!ts.isDeclarationFile(file) && + !ts.isInAmbientContext(node) && + ts.nodeIsDecorated(node)) { + hasDecorators = true; + hasParameterDecorators = true; + } if (inStrictMode) { checkStrictModeEvalOrArguments(node, node.name); } @@ -11112,7 +11283,34 @@ var ts; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } } + function bindFunctionDeclaration(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, 16, 106927); + } + function bindFunctionExpression(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.text : "__function"; + return bindAnonymousDeclaration(node, 16, bindingName); + } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } return ts.hasDynamicName(node) ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); @@ -11172,15 +11370,15 @@ var ts; function checkUnreachable(node) { switch (currentReachabilityState) { case 4: - var reportError = (ts.isStatement(node) && node.kind !== 196) || - node.kind === 216 || - (node.kind === 220 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 219 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatement(node) && node.kind !== 197) || + node.kind === 217 || + (node.kind === 221 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 220 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8; var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 195 || + (node.kind !== 196 || ts.getCombinedNodeFlags(node.declarationList) & 24576 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -11254,6 +11452,7 @@ var ts; getTypeCount: function () { return typeCount; }, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getNarrowedTypeOfSymbol, @@ -11268,6 +11467,7 @@ var ts; getSymbolsInScope: getSymbolsInScope, getSymbolAtLocation: getSymbolAtLocation, getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, + getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, getTypeAtLocation: getTypeOfNode, typeToString: typeToString, getSymbolDisplayBuilder: getSymbolDisplayBuilder, @@ -11341,11 +11541,6 @@ var ts; var unionTypes = {}; var intersectionTypes = {}; var stringLiteralTypes = {}; - var emitExtends = false; - var emitDecorate = false; - var emitParam = false; - var emitAwaiter = false; - var emitGenerator = false; var resolutionTargets = []; var resolutionResults = []; var resolutionPropertyNames = []; @@ -11478,7 +11673,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 220 && source.valueDeclaration.kind !== 220))) { + (target.valueDeclaration.kind === 221 && source.valueDeclaration.kind !== 221))) { target.valueDeclaration = source.valueDeclaration; } ts.forEach(source.declarations, function (node) { @@ -11532,6 +11727,24 @@ var ts; } } } + function mergeModuleAugmentation(moduleName) { + var moduleAugmentation = moduleName.parent; + if (moduleAugmentation.symbol.valueDeclaration !== moduleAugmentation) { + ts.Debug.assert(moduleAugmentation.symbol.declarations.length > 1); + return; + } + if (ts.isGlobalScopeAugmentation(moduleAugmentation)) { + mergeSymbolTable(globals, moduleAugmentation.symbol.exports); + } + else { + var mainModule = resolveExternalModuleNameWorker(moduleName, moduleName, ts.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found); + if (!mainModule) { + return; + } + mainModule = mainModule.flags & 33554432 ? mainModule : cloneSymbol(mainModule); + mergeSymbol(mainModule, moduleAugmentation.symbol); + } + } function addToSymbolTable(target, source, message) { for (var id in source) { if (ts.hasProperty(source, id)) { @@ -11557,17 +11770,8 @@ var ts; var nodeId = getNodeId(node); return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } - function getSourceFile(node) { - return ts.getAncestor(node, 250); - } function isGlobalSourceFile(node) { - return node.kind === 250 && !ts.isExternalOrCommonJsModule(node); - } - function isPrimitiveApparentType(type) { - return type === globalStringType || - type === globalNumberType || - type === globalBooleanType || - type === globalESSymbolType; + return node.kind === 251 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -11605,18 +11809,18 @@ var ts; return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); } if (declaration.pos <= usage.pos) { - return declaration.kind !== 213 || + return declaration.kind !== 214 || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 195 || - declaration.parent.parent.kind === 201) { + if (declaration.parent.parent.kind === 196 || + declaration.parent.parent.kind === 202) { return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 203 || - declaration.parent.parent.kind === 202) { + else if (declaration.parent.parent.kind === 204 || + declaration.parent.parent.kind === 203) { var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); } @@ -11632,7 +11836,7 @@ var ts; return true; } var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 141 && + current.parent.kind === 142 && (current.parent.flags & 64) === 0 && current.parent.initializer === current; if (initializerOfNonStaticProperty) { @@ -11657,15 +11861,15 @@ var ts; if (meaning & result.flags & 793056) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 138 || - lastLocation.kind === 137 + lastLocation.kind === 139 || + lastLocation.kind === 138 : false; } if (meaning & 107455 && result.flags & 1) { useResult = - lastLocation.kind === 138 || + lastLocation.kind === 139 || (lastLocation === location.type && - result.valueDeclaration.kind === 138); + result.valueDeclaration.kind === 139); } } if (useResult) { @@ -11677,13 +11881,12 @@ var ts; } } switch (location.kind) { - case 250: + case 251: if (!ts.isExternalOrCommonJsModule(location)) break; - case 220: + case 221: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 250 || - (location.kind === 220 && location.name.kind === 9)) { + if (location.kind === 251 || ts.isAmbientModule(location)) { if (result = moduleExports["default"]) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { @@ -11693,7 +11896,7 @@ var ts; } if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 && - ts.getDeclarationOfKind(moduleExports[name], 232)) { + ts.getDeclarationOfKind(moduleExports[name], 233)) { break; } } @@ -11701,13 +11904,13 @@ var ts; break loop; } break; - case 219: + case 220: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 142: case 141: - case 140: if (ts.isClassLike(location.parent) && !(location.flags & 64)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -11717,9 +11920,9 @@ var ts; } } break; - case 216: - case 188: case 217: + case 189: + case 218: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { if (lastLocation && lastLocation.flags & 64) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -11727,7 +11930,7 @@ var ts; } break loop; } - if (location.kind === 188 && meaning & 32) { + if (location.kind === 189 && meaning & 32) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -11735,28 +11938,28 @@ var ts; } } break; - case 136: + case 137: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 217) { + if (ts.isClassLike(grandparent) || grandparent.kind === 218) { if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 215: - case 176: + case 147: + case 216: + case 177: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 175: + case 176: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -11769,8 +11972,8 @@ var ts; } } break; - case 139: - if (location.parent && location.parent.kind === 138) { + case 140: + if (location.parent && location.parent.kind === 139) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -11786,7 +11989,9 @@ var ts; } if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + if (!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg)) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + } } return undefined; } @@ -11805,11 +12010,40 @@ var ts; } return result; } + function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { + if (!errorLocation || (errorLocation.kind === 69 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + return false; + } + var container = ts.getThisContainer(errorLocation, true); + var location = container; + while (location) { + if (ts.isClassLike(location.parent)) { + var classSymbol = getSymbolOfNode(location.parent); + if (!classSymbol) { + break; + } + var constructorType = getTypeOfSymbol(classSymbol); + if (getPropertyOfType(constructorType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg), symbolToString(classSymbol)); + return true; + } + if (location === container && !(location.flags & 64)) { + var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; + if (getPropertyOfType(instanceType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + return true; + } + } + } + location = location.parent; + } + return false; + } function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert((result.flags & 2) !== 0); var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 214), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -11826,10 +12060,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 223) { + if (node.kind === 224) { return node; } - while (node && node.kind !== 224) { + while (node && node.kind !== 225) { node = node.parent; } return node; @@ -11839,7 +12073,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 234) { + if (node.moduleReference.kind === 235) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -11923,17 +12157,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 223: + case 224: return getTargetOfImportEqualsDeclaration(node); - case 225: - return getTargetOfImportClause(node); case 226: + return getTargetOfImportClause(node); + case 227: return getTargetOfNamespaceImport(node); - case 228: - return getTargetOfImportSpecifier(node); - case 232: - return getTargetOfExportSpecifier(node); case 229: + return getTargetOfImportSpecifier(node); + case 233: + return getTargetOfExportSpecifier(node); + case 230: return getTargetOfExportAssignment(node); } } @@ -11975,10 +12209,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 229) { + if (node.kind === 230) { checkExpressionCached(node.expression); } - else if (node.kind === 232) { + else if (node.kind === 233) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -11988,17 +12222,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 223); + importDeclaration = ts.getAncestor(entityName, 224); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 69 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 69 || entityName.parent.kind === 135) { + if (entityName.kind === 69 || entityName.parent.kind === 136) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 223); + ts.Debug.assert(entityName.parent.kind === 224); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -12017,9 +12251,9 @@ var ts; return undefined; } } - else if (name.kind === 135 || name.kind === 168) { - var left = name.kind === 135 ? name.left : name.expression; - var right = name.kind === 135 ? name.right : name.name; + else if (name.kind === 136 || name.kind === 169) { + var left = name.kind === 136 ? name.left : name.expression; + var right = name.kind === 136 ? name.right : name.name; var namespace = resolveEntityName(left, 1536, ignoreErrors); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -12039,6 +12273,9 @@ var ts; return symbol.flags & meaning ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + } + function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError) { if (moduleReferenceExpression.kind !== 9) { return; } @@ -12051,19 +12288,24 @@ var ts; if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512); if (symbol) { - return symbol; + return getMergedSymbol(symbol); } } - var resolvedModule = ts.getResolvedModule(getSourceFile(location), moduleReferenceLiteral.text); + var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReferenceLiteral.text); var sourceFile = resolvedModule && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - return sourceFile.symbol; + return getMergedSymbol(sourceFile.symbol); } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); - return; + if (moduleNotFoundError) { + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + } + return undefined; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); + if (moduleNotFoundError) { + error(moduleReferenceLiteral, moduleNotFoundError, moduleName); + } + return undefined; } function resolveExternalModuleSymbol(moduleSymbol) { return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; @@ -12174,7 +12416,7 @@ var ts; var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 144 && ts.nodeIsPresent(member.body)) { + if (member.kind === 145 && ts.nodeIsPresent(member.body)) { return member; } } @@ -12240,17 +12482,17 @@ var ts; } } switch (location_1.kind) { - case 250: + case 251: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 220: + case 221: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 216: case 217: + case 218: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -12283,7 +12525,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233)) { if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -12312,7 +12554,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -12367,8 +12609,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 220 && declaration.name.kind === 9) || - (declaration.kind === 250 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 251 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -12400,11 +12641,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 154) { + if (entityName.parent.kind === 155) { meaning = 107455 | 1048576; } - else if (entityName.kind === 135 || entityName.kind === 168 || - entityName.parent.kind === 223) { + else if (entityName.kind === 136 || entityName.kind === 169 || + entityName.parent.kind === 224) { meaning = 1536; } else { @@ -12455,15 +12696,20 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 160) { + while (node.kind === 161) { node = node.parent; } - if (node.kind === 218) { + if (node.kind === 219) { return getSymbolOfNode(node); } } return undefined; } + function isTopLevelInExternalModuleAugmentation(node) { + return node && node.parent && + node.parent.kind === 222 && + ts.isExternalModuleAugmentation(node.parent.parent); + } function getSymbolDisplayBuilder() { function getNameOfSymbol(symbol) { if (symbol.declarations && symbol.declarations.length) { @@ -12472,10 +12718,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 188: + case 189: return "(Anonymous class)"; - case 175: case 176: + case 177: return "(Anonymous function)"; } } @@ -12689,7 +12935,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 250 || declaration.parent.kind === 221; + return declaration.parent.kind === 251 || declaration.parent.kind === 222; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -12943,60 +13189,63 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 165: + case 166: return isDeclarationVisible(node.parent.parent); - case 213: + case 214: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 220: - case 216: + case 221: case 217: case 218: - case 215: case 219: - case 223: + case 216: + case 220: + case 224: + if (ts.isExternalModuleAugmentation(node)) { + return true; + } var parent_4 = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 2) && - !(node.kind !== 223 && parent_4.kind !== 250 && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 224 && parent_4.kind !== 251 && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } return isDeclarationVisible(parent_4); - case 141: - case 140: - case 145: - case 146: - case 143: case 142: + case 141: + case 146: + case 147: + case 144: + case 143: if (node.flags & (16 | 32)) { return false; } - case 144: - case 148: - case 147: + case 145: case 149: - case 138: - case 221: - case 152: + case 148: + case 150: + case 139: + case 222: case 153: - case 155: - case 151: + case 154: case 156: + case 152: case 157: case 158: case 159: case 160: + case 161: return isDeclarationVisible(node.parent); - case 225: case 226: - case 228: - return false; - case 137: - case 250: - return true; + case 227: case 229: return false; + case 138: + case 251: + return true; + case 230: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -13004,10 +13253,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 229) { + if (node.parent && node.parent.kind === 230) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536 | 8388608, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 232) { + else if (node.parent.kind === 233) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -13029,7 +13278,9 @@ var ts; var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); - buildVisibleNodeList(importSymbol.declarations); + if (importSymbol) { + buildVisibleNodeList(importSymbol.declarations); + } } }); } @@ -13082,10 +13333,10 @@ var ts; } function getDeclarationContainer(node) { node = ts.getRootDeclaration(node); - return node.kind === 213 ? node.parent.parent.parent : node.parent; + return node.kind === 214 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { - var classType = getDeclaredTypeOfSymbol(prototype.parent); + var classType = getDeclaredTypeOfSymbol(getMergedSymbol(prototype.parent)); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfPropertyOfType(type, name) { @@ -13106,7 +13357,7 @@ var ts; case 9: case 8: return name.text; - case 136: + case 137: if (ts.isStringOrNumericLiteral(name.expression.kind)) { return name.expression.text; } @@ -13114,7 +13365,7 @@ var ts; return undefined; } function isComputedNonLiteralName(name) { - return name.kind === 136 && !ts.isStringOrNumericLiteral(name.expression.kind); + return name.kind === 137 && !ts.isStringOrNumericLiteral(name.expression.kind); } function getTypeForBindingElement(declaration) { var pattern = declaration.parent; @@ -13129,7 +13380,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 163) { + if (pattern.kind === 164) { var name_10 = declaration.propertyName || declaration.name; if (isComputedNonLiteralName(name_10)) { return anyType; @@ -13167,10 +13418,10 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 202) { - return anyType; - } if (declaration.parent.parent.kind === 203) { + return stringType; + } + if (declaration.parent.parent.kind === 204) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { @@ -13179,10 +13430,10 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138) { + if (declaration.kind === 139) { var func = declaration.parent; - if (func.kind === 146 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 145); + if (func.kind === 147 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 146); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -13195,7 +13446,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 248) { + if (declaration.kind === 249) { return checkIdentifier(declaration.name); } if (ts.isBindingPattern(declaration.name)) { @@ -13242,7 +13493,7 @@ var ts; if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) { return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; } - var elementTypes = ts.map(elements, function (e) { return e.kind === 189 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 190 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -13251,7 +13502,7 @@ var ts; return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 163 + return pattern.kind === 164 ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -13261,10 +13512,10 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - if (declaration.kind === 247) { + if (declaration.kind === 248) { return type; } - if (type.flags & 134217728 && (declaration.kind === 141 || declaration.kind === 140)) { + if (type.flags & 134217728 && (declaration.kind === 142 || declaration.kind === 141)) { return type; } return getWidenedType(type); @@ -13272,7 +13523,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = ts.getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 138 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 139 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -13285,17 +13536,17 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 246) { + if (declaration.parent.kind === 247) { return links.type = anyType; } - if (declaration.kind === 229) { + if (declaration.kind === 230) { return links.type = checkExpression(declaration.expression); } - if (declaration.kind === 183) { + if (declaration.kind === 184) { return links.type = checkExpression(declaration.right); } - if (declaration.kind === 168) { - if (declaration.parent.kind === 183) { + if (declaration.kind === 169) { + if (declaration.parent.kind === 184) { return links.type = checkExpressionCached(declaration.parent.right); } } @@ -13321,7 +13572,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 145) { + if (accessor.kind === 146) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -13337,8 +13588,8 @@ var ts; if (!pushTypeResolution(symbol, 0)) { return unknownType; } - var getter = ts.getDeclarationOfKind(symbol, 145); - var setter = ts.getDeclarationOfKind(symbol, 146); + var getter = ts.getDeclarationOfKind(symbol, 146); + var setter = ts.getDeclarationOfKind(symbol, 147); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -13364,7 +13615,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 145); + var getter_1 = ts.getDeclarationOfKind(symbol, 146); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -13453,9 +13704,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 216 || node.kind === 188 || - node.kind === 215 || node.kind === 175 || - node.kind === 143 || node.kind === 176) { + if (node.kind === 217 || node.kind === 189 || + node.kind === 216 || node.kind === 176 || + node.kind === 144 || node.kind === 177) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -13464,15 +13715,15 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 218); return appendOuterTypeParameters(undefined, declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 217 || node.kind === 216 || - node.kind === 188 || node.kind === 218) { + if (node.kind === 218 || node.kind === 217 || + node.kind === 189 || node.kind === 219) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -13595,7 +13846,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 218 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -13624,7 +13875,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217) { + if (declaration.kind === 218) { if (declaration.flags & 262144) { return false; } @@ -13673,7 +13924,7 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 218); + var declaration = ts.getDeclarationOfKind(symbol, 219); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -13704,7 +13955,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 137).constraint) { + if (!ts.getDeclarationOfKind(symbol, 138).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -13756,11 +14007,11 @@ var ts; case 120: case 131: case 103: - case 162: + case 163: return true; - case 156: + case 157: return isIndependentType(node.elementType); - case 151: + case 152: return isIndependentTypeReference(node); } return false; @@ -13769,7 +14020,7 @@ var ts; return node.type && isIndependentType(node.type) || !node.type && !node.initializer; } function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 144 && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 145 && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -13785,12 +14036,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 141: - case 140: - return isIndependentVariableLikeDeclaration(declaration); - case 143: case 142: + case 141: + return isIndependentVariableLikeDeclaration(declaration); case 144: + case 143: + case 145: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -14303,7 +14554,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 144 ? + var classType = declaration.kind === 145 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : @@ -14319,7 +14570,7 @@ var ts; paramSymbol = resolvedSymbol; } parameters.push(paramSymbol); - if (param.type && param.type.kind === 162) { + if (param.type && param.type.kind === 163) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -14342,8 +14593,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 145 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 146); + if (declaration.kind === 146 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 147); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -14361,19 +14612,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 152: case 153: - case 215: - case 143: - case 142: + case 154: + case 216: case 144: - case 147: + case 143: + case 145: case 148: case 149: - case 145: + case 150: case 146: - case 175: + case 147: case 176: + case 177: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -14453,7 +14704,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 144 || signature.declaration.kind === 148; + var isConstructor = signature.declaration.kind === 145 || signature.declaration.kind === 149; var type = createObjectType(65536 | 262144); type.members = emptySymbols; type.properties = emptyArray; @@ -14490,7 +14741,7 @@ var ts; : undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 137).constraint; + return ts.getDeclarationOfKind(type.symbol, 138).constraint; } function hasConstraintReferenceTo(type, target) { var checked; @@ -14523,7 +14774,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 138).parent); } function getTypeListId(types) { if (types) { @@ -14609,7 +14860,7 @@ var ts; function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var typeNameOrExpression = node.kind === 151 ? node.typeName : + var typeNameOrExpression = node.kind === 152 ? node.typeName : ts.isSupportedExpressionWithTypeArguments(node) ? node.expression : undefined; var symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, 793056) || unknownSymbol; @@ -14635,9 +14886,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 216: case 217: - case 219: + case 218: + case 220: return declaration; } } @@ -14853,9 +15104,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 217)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 218)) { if (!(container.flags & 64) && - (container.kind !== 144 || ts.isNodeDescendentOf(node, container.body))) { + (container.kind !== 145 || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -14899,34 +15150,34 @@ var ts; return esSymbolType; case 103: return voidType; - case 161: - return getTypeFromThisTypeNode(node); case 162: + return getTypeFromThisTypeNode(node); + case 163: return getTypeFromStringLiteralTypeNode(node); - case 151: - return getTypeFromTypeReference(node); - case 150: - return getTypeFromPredicateTypeNode(node); - case 190: - return getTypeFromTypeReference(node); - case 154: - return getTypeFromTypeQueryNode(node); - case 156: - return getTypeFromArrayTypeNode(node); - case 157: - return getTypeFromTupleTypeNode(node); - case 158: - return getTypeFromUnionTypeNode(node); - case 159: - return getTypeFromIntersectionTypeNode(node); - case 160: - return getTypeFromTypeNode(node.type); case 152: - case 153: + return getTypeFromTypeReference(node); + case 151: + return getTypeFromPredicateTypeNode(node); + case 191: + return getTypeFromTypeReference(node); case 155: + return getTypeFromTypeQueryNode(node); + case 157: + return getTypeFromArrayTypeNode(node); + case 158: + return getTypeFromTupleTypeNode(node); + case 159: + return getTypeFromUnionTypeNode(node); + case 160: + return getTypeFromIntersectionTypeNode(node); + case 161: + return getTypeFromTypeNode(node.type); + case 153: + case 154: + case 156: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); case 69: - case 135: + case 136: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -15106,27 +15357,27 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 175: case 176: + case 177: return isContextSensitiveFunctionLikeDeclaration(node); - case 167: + case 168: return ts.forEach(node.properties, isContextSensitive); - case 166: + case 167: return ts.forEach(node.elements, isContextSensitive); - case 184: + case 185: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 183: + case 184: return node.operatorToken.kind === 52 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 247: + case 248: return isContextSensitive(node.initializer); + case 144: case 143: - case 142: return isContextSensitiveFunctionLikeDeclaration(node); - case 174: + case 175: return isContextSensitive(node.expression); } return false; @@ -15154,6 +15405,9 @@ var ts; function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 : 0; } + function compareTypesAssignable(source, target) { + return checkTypeRelatedTo(source, target, assignableRelation, undefined) ? -1 : 0; + } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, undefined); } @@ -15167,39 +15421,52 @@ var ts; return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + return compareSignaturesRelated(source, target, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; + } + function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { if (source === target) { - return true; + return -1; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1; var sourceMax = getNumNonRestParameters(source); var targetMax = getNumNonRestParameters(target); var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + var sourceParams = source.parameters; + var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + var s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); + var related = compareTypes(t, s, false) || compareTypes(s, t, reportErrors); if (!related) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); + } + return 0; } + result &= related; } if (!ignoreReturnTypes) { var targetReturnType = getReturnTypeOfSignature(target); if (targetReturnType === voidType) { - return true; + return result; } var sourceReturnType = getReturnTypeOfSignature(source); if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { if (!(sourceReturnType.flags & 134217728)) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); + } + return 0; } } - return isTypeAssignableTo(sourceReturnType, targetReturnType); + result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); } - return true; + return result; } function isImplementationCompatibleWithOverload(implementation, overload) { var erasedSource = getErasedSignature(implementation); @@ -15242,18 +15509,12 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; - var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); + var result = isRelatedTo(source, target, !!errorNode, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { - if (errorInfo.next === undefined) { - errorInfo = undefined; - elaborateErrors = true; - isRelatedTo(source, target, errorNode !== undefined, headMessage); - } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); } @@ -15261,6 +15522,7 @@ var ts; } return result !== 0; function reportError(message, arg0, arg1, arg2) { + ts.Debug.assert(!!errorNode); errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } function reportRelationError(message, source, target) { @@ -15381,10 +15643,10 @@ var ts; return result; } } - var apparentType = getApparentType(source); - if (apparentType.flags & (80896 | 32768) && target.flags & 80896) { - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { + var apparentSource = getApparentType(source); + if (apparentSource.flags & (80896 | 32768) && target.flags & 80896) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 16777726); + if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } @@ -15439,6 +15701,7 @@ var ts; var prop = _a[_i]; if (!isKnownProperty(target, prop.name)) { if (reportErrors) { + ts.Debug.assert(!!errorNode); errorNode = prop.valueDeclaration; reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); } @@ -15531,7 +15794,7 @@ var ts; var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - if (elaborateErrors && related === 2) { + if (reportErrors && related === 2) { relation[id] = 3; } else { @@ -15725,7 +15988,7 @@ var ts; shouldElaborateErrors = false; } } - if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + if (shouldElaborateErrors) { reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, undefined, undefined, kind)); } return 0; @@ -15734,65 +15997,7 @@ var ts; return result; } function signatureRelatedTo(source, target, reportErrors) { - if (source === target) { - return -1; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return 0; - } - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var checkCount; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - var result = -1; - for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); - if (!related) { - related = isRelatedTo(t, s, false); - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); - } - return 0; - } - errorInfo = saveErrorInfo; - } - result &= related; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) { - return result; - } - var sourceReturnType = getReturnTypeOfSignature(source); - if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { - if (!(sourceReturnType.flags & 134217728)) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0; - } - } - return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); + return compareSignaturesRelated(source, target, false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -16155,22 +16360,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 142: case 141: - case 140: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 138: + case 139: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 215: + case 216: + case 144: case 143: - case 142: - case 145: case 146: - case 175: + case 147: case 176: + case 177: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -16459,10 +16664,10 @@ var ts; function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 154: + case 155: return true; case 69: - case 135: + case 136: node = node.parent; continue; default: @@ -16503,55 +16708,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 183: + case 184: return isAssignedInBinaryExpression(node); - case 213: - case 165: - return isAssignedInVariableDeclaration(node); - case 163: - case 164: + case 214: case 166: + return isAssignedInVariableDeclaration(node); + case 164: + case 165: case 167: case 168: case 169: case 170: case 171: - case 173: - case 191: + case 172: case 174: - case 181: - case 177: - case 180: - case 178: - case 179: + case 192: + case 175: case 182: - case 186: - case 184: + case 178: + case 181: + case 179: + case 180: + case 183: case 187: - case 194: + case 185: + case 188: case 195: - case 197: + case 196: case 198: case 199: case 200: case 201: case 202: case 203: - case 206: + case 204: case 207: case 208: - case 243: - case 244: case 209: + case 244: + case 245: case 210: case 211: - case 246: - case 235: + case 212: + case 247: case 236: - case 240: - case 241: case 237: + case 241: case 242: + case 238: + case 243: return ts.forEachChild(node, isAssignedIn); } return false; @@ -16561,7 +16766,7 @@ var ts; var type = getTypeOfSymbol(symbol); if (node && symbol.flags & 3) { if (isTypeAny(type) || type.flags & (80896 | 16384 | 512)) { - var declaration = ts.getDeclarationOfKind(symbol, 213); + var declaration = ts.getDeclarationOfKind(symbol, 214); var top_1 = declaration && getDeclarationContainer(declaration); var originalType = type; var nodeStack = []; @@ -16569,13 +16774,13 @@ var ts; var child = node; node = node.parent; switch (node.kind) { - case 198: + case 199: + case 185: case 184: - case 183: nodeStack.push({ node: node, child: child }); break; - case 250: - case 220: + case 251: + case 221: break loop; } if (node === top_1) { @@ -16586,17 +16791,17 @@ var ts; while (nodes = nodeStack.pop()) { var node_1 = nodes.node, child = nodes.child; switch (node_1.kind) { - case 198: + case 199: if (child !== node_1.expression) { type = narrowType(type, node_1.expression, child === node_1.thenStatement); } break; - case 184: + case 185: if (child !== node_1.condition) { type = narrowType(type, node_1.condition, child === node_1.whenTrue); } break; - case 183: + case 184: if (child === node_1.right) { if (node_1.operatorToken.kind === 51) { type = narrowType(type, node_1.left, true); @@ -16620,7 +16825,7 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 178 || expr.right.kind !== 9) { + if (expr.left.kind !== 179 || expr.right.kind !== 9) { return type; } var left = expr.left; @@ -16635,9 +16840,6 @@ var ts; if (typeInfo && typeInfo.type === undefinedType) { return type; } - if (!!(type.flags & 1) && typeInfo && assumeTrue) { - return typeInfo.type; - } var flags; if (typeInfo) { flags = typeInfo.flags; @@ -16647,6 +16849,9 @@ var ts; flags = 132 | 258 | 16777216 | 8; } if (!(type.flags & 16384)) { + if (assumeTrue && typeInfo && isTypeSubtypeOf(typeInfo.type, type)) { + return typeInfo.type; + } return filterUnion(type) ? type : emptyUnionType; } return getUnionType(ts.filter(type.types, filterUnion), true); @@ -16761,7 +16966,7 @@ var ts; return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); } function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { - if (expression.kind === 169 || expression.kind === 168) { + if (expression.kind === 170 || expression.kind === 169) { var accessExpression = expression; var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); if (possibleIdentifier.kind === 69 && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { @@ -16774,18 +16979,18 @@ var ts; expr = skipParenthesizedNodes(expr); switch (expr.kind) { case 69: - case 168: - case 135: + case 169: + case 136: return getSymbolOfEntityNameOrPropertyAccessExpression(expr); } } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 170: + case 171: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 174: + case 175: return narrowType(type, expr.expression, assumeTrue); - case 183: + case 184: var operator = expr.operatorToken.kind; if (operator === 32 || operator === 33) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -16800,20 +17005,20 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 181: + case 182: if (expr.operator === 49) { return narrowType(type, expr.operand, !assumeTrue); } break; + case 170: case 169: - case 168: return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } function skipParenthesizedNodes(expression) { - while (expression.kind === 174) { + while (expression.kind === 175) { expression = expression.expression; } return expression; @@ -16822,7 +17027,7 @@ var ts; var symbol = getResolvedSymbol(node); if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 176) { + if (container.kind === 177) { if (languageVersion < 2) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -16853,7 +17058,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 246) { + symbol.valueDeclaration.parent.kind === 247) { return; } var container; @@ -16862,11 +17067,11 @@ var ts; } else { container = symbol.valueDeclaration; - while (container.kind !== 214) { + while (container.kind !== 215) { container = container.parent; } container = container.parent; - if (container.kind === 195) { + if (container.kind === 196) { container = container.parent; } } @@ -16885,7 +17090,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 141 || container.kind === 144) { + if (container.kind === 142 || container.kind === 145) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -16896,29 +17101,29 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 176) { + if (container.kind === 177) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 220: + case 221: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 219: + case 220: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 144: + case 145: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 142: case 141: - case 140: if (container.flags & 64) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 136: + case 137: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -16929,7 +17134,7 @@ var ts; var symbol = getSymbolOfNode(container.parent); return container.flags & 64 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; } - if (ts.isInJavaScriptFile(node) && container.kind === 175) { + if (ts.isInJavaScriptFile(node) && container.kind === 176) { if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { var className = container.parent .left @@ -16945,18 +17150,18 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 138) { + if (n.kind === 139) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 170 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 171 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 176) { + while (container && container.kind === 177) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -16965,16 +17170,16 @@ var ts; var nodeCheckFlag = 0; if (!canUseSuperExpression) { var current = node; - while (current && current !== container && current.kind !== 136) { + while (current && current !== container && current.kind !== 137) { current = current.parent; } - if (current && current.kind === 136) { + if (current && current.kind === 137) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 168)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -16992,7 +17197,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 167) { + if (container.parent.kind === 168) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -17010,7 +17215,7 @@ var ts; } return unknownType; } - if (container.kind === 144 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 145 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; } @@ -17022,24 +17227,24 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 144; + return container.kind === 145; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 167) { + if (ts.isClassLike(container.parent) || container.parent.kind === 168) { if (container.flags & 64) { - return container.kind === 143 || - container.kind === 142 || - container.kind === 145 || - container.kind === 146; + return container.kind === 144 || + container.kind === 143 || + container.kind === 146 || + container.kind === 147; } else { - return container.kind === 143 || - container.kind === 142 || - container.kind === 145 || + return container.kind === 144 || + container.kind === 143 || container.kind === 146 || + container.kind === 147 || + container.kind === 142 || container.kind === 141 || - container.kind === 140 || - container.kind === 144; + container.kind === 145; } } } @@ -17074,7 +17279,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138) { + if (declaration.kind === 139) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -17107,7 +17312,7 @@ var ts; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 138 && node.parent.initializer === node) { + if (node.parent.kind === 139 && node.parent.initializer === node) { return true; } node = node.parent; @@ -17116,8 +17321,8 @@ var ts; } function getContextualReturnType(functionDecl) { if (functionDecl.type || - functionDecl.kind === 144 || - functionDecl.kind === 145 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 146))) { + functionDecl.kind === 145 || + functionDecl.kind === 146 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 147))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); @@ -17136,7 +17341,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 172) { + if (template.parent.kind === 173) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -17247,13 +17452,13 @@ var ts; var kind = attribute.kind; var jsxElement = attribute.parent; var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 240) { + if (attribute.kind === 241) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - else if (attribute.kind === 241) { + else if (attribute.kind === 242) { return attrsType; } ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); @@ -17271,40 +17476,40 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 213: - case 138: + case 214: + case 139: + case 142: case 141: - case 140: - case 165: - return getContextualTypeForInitializerExpression(node); - case 176: - case 206: - return getContextualTypeForReturnExpression(node); - case 186: - return getContextualTypeForYieldOperand(parent); - case 170: - case 171: - return getContextualTypeForArgument(parent, node); - case 173: - case 191: - return getTypeFromTypeNode(parent.type); - case 183: - return getContextualTypeForBinaryOperand(node); - case 247: - return getContextualTypeForObjectLiteralElement(parent); case 166: - return getContextualTypeForElementExpression(node); - case 184: - return getContextualTypeForConditionalOperand(node); - case 192: - ts.Debug.assert(parent.parent.kind === 185); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + return getContextualTypeForInitializerExpression(node); + case 177: + case 207: + return getContextualTypeForReturnExpression(node); + case 187: + return getContextualTypeForYieldOperand(parent); + case 171: + case 172: + return getContextualTypeForArgument(parent, node); case 174: + case 192: + return getTypeFromTypeNode(parent.type); + case 184: + return getContextualTypeForBinaryOperand(node); + case 248: + return getContextualTypeForObjectLiteralElement(parent); + case 167: + return getContextualTypeForElementExpression(node); + case 185: + return getContextualTypeForConditionalOperand(node); + case 193: + ts.Debug.assert(parent.parent.kind === 186); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 175: return getContextualType(parent); - case 242: + case 243: return getContextualType(parent); - case 240: case 241: + case 242: return getContextualTypeForJsxAttribute(parent); } return undefined; @@ -17319,7 +17524,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 175 || node.kind === 176; + return node.kind === 176 || node.kind === 177; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -17327,7 +17532,7 @@ var ts; : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getApparentTypeOfContextualType(node); @@ -17367,13 +17572,13 @@ var ts; } function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 183 && parent.operatorToken.kind === 56 && parent.left === node) { + if (parent.kind === 184 && parent.operatorToken.kind === 56 && parent.left === node) { return true; } - if (parent.kind === 247) { + if (parent.kind === 248) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 166) { + if (parent.kind === 167) { return isAssignmentTarget(parent); } return false; @@ -17383,8 +17588,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function hasDefaultValue(node) { - return (node.kind === 165 && !!node.initializer) || - (node.kind === 183 && node.operatorToken.kind === 56); + return (node.kind === 166 && !!node.initializer) || + (node.kind === 184 && node.operatorToken.kind === 56); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -17393,7 +17598,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 187) { + if (inDestructuringPattern && e.kind === 188) { var restArrayType = checkExpression(e.expression, contextualMapper); var restElementType = getIndexTypeOfType(restArrayType, 1) || (languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined); @@ -17405,7 +17610,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 187; + hasSpreadElement = hasSpreadElement || e.kind === 188; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -17416,7 +17621,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 164 || pattern.kind === 166)) { + if (pattern && (pattern.kind === 165 || pattern.kind === 167)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -17424,7 +17629,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 189) { + if (patternElement.kind !== 190) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -17439,7 +17644,7 @@ var ts; return createArrayType(elementTypes.length ? getUnionType(elementTypes) : undefinedType); } function isNumericName(name) { - return name.kind === 136 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 137 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 132); @@ -17470,31 +17675,31 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 163 || contextualType.pattern.kind === 167); + (contextualType.pattern.kind === 164 || contextualType.pattern.kind === 168); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 247 || - memberDecl.kind === 248 || + if (memberDecl.kind === 248 || + memberDecl.kind === 249 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 247) { + if (memberDecl.kind === 248) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 143) { + else if (memberDecl.kind === 144) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 248); + ts.Debug.assert(memberDecl.kind === 249); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 247 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 248 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 248 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 249 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912; } @@ -17521,7 +17726,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 145 || memberDecl.kind === 146); + ts.Debug.assert(memberDecl.kind === 146 || memberDecl.kind === 147); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -17579,13 +17784,13 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 242: + case 243: checkJsxExpression(child); break; - case 235: + case 236: checkJsxElement(child); break; - case 236: + case 237: checkJsxSelfClosingElement(child); break; } @@ -17596,7 +17801,7 @@ var ts; return name.indexOf("-") < 0; } function isJsxIntrinsicIdentifier(tagName) { - if (tagName.kind === 135) { + if (tagName.kind === 136) { return false; } else { @@ -17690,6 +17895,7 @@ var ts; if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } + return unknownSymbol; } } function lookupClassTag(node) { @@ -17760,17 +17966,21 @@ var ts; var sym = getJsxElementTagSymbol(node); if (links.jsxFlags & 4) { var elemInstanceType = getJsxElementInstanceType(node); - var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896)) { - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } var elemClassType = getJsxGlobalElementClassType(); + if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { + var elemType = getTypeOfSymbol(sym); + var callSignatures = elemType && getSignaturesOfType(elemType, 0); + var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return links.resolvedJsxType = paramType; + } + } if (elemClassType) { checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } @@ -17868,11 +18078,11 @@ var ts; var nameTable = {}; var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 240) { + if (node.attributes[i].kind === 241) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 241); + ts.Debug.assert(node.attributes[i].kind === 242); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -17898,7 +18108,7 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 141; + return s.valueDeclaration ? s.valueDeclaration.kind : 142; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 8 | 64 : 0; @@ -17907,10 +18117,10 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95) { - var errorNode = node.kind === 168 ? + var errorNode = node.kind === 169 ? node.name : node.right; - if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 143) { + if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 144) { error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); return false; } @@ -17979,7 +18189,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 168 + var left = node.kind === 169 ? node.expression : node.left; var type = checkExpression(left); @@ -17991,10 +18201,47 @@ var ts; } return true; } + function getForInVariableSymbol(node) { + var initializer = node.initializer; + if (initializer.kind === 215) { + var variable = initializer.declarations[0]; + if (variable && !ts.isBindingPattern(variable.name)) { + return getSymbolOfNode(variable); + } + } + else if (initializer.kind === 69) { + return getResolvedSymbol(initializer); + } + return undefined; + } + function hasNumericPropertyNames(type) { + return getIndexTypeOfType(type, 1) && !getIndexTypeOfType(type, 0); + } + function isForInVariableForNumericPropertyNames(expr) { + var e = skipParenthesizedNodes(expr); + if (e.kind === 69) { + var symbol = getResolvedSymbol(e); + if (symbol.flags & 3) { + var child = expr; + var node = expr.parent; + while (node) { + if (node.kind === 203 && + child === node.statement && + getForInVariableSymbol(node) === symbol && + hasNumericPropertyNames(checkExpression(node.expression))) { + return true; + } + child = node; + node = node.parent; + } + } + } + return false; + } function checkIndexedAccess(node) { if (!node.argumentExpression) { - var sourceFile = getSourceFile(node); - if (node.parent.kind === 171 && node.parent.expression === node) { + var sourceFile = ts.getSourceFileOfNode(node); + if (node.parent.kind === 172 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -18031,7 +18278,7 @@ var ts; } } if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 258 | 132 | 16777216)) { - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132)) { + if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132) || isForInVariableForNumericPropertyNames(node.argumentExpression)) { var numberIndexType = getIndexTypeOfType(objectType, 1); if (numberIndexType) { return numberIndexType; @@ -18042,7 +18289,9 @@ var ts; return stringIndexType; } if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !isTypeAny(objectType)) { - error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + error(node, getIndexTypeOfType(objectType, 1) ? + ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number : + ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; } @@ -18053,7 +18302,7 @@ var ts; if (indexArgumentExpression.kind === 9 || indexArgumentExpression.kind === 8) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 169 || indexArgumentExpression.kind === 168) { + if (indexArgumentExpression.kind === 170 || indexArgumentExpression.kind === 169) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -18096,10 +18345,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 172) { + if (node.kind === 173) { checkExpression(node.template); } - else if (node.kind !== 139) { + else if (node.kind !== 140) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -18150,7 +18399,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 187) { + if (arg && arg.kind === 188) { return i; } } @@ -18162,11 +18411,11 @@ var ts; var callIsIncomplete; var isDecorator; var spreadArgIndex = -1; - if (node.kind === 172) { + if (node.kind === 173) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 185) { + if (tagExpression.template.kind === 186) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -18178,7 +18427,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 139) { + else if (node.kind === 140) { isDecorator = true; typeArguments = undefined; adjustedArgCount = getEffectiveArgumentCount(node, undefined, signature); @@ -18186,7 +18435,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 171); + ts.Debug.assert(callExpression.kind === 172); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -18239,7 +18488,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 189) { + if (arg === undefined || arg.kind !== 190) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { @@ -18288,7 +18537,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 189) { + if (arg === undefined || arg.kind !== 190) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { @@ -18307,16 +18556,16 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 172) { + if (node.kind === 173) { var template = node.template; args = [undefined]; - if (template.kind === 185) { + if (template.kind === 186) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 139) { + else if (node.kind === 140) { return undefined; } else { @@ -18325,21 +18574,21 @@ var ts; return args; } function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 139) { + if (node.kind === 140) { switch (node.parent.kind) { - case 216: - case 188: + case 217: + case 189: return 1; - case 141: + case 142: return 2; - case 143: - case 145: + case 144: case 146: + case 147: if (languageVersion === 0) { return 2; } return signature.parameters.length >= 3 ? 3 : 2; - case 138: + case 139: return 3; } } @@ -18348,48 +18597,48 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 216) { + if (node.kind === 217) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 138) { + if (node.kind === 139) { node = node.parent; - if (node.kind === 144) { + if (node.kind === 145) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 141 || - node.kind === 143 || - node.kind === 145 || - node.kind === 146) { + if (node.kind === 142 || + node.kind === 144 || + node.kind === 146 || + node.kind === 147) { return getParentTypeOfClassElement(node); } ts.Debug.fail("Unsupported decorator target."); return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 216) { + if (node.kind === 217) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 138) { + if (node.kind === 139) { node = node.parent; - if (node.kind === 144) { + if (node.kind === 145) { return anyType; } } - if (node.kind === 141 || - node.kind === 143 || - node.kind === 145 || - node.kind === 146) { + if (node.kind === 142 || + node.kind === 144 || + node.kind === 146 || + node.kind === 147) { var element = node; switch (element.name.kind) { case 69: case 8: case 9: return getStringLiteralTypeForText(element.name.text); - case 136: + case 137: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216)) { return nameType; @@ -18406,20 +18655,20 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 216) { + if (node.kind === 217) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 138) { + if (node.kind === 139) { return numberType; } - if (node.kind === 141) { + if (node.kind === 142) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 143 || - node.kind === 145 || - node.kind === 146) { + if (node.kind === 144 || + node.kind === 146 || + node.kind === 147) { var propertyType = getTypeOfNode(node); return createTypedPropertyDescriptorType(propertyType); } @@ -18440,26 +18689,26 @@ var ts; return unknownType; } function getEffectiveArgumentType(node, argIndex, arg) { - if (node.kind === 139) { + if (node.kind === 140) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 172) { + else if (argIndex === 0 && node.kind === 173) { return globalTemplateStringsArrayType; } return undefined; } function getEffectiveArgument(node, args, argIndex) { - if (node.kind === 139 || - (argIndex === 0 && node.kind === 172)) { + if (node.kind === 140 || + (argIndex === 0 && node.kind === 173)) { return undefined; } return args[argIndex]; } function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 139) { + if (node.kind === 140) { return node.expression; } - else if (argIndex === 0 && node.kind === 172) { + else if (argIndex === 0 && node.kind === 173) { return node.template; } else { @@ -18467,8 +18716,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 172; - var isDecorator = node.kind === 139; + var isTaggedTemplate = node.kind === 173; + var isDecorator = node.kind === 140; var typeArguments; if (!isTaggedTemplate && !isDecorator) { typeArguments = node.typeArguments; @@ -18700,16 +18949,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 216: - case 188: + case 217: + case 189: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 138: + case 139: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 141: + case 142: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 143: - case 145: + case 144: case 146: + case 147: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -18737,16 +18986,16 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 170) { + if (node.kind === 171) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 171) { + else if (node.kind === 172) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 172) { + else if (node.kind === 173) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } - else if (node.kind === 139) { + else if (node.kind === 140) { links.resolvedSignature = resolveDecorator(node, candidatesOutArray); } else { @@ -18768,12 +19017,12 @@ var ts; if (node.expression.kind === 95) { return voidType; } - if (node.kind === 171) { + if (node.kind === 172) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 144 && - declaration.kind !== 148 && - declaration.kind !== 153) { + declaration.kind !== 145 && + declaration.kind !== 149 && + declaration.kind !== 154) { var funcSymbol = checkExpression(node.expression).symbol; if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16)) { return getInferredClassType(funcSymbol); @@ -18827,7 +19076,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189) { + if (element.kind !== 190) { if (element.name.kind === 69) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -18861,7 +19110,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 194) { + if (func.body.kind !== 195) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -18966,7 +19215,7 @@ var ts; if (returnType === voidType || isTypeAny(returnType)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 || !(func.flags & 524288)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 195 || !(func.flags & 524288)) { return; } var hasExplicitReturn = func.flags & 1048576; @@ -18986,18 +19235,14 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 175) { + if (!hasGrammarError && node.kind === 176) { checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { return anyFunctionType; } - var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); @@ -19025,18 +19270,15 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 143 && node.kind !== 142) { + if (produceDiagnostics && node.kind !== 144 && node.kind !== 143) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); if (!node.asteriskToken) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); @@ -19045,7 +19287,7 @@ var ts; if (!node.type) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 194) { + if (node.body.kind === 195) { checkSourceElement(node.body); } else { @@ -19080,13 +19322,13 @@ var ts; var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 168: { + case 169: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 169: + case 170: return true; - case 174: + case 175: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -19095,11 +19337,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69: - case 168: { + case 169: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384) !== 0; } - case 169: { + case 170: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9) { @@ -19109,7 +19351,7 @@ var ts; } return false; } - case 174: + case 175: return isConstVariableReference(n.expression); default: return false; @@ -19239,9 +19481,9 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 247 || p.kind === 248) { + if (p.kind === 248 || p.kind === 249) { var name_13 = p.name; - if (name_13.kind === 136) { + if (name_13.kind === 137) { checkComputedPropertyName(name_13); } if (isComputedNonLiteralName(name_13)) { @@ -19254,7 +19496,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - if (p.kind === 248) { + if (p.kind === 249) { checkDestructuringAssignment(p, type); } else { @@ -19276,8 +19518,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189) { - if (e.kind !== 187) { + if (e.kind !== 190) { + if (e.kind !== 188) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -19302,7 +19544,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 183 && restExpression.operatorToken.kind === 56) { + if (restExpression.kind === 184 && restExpression.operatorToken.kind === 56) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -19316,7 +19558,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 248) { + if (exprOrAssignment.kind === 249) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -19326,14 +19568,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 183 && target.operatorToken.kind === 56) { + if (target.kind === 184 && target.operatorToken.kind === 56) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 167) { + if (target.kind === 168) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 166) { + if (target.kind === 167) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -19350,7 +19592,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 && (left.kind === 167 || left.kind === 166)) { + if (operator === 56 && (left.kind === 168 || left.kind === 167)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -19574,14 +19816,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -19604,7 +19846,7 @@ var ts; } function checkExpression(node, contextualMapper) { var type; - if (node.kind === 135) { + if (node.kind === 136) { type = checkQualifiedName(node); } else { @@ -19612,9 +19854,9 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 168 && node.parent.expression === node) || - (node.parent.kind === 169 && node.parent.expression === node) || - ((node.kind === 69 || node.kind === 135) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 169 && node.parent.expression === node) || + (node.parent.kind === 170 && node.parent.expression === node) || + ((node.kind === 69 || node.kind === 136) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } @@ -19640,7 +19882,7 @@ var ts; return booleanType; case 8: return checkNumericLiteral(node); - case 185: + case 186: return checkTemplateExpression(node); case 9: return checkStringLiteralExpression(node); @@ -19648,58 +19890,58 @@ var ts; return stringType; case 10: return globalRegExpType; - case 166: - return checkArrayLiteral(node, contextualMapper); case 167: - return checkObjectLiteral(node, contextualMapper); + return checkArrayLiteral(node, contextualMapper); case 168: - return checkPropertyAccessExpression(node); + return checkObjectLiteral(node, contextualMapper); case 169: - return checkIndexedAccess(node); + return checkPropertyAccessExpression(node); case 170: + return checkIndexedAccess(node); case 171: - return checkCallExpression(node); case 172: - return checkTaggedTemplateExpression(node); - case 174: - return checkExpression(node.expression, contextualMapper); - case 188: - return checkClassExpression(node); - case 175: - case 176: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 178: - return checkTypeOfExpression(node); + return checkCallExpression(node); case 173: - case 191: - return checkAssertion(node); - case 177: - return checkDeleteExpression(node); - case 179: - return checkVoidExpression(node); - case 180: - return checkAwaitExpression(node); - case 181: - return checkPrefixUnaryExpression(node); - case 182: - return checkPostfixUnaryExpression(node); - case 183: - return checkBinaryExpression(node, contextualMapper); - case 184: - return checkConditionalExpression(node, contextualMapper); - case 187: - return checkSpreadElementExpression(node, contextualMapper); + return checkTaggedTemplateExpression(node); + case 175: + return checkExpression(node.expression, contextualMapper); case 189: + return checkClassExpression(node); + case 176: + case 177: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); + case 179: + return checkTypeOfExpression(node); + case 174: + case 192: + return checkAssertion(node); + case 178: + return checkDeleteExpression(node); + case 180: + return checkVoidExpression(node); + case 181: + return checkAwaitExpression(node); + case 182: + return checkPrefixUnaryExpression(node); + case 183: + return checkPostfixUnaryExpression(node); + case 184: + return checkBinaryExpression(node, contextualMapper); + case 185: + return checkConditionalExpression(node, contextualMapper); + case 188: + return checkSpreadElementExpression(node, contextualMapper); + case 190: return undefinedType; - case 186: + case 187: return checkYieldExpression(node); - case 242: + case 243: return checkJsxExpression(node); - case 235: - return checkJsxElement(node); case 236: - return checkJsxSelfClosingElement(node); + return checkJsxElement(node); case 237: + return checkJsxSelfClosingElement(node); + case 238: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -19720,7 +19962,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 56) { func = ts.getContainingFunction(node); - if (!(func.kind === 144 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 145 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -19735,9 +19977,9 @@ var ts; if (!node.asteriskToken || !node.body) { return false; } - return node.kind === 143 || - node.kind === 215 || - node.kind === 175; + return node.kind === 144 || + node.kind === 216 || + node.kind === 176; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -19751,104 +19993,97 @@ var ts; } return -1; } - function isInLegalParameterTypePredicatePosition(node) { - switch (node.parent.kind) { - case 176: - case 147: - case 215: - case 175: - case 152: - case 143: - case 142: - return node === node.parent.type; + function checkTypePredicate(node) { + var parent = getTypePredicateParent(node); + if (!parent) { + return; + } + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(parent)); + if (!returnType || !(returnType.flags & 134217728)) { + return; + } + var parameterName = node.parameterName; + if (parameterName.kind === 162) { + getTypeFromThisTypeNode(parameterName); + } + else { + var typePredicate = returnType.predicate; + if (typePredicate.parameterIndex >= 0) { + if (parent.parameters[typePredicate.parameterIndex].dotDotDotToken) { + error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + } + else { + checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type); + } + } + else if (parameterName) { + var hasReportedError = false; + for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { + var name_14 = _a[_i].name; + if ((name_14.kind === 164 || + name_14.kind === 165) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_14, parameterName, typePredicate.parameterName)) { + hasReportedError = true; + break; + } + } + if (!hasReportedError) { + error(node.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + } + } } - return false; } - function isInLegalThisTypePredicatePosition(node) { - if (isInLegalParameterTypePredicatePosition(node)) { - return true; - } + function getTypePredicateParent(node) { switch (node.parent.kind) { - case 141: - case 140: - case 145: - return node === node.parent.type; + case 177: + case 148: + case 216: + case 176: + case 153: + case 144: + case 143: + var parent_6 = node.parent; + if (node === parent_6.type) { + return parent_6; + } + } + } + function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern, predicateVariableNode, predicateVariableName) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var name_15 = _a[_i].name; + if (name_15.kind === 69 && + name_15.text === predicateVariableName) { + error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); + return true; + } + else if (name_15.kind === 165 || + name_15.kind === 164) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_15, predicateVariableNode, predicateVariableName)) { + return true; + } + } } - return false; } function checkSignatureDeclaration(node) { - if (node.kind === 149) { + if (node.kind === 150) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 || node.kind === 215 || node.kind === 153 || - node.kind === 147 || node.kind === 144 || - node.kind === 148) { + else if (node.kind === 153 || node.kind === 216 || node.kind === 154 || + node.kind === 148 || node.kind === 145 || + node.kind === 149) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); - if (node.type) { - if (node.type.kind === 150) { - var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - if (!returnType || !(returnType.flags & 134217728)) { - return; - } - var typePredicate = returnType.predicate; - var typePredicateNode = node.type; - checkSourceElement(typePredicateNode); - if (ts.isIdentifierTypePredicate(typePredicate)) { - if (typePredicate.parameterIndex >= 0) { - if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); - } - else { - checkTypeAssignableTo(typePredicate.type, getTypeOfNode(node.parameters[typePredicate.parameterIndex]), typePredicateNode.type); - } - } - else if (typePredicateNode.parameterName) { - var hasReportedError = false; - for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { - var param = _a[_i]; - if (hasReportedError) { - break; - } - if (param.name.kind === 163 || - param.name.kind === 164) { - (function checkBindingPattern(pattern) { - for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (element.name.kind === 69 && - element.name.text === typePredicate.parameterName) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, typePredicate.parameterName); - hasReportedError = true; - break; - } - else if (element.name.kind === 164 || - element.name.kind === 163) { - checkBindingPattern(element.name); - } - } - })(param.name); - } - } - if (!hasReportedError) { - error(typePredicateNode.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); - } - } - } - } - else { - checkSourceElement(node.type); - } - } + checkSourceElement(node.type); if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 148: + case 149: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 147: + case 148: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -19870,7 +20105,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 217) { + if (node.kind === 218) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -19933,7 +20168,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 170 && n.expression.kind === 95; + return n.kind === 171 && n.expression.kind === 95; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -19954,12 +20189,12 @@ var ts; if (n.kind === 97) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 175 && n.kind !== 215) { + else if (n.kind !== 176 && n.kind !== 216) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 141 && + return n.kind === 142 && !(n.flags & 64) && !!n.initializer; } @@ -19979,7 +20214,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 197 && isSuperCallExpression(statement.expression)) { + if (statement.kind === 198 && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -20005,7 +20240,7 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 145) { + if (node.kind === 146) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288)) { if (node.flags & 1048576) { if (compilerOptions.noImplicitReturns) { @@ -20017,11 +20252,11 @@ var ts; } } } - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 145 ? 146 : 145; + var otherKind = node.kind === 146 ? 147 : 146; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 56) !== (otherAccessor.flags & 56))) { @@ -20038,7 +20273,7 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - if (node.parent.kind !== 167) { + if (node.parent.kind !== 168) { checkSourceElement(node.body); } else { @@ -20120,9 +20355,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217) { - ts.Debug.assert(signatureDeclarationNode.kind === 147 || signatureDeclarationNode.kind === 148); - var signatureKind = signatureDeclarationNode.kind === 147 ? 0 : 1; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 218) { + ts.Debug.assert(signatureDeclarationNode.kind === 148 || signatureDeclarationNode.kind === 149); + var signatureKind = signatureDeclarationNode.kind === 148 ? 0 : 1; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -20140,9 +20375,9 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 217 && - n.parent.kind !== 216 && - n.parent.kind !== 188 && + if (n.parent.kind !== 218 && + n.parent.kind !== 217 && + n.parent.kind !== 189 && ts.isInAmbientContext(n)) { if (!(flags & 4)) { flags |= 2; @@ -20219,7 +20454,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 143 || node.kind === 142) && + var reportError = (node.kind === 144 || node.kind === 143) && (node.flags & 64) !== (subsequentNode.flags & 64); if (reportError) { var diagnostic = node.flags & 64 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -20253,11 +20488,11 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 217 || node.parent.kind === 155 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 218 || node.parent.kind === 156 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 215 || node.kind === 143 || node.kind === 142 || node.kind === 144) { + if (node.kind === 216 || node.kind === 144 || node.kind === 143 || node.kind === 145) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -20370,16 +20605,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 217: + case 218: return 2097152; - case 220: - return d.name.kind === 9 || ts.getModuleInstanceState(d) !== 0 + case 221: + return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 216: - case 219: + case 217: + case 220: return 2097152 | 1048576; - case 223: + case 224: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -20510,22 +20745,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 216: + case 217: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 138: + case 139: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 141: + case 142: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 143: - case 145: + case 144: case 146: + case 147: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -20534,9 +20769,9 @@ var ts; checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo); } function checkTypeNodeAsExpression(node) { - if (node && node.kind === 151) { + if (node && node.kind === 152) { var root = getFirstIdentifier(node.typeName); - var meaning = root.parent.kind === 151 ? 793056 : 1536; + var meaning = root.parent.kind === 152 ? 793056 : 1536; var rootSymbol = resolveName(root, root.text, meaning | 8388608, undefined, undefined); if (rootSymbol && rootSymbol.flags & 8388608) { var aliasTarget = resolveAlias(rootSymbol); @@ -20570,28 +20805,24 @@ var ts; } if (compilerOptions.emitDecoratorMetadata) { switch (node.kind) { - case 216: + case 217: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 143: - case 145: + case 144: case 146: + case 147: checkParameterTypeAnnotationsAsExpressions(node); checkReturnTypeAnnotationAsExpression(node); break; - case 141: - case 138: + case 142: + case 139: checkTypeAnnotationAsExpression(node); break; } } - emitDecorate = true; - if (node.kind === 138) { - emitParam = true; - } ts.forEach(node.decorators, checkDecorator); } function checkFunctionDeclaration(node) { @@ -20606,16 +20837,13 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } - if (node.name && node.name.kind === 136) { + if (node.name && node.name.kind === 137) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.forEach(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + var firstDeclaration = ts.forEach(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)) ? declaration : undefined; }); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -20641,7 +20869,7 @@ var ts; } } function checkBlock(node) { - if (node.kind === 194) { + if (node.kind === 195) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -20660,19 +20888,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 141 || - node.kind === 140 || + if (node.kind === 142 || + node.kind === 141 || + node.kind === 144 || node.kind === 143 || - node.kind === 142 || - node.kind === 145 || - node.kind === 146) { + node.kind === 146 || + node.kind === 147) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 138 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 139 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -20720,11 +20948,11 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 220 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 221 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 250 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 251 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -20732,7 +20960,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 24576) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 213 && !node.initializer) { + if (node.kind === 214 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -20742,25 +20970,25 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214); - var container = varDeclList.parent.kind === 195 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 215); + var container = varDeclList.parent.kind === 196 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 194 && ts.isFunctionLike(container.parent) || + (container.kind === 195 && ts.isFunctionLike(container.parent) || + container.kind === 222 || container.kind === 221 || - container.kind === 220 || - container.kind === 250); + container.kind === 251); if (!namesShareScope) { - var name_14 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_14, name_14); + var name_16 = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_16, name_16); } } } } } function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 138) { + if (ts.getRootDeclaration(node).kind !== 139) { return; } var func = ts.getContainingFunction(node); @@ -20769,7 +20997,7 @@ var ts; if (n.kind === 69) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 138) { + if (referencedSymbol.valueDeclaration.kind === 139) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -20789,26 +21017,26 @@ var ts; function checkVariableLikeDeclaration(node) { checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 165) { - if (node.propertyName && node.propertyName.kind === 136) { + if (node.kind === 166) { + if (node.propertyName && node.propertyName.kind === 137) { checkComputedPropertyName(node.propertyName); } } if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 138 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 139 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - if (node.initializer) { + if (node.initializer && node.parent.parent.kind !== 203) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); checkParameterInitializer(node); } @@ -20817,7 +21045,7 @@ var ts; var symbol = getSymbolOfNode(node); var type = getTypeOfVariableOrParameterOrProperty(symbol); if (node === symbol.valueDeclaration) { - if (node.initializer) { + if (node.initializer && node.parent.parent.kind !== 203) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } @@ -20831,9 +21059,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 141 && node.kind !== 140) { + if (node.kind !== 142 && node.kind !== 141) { checkExportsOnMergedDeclarations(node); - if (node.kind === 213 || node.kind === 165) { + if (node.kind === 214 || node.kind === 166) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -20854,7 +21082,7 @@ var ts; ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 167) { + if (node.modifiers && node.parent.kind === 168) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -20873,7 +21101,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 196) { + if (node.thenStatement.kind === 197) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -20890,12 +21118,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 214) { + if (node.initializer && node.initializer.kind === 215) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -20910,13 +21138,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 166 || varExpr.kind === 167) { + if (varExpr.kind === 167 || varExpr.kind === 168) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -20931,7 +21159,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -20941,7 +21169,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 166 || varExpr.kind === 167) { + if (varExpr.kind === 167 || varExpr.kind === 168) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258)) { @@ -21109,7 +21337,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 145 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 146))); + return !!(node.kind === 146 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 147))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -21127,10 +21355,10 @@ var ts; if (func.asteriskToken) { return; } - if (func.kind === 146) { + if (func.kind === 147) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } - else if (func.kind === 144) { + else if (func.kind === 145) { if (!checkTypeAssignableTo(exprType, returnType, node.expression)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -21166,7 +21394,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 244 && !hasDuplicateDefaultClause) { + if (clause.kind === 245 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -21178,7 +21406,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 243) { + if (produceDiagnostics && clause.kind === 244) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); var expressionTypeIsAssignableToCaseType = (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) || @@ -21197,7 +21425,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 209 && current.label.text === node.label.text) { + if (current.kind === 210 && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -21291,7 +21519,7 @@ var ts; return; } var errorNode; - if (prop.valueDeclaration.name.kind === 136 || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 137 || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -21366,7 +21594,6 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitExtends = emitExtends || !ts.isInAmbientContext(node); var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType = baseTypes[0]; @@ -21440,7 +21667,7 @@ var ts; if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(derivedClassDecl.flags & 128))) { - if (derivedClassDecl.kind === 188) { + if (derivedClassDecl.kind === 189) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -21484,7 +21711,7 @@ var ts; } } function isAccessor(kind) { - return kind === 145 || kind === 146; + return kind === 146 || kind === 147; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -21550,7 +21777,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 218); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -21648,7 +21875,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 181: + case 182: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -21659,7 +21886,7 @@ var ts; case 50: return ~value_1; } return undefined; - case 183: + case 184: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -21684,11 +21911,11 @@ var ts; return undefined; case 8: return +e.text; - case 174: + case 175: return evalConstant(e.expression); case 69: + case 170: case 169: - case 168: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -21699,7 +21926,7 @@ var ts; } else { var expression; - if (e.kind === 169) { + if (e.kind === 170) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9) { return undefined; @@ -21716,7 +21943,7 @@ var ts; if (current.kind === 69) { break; } - else if (current.kind === 168) { + else if (current.kind === 169) { current = current.expression; } else { @@ -21775,7 +22002,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 219) { + if (declaration.kind !== 220) { return false; } var enumDeclaration = declaration; @@ -21798,8 +22025,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 216 || - (declaration.kind === 215 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 217 || + (declaration.kind === 216 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -21821,7 +22048,12 @@ var ts; } function checkModuleDeclaration(node) { if (produceDiagnostics) { - var isAmbientExternalModule = node.name.kind === 9; + var isGlobalAugmentation = ts.isGlobalScopeAugmentation(node); + var inAmbientContext = ts.isInAmbientContext(node); + if (isGlobalAugmentation && !inAmbientContext) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + } + var isAmbientExternalModule = ts.isAmbientModule(node); var contextErrorMessage = isAmbientExternalModule ? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : ts.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module; @@ -21829,7 +22061,7 @@ var ts; return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!ts.isInAmbientContext(node) && node.name.kind === 9) { + if (!inAmbientContext && node.name.kind === 9) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } } @@ -21839,7 +22071,7 @@ var ts; var symbol = getSymbolOfNode(node); if (symbol.flags & 512 && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) + && !inAmbientContext && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) { var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { @@ -21850,29 +22082,102 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 216); + var mergedClass = ts.getDeclarationOfKind(symbol, 217); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; } } if (isAmbientExternalModule) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + if (ts.isExternalModuleAugmentation(node)) { + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432); + if (checkBody) { + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + checkModuleAugmentationElement(statement, isGlobalAugmentation); + } + } } - if (ts.isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + else if (isGlobalSourceFile(node.parent)) { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else if (ts.isExternalModuleNameRelative(node.name.text)) { + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + } + } + else { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else { + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + } } } } checkSourceElement(node.body); } + function checkModuleAugmentationElement(node, isGlobalAugmentation) { + switch (node.kind) { + case 196: + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + checkModuleAugmentationElement(decl, isGlobalAugmentation); + } + break; + case 230: + case 231: + grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); + break; + case 224: + if (node.moduleReference.kind !== 9) { + error(node.name, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + break; + } + case 225: + grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); + break; + case 166: + case 214: + var name_17 = node.name; + if (ts.isBindingPattern(name_17)) { + for (var _b = 0, _c = name_17.elements; _b < _c.length; _b++) { + var el = _c[_b]; + checkModuleAugmentationElement(el, isGlobalAugmentation); + } + break; + } + case 217: + case 220: + case 216: + case 218: + case 221: + case 219: + var symbol = getSymbolOfNode(node); + if (symbol) { + var reportError = !(symbol.flags & 33554432); + if (!reportError) { + if (isGlobalAugmentation) { + reportError = symbol.parent !== undefined; + } + else { + reportError = ts.isExternalModuleAugmentation(symbol.parent.valueDeclaration); + } + } + if (reportError) { + error(node, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + } + } + break; + } + } function getFirstIdentifier(node) { while (true) { - if (node.kind === 135) { + if (node.kind === 136) { node = node.left; } - else if (node.kind === 168) { + else if (node.kind === 169) { node = node.expression; } else { @@ -21888,16 +22193,18 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 250 && !inAmbientExternalModule) { - error(moduleName, node.kind === 230 ? + var inAmbientExternalModule = node.parent.kind === 222 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 && !inAmbientExternalModule) { + error(moduleName, node.kind === 231 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } if (inAmbientExternalModule && ts.isExternalModuleNameRelative(moduleName.text)) { - error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); - return false; + if (!isTopLevelInExternalModuleAugmentation(node)) { + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + return false; + } } return true; } @@ -21909,7 +22216,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 232 ? + var message = node.kind === 233 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -21935,7 +22242,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226) { + if (importClause.namedBindings.kind === 227) { checkImportBinding(importClause.namedBindings); } else { @@ -21986,8 +22293,8 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 250 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 222 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -22000,22 +22307,29 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 250 && node.parent.kind !== 221 && node.parent.kind !== 220) { + if (node.parent.kind !== 251 && node.parent.kind !== 222 && node.parent.kind !== 221) { return grammarErrorOnFirstToken(node, errorMessage); } } function checkExportSpecifier(node) { checkAliasSymbol(node); if (!node.parent.parent.moduleSpecifier) { - markExportAsReferenced(node); + var exportedName = node.propertyName || node.name; + var symbol = resolveName(exportedName, exportedName.text, 107455 | 793056 | 1536 | 8388608, undefined, undefined); + if (symbol && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0]))) { + error(exportedName, ts.Diagnostics.Cannot_re_export_name_that_is_not_defined_in_the_module); + } + else { + markExportAsReferenced(node); + } } } function checkExportAssignment(node) { if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 250 ? node.parent : node.parent.parent; - if (container.kind === 220 && container.name.kind === 69) { + var container = node.parent.kind === 251 ? node.parent : node.parent.parent; + if (container.kind === 221 && !ts.isAmbientModule(container)) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -22053,7 +22367,9 @@ var ts; var exportEqualsSymbol = moduleSymbol.exports["export="]; if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + if (!isTopLevelInExternalModuleAugmentation(declaration)) { + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } } var exports = getExportsOfModule(moduleSymbol); for (var id in exports) { @@ -22074,21 +22390,7 @@ var ts; links.exportsChecked = true; } function isNotOverload(declaration) { - return declaration.kind !== 215 || !!declaration.body; - } - } - function checkTypePredicate(node) { - var parameterName = node.parameterName; - if (parameterName.kind === 69 && !isInLegalParameterTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } - else if (parameterName.kind === 161) { - if (!isInLegalThisTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); - } - else { - getTypeFromThisTypeNode(parameterName); - } + return declaration.kind !== 216 || !!declaration.body; } } function checkSourceElement(node) { @@ -22098,118 +22400,118 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 220: - case 216: + case 221: case 217: - case 215: + case 218: + case 216: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 137: - return checkTypeParameter(node); case 138: + return checkTypeParameter(node); + case 139: return checkParameter(node); + case 142: case 141: - case 140: return checkPropertyDeclaration(node); - case 152: case 153: - case 147: + case 154: case 148: - return checkSignatureDeclaration(node); case 149: return checkSignatureDeclaration(node); - case 143: - case 142: - return checkMethodDeclaration(node); - case 144: - return checkConstructorDeclaration(node); - case 145: - case 146: - return checkAccessorDeclaration(node); - case 151: - return checkTypeReferenceNode(node); case 150: + return checkSignatureDeclaration(node); + case 144: + case 143: + return checkMethodDeclaration(node); + case 145: + return checkConstructorDeclaration(node); + case 146: + case 147: + return checkAccessorDeclaration(node); + case 152: + return checkTypeReferenceNode(node); + case 151: return checkTypePredicate(node); - case 154: - return checkTypeQuery(node); case 155: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 156: - return checkArrayType(node); + return checkTypeLiteral(node); case 157: - return checkTupleType(node); + return checkArrayType(node); case 158: + return checkTupleType(node); case 159: - return checkUnionOrIntersectionType(node); case 160: + return checkUnionOrIntersectionType(node); + case 161: return checkSourceElement(node.type); - case 215: - return checkFunctionDeclaration(node); - case 194: - case 221: - return checkBlock(node); - case 195: - return checkVariableStatement(node); - case 197: - return checkExpressionStatement(node); - case 198: - return checkIfStatement(node); - case 199: - return checkDoStatement(node); - case 200: - return checkWhileStatement(node); - case 201: - return checkForStatement(node); - case 202: - return checkForInStatement(node); - case 203: - return checkForOfStatement(node); - case 204: - case 205: - return checkBreakOrContinueStatement(node); - case 206: - return checkReturnStatement(node); - case 207: - return checkWithStatement(node); - case 208: - return checkSwitchStatement(node); - case 209: - return checkLabeledStatement(node); - case 210: - return checkThrowStatement(node); - case 211: - return checkTryStatement(node); - case 213: - return checkVariableDeclaration(node); - case 165: - return checkBindingElement(node); case 216: - return checkClassDeclaration(node); - case 217: - return checkInterfaceDeclaration(node); - case 218: - return checkTypeAliasDeclaration(node); - case 219: - return checkEnumDeclaration(node); - case 220: - return checkModuleDeclaration(node); - case 224: - return checkImportDeclaration(node); - case 223: - return checkImportEqualsDeclaration(node); - case 230: - return checkExportDeclaration(node); - case 229: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); + case 195: + case 222: + return checkBlock(node); case 196: - checkGrammarStatementInAmbientContext(node); - return; + return checkVariableStatement(node); + case 198: + return checkExpressionStatement(node); + case 199: + return checkIfStatement(node); + case 200: + return checkDoStatement(node); + case 201: + return checkWhileStatement(node); + case 202: + return checkForStatement(node); + case 203: + return checkForInStatement(node); + case 204: + return checkForOfStatement(node); + case 205: + case 206: + return checkBreakOrContinueStatement(node); + case 207: + return checkReturnStatement(node); + case 208: + return checkWithStatement(node); + case 209: + return checkSwitchStatement(node); + case 210: + return checkLabeledStatement(node); + case 211: + return checkThrowStatement(node); case 212: + return checkTryStatement(node); + case 214: + return checkVariableDeclaration(node); + case 166: + return checkBindingElement(node); + case 217: + return checkClassDeclaration(node); + case 218: + return checkInterfaceDeclaration(node); + case 219: + return checkTypeAliasDeclaration(node); + case 220: + return checkEnumDeclaration(node); + case 221: + return checkModuleDeclaration(node); + case 225: + return checkImportDeclaration(node); + case 224: + return checkImportEqualsDeclaration(node); + case 231: + return checkExportDeclaration(node); + case 230: + return checkExportAssignment(node); + case 197: checkGrammarStatementInAmbientContext(node); return; - case 233: + case 213: + checkGrammarStatementInAmbientContext(node); + return; + case 234: return checkMissingDeclaration(node); } } @@ -22222,17 +22524,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 175: case 176: + case 177: + case 144: case 143: - case 142: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 145: case 146: + case 147: checkAccessorDeferred(node); break; - case 188: + case 189: checkClassExpressionDeferred(node); break; } @@ -22252,10 +22554,6 @@ var ts; } } checkGrammarSourceFile(node); - emitExtends = false; - emitDecorate = false; - emitParam = false; - emitAwaiter = false; potentialThisCollisions.length = 0; deferredNodes = []; ts.forEach(node.statements, checkSourceElement); @@ -22268,21 +22566,6 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } - if (emitExtends) { - links.flags |= 8; - } - if (emitDecorate) { - links.flags |= 16; - } - if (emitParam) { - links.flags |= 32; - } - if (emitAwaiter) { - links.flags |= 64; - } - if (emitGenerator || (emitAwaiter && languageVersion < 2)) { - links.flags |= 128; - } links.flags |= 1; } } @@ -22316,7 +22599,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 207 && node.parent.statement === node) { + if (node.parent.kind === 208 && node.parent.statement === node) { return true; } node = node.parent; @@ -22338,28 +22621,28 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 250: + case 251: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 220: + case 221: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 219: + case 220: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 188: + case 189: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 216: case 217: + case 218: if (!(memberFlags & 64)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 175: + case 176: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -22398,36 +22681,36 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 137: - case 216: + case 138: case 217: case 218: case 219: + case 220: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 135) { + while (node.parent && node.parent.kind === 136) { node = node.parent; } - return node.parent && node.parent.kind === 151; + return node.parent && node.parent.kind === 152; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 168) { + while (node.parent && node.parent.kind === 169) { node = node.parent; } - return node.parent && node.parent.kind === 190; + return node.parent && node.parent.kind === 191; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 135) { + while (nodeOnRightSide.parent.kind === 136) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 223) { + if (nodeOnRightSide.parent.kind === 224) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 229) { + if (nodeOnRightSide.parent.kind === 230) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -22439,10 +22722,10 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 229) { + if (entityName.parent.kind === 230) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 168) { + if (entityName.kind !== 169) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } @@ -22452,7 +22735,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 190) { + if (entityName.parent.kind === 191) { meaning = 793056; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -22464,9 +22747,9 @@ var ts; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 237) || - (entityName.parent.kind === 236) || - (entityName.parent.kind === 239)) { + else if ((entityName.parent.kind === 238) || + (entityName.parent.kind === 237) || + (entityName.parent.kind === 240)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -22477,14 +22760,14 @@ var ts; var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 168) { + else if (entityName.kind === 169) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 135) { + else if (entityName.kind === 136) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -22493,14 +22776,14 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 151 ? 793056 : 1536; + var meaning = entityName.parent.kind === 152 ? 793056 : 1536; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 240) { + else if (entityName.parent.kind === 241) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 150) { + if (entityName.parent.kind === 151) { return resolveEntityName(entityName, 1); } return undefined; @@ -22514,12 +22797,12 @@ var ts; } if (node.kind === 69) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 229 + return node.parent.kind === 230 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 165 && - node.parent.parent.kind === 163 && + else if (node.parent.kind === 166 && + node.parent.parent.kind === 164 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -22530,30 +22813,30 @@ var ts; } switch (node.kind) { case 69: - case 168: - case 135: + case 169: + case 136: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97: case 95: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 161: + case 162: return getTypeFromTypeNode(node).symbol; case 121: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 144) { + if (constructorDeclaration && constructorDeclaration.kind === 145) { return constructorDeclaration.parent.symbol; } return undefined; case 9: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 224 || node.parent.kind === 230) && + ((node.parent.kind === 225 || node.parent.kind === 231) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 8: - if (node.parent.kind === 169 && node.parent.argumentExpression === node) { + if (node.parent.kind === 170 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -22567,11 +22850,16 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 248) { - return resolveEntityName(location.name, 107455); + if (location && location.kind === 249) { + return resolveEntityName(location.name, 107455 | 8388608); } return undefined; } + function getExportSpecifierLocalTargetSymbol(node) { + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536 | 8388608); + } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { return unknownType; @@ -22638,9 +22926,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var name_15 = symbol.name; + var name_18 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_15); + var symbol = getPropertyOfType(t, name_18); if (symbol) { symbols.push(symbol); } @@ -22689,11 +22977,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 250) { + if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 251) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 220 || n.kind === 219) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 221 || n.kind === 220) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -22706,11 +22994,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 194: - case 222: - case 201: + case 195: + case 223: case 202: case 203: + case 204: return true; } return false; @@ -22736,22 +23024,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 223: - case 225: + case 224: case 226: - case 228: - case 232: + case 227: + case 229: + case 233: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 230: + case 231: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 229: + case 230: return node.expression && node.expression.kind === 69 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 250 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 251 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -22799,7 +23087,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 249) { + if (node.kind === 250) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -22915,21 +23203,34 @@ var ts; } function getExternalModuleFileFromDeclaration(declaration) { var specifier = ts.getExternalModuleName(declaration); - var moduleSymbol = getSymbolAtLocation(specifier); + var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined); if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 250); + return ts.getDeclarationOfKind(moduleSymbol, 251); } function initializeTypeChecker() { ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file, compilerOptions); }); + var augmentations; ts.forEach(host.getSourceFiles(), function (file) { if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } + if (file.moduleAugmentations) { + (augmentations || (augmentations = [])).push(file.moduleAugmentations); + } }); + if (augmentations) { + for (var _i = 0, augmentations_1 = augmentations; _i < augmentations_1.length; _i++) { + var list = augmentations_1[_i]; + for (var _a = 0, list_2 = list; _a < list_2.length; _a++) { + var augmentation = list_2[_a]; + mergeModuleAugmentation(augmentation); + } + } + } addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); @@ -22994,14 +23295,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 143 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 144 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 145 || node.kind === 146) { + else if (node.kind === 146 || node.kind === 147) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -23011,38 +23312,38 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 145: case 146: - case 144: - case 141: - case 140: - case 143: + case 147: + case 145: case 142: - case 149: - case 220: + case 141: + case 144: + case 143: + case 150: + case 221: + case 225: case 224: - case 223: + case 231: case 230: - case 229: - case 138: - break; - case 215: - if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && - node.parent.kind !== 221 && node.parent.kind !== 250) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } + case 139: break; case 216: - case 217: - case 195: - case 218: - if (node.modifiers && node.parent.kind !== 221 && node.parent.kind !== 250) { + if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && + node.parent.kind !== 222 && node.parent.kind !== 251) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; + case 217: + case 218: + case 196: case 219: + if (node.modifiers && node.parent.kind !== 222 && node.parent.kind !== 251) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + break; + case 220: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74) && - node.parent.kind !== 221 && node.parent.kind !== 250) { + node.parent.kind !== 222 && node.parent.kind !== 251) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -23058,7 +23359,7 @@ var ts; var modifier = _a[_i]; switch (modifier.kind) { case 74: - if (node.kind !== 219 && node.parent.kind === 216) { + if (node.kind !== 220 && node.parent.kind === 217) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74)); } break; @@ -23086,7 +23387,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 221 || node.parent.kind === 250) { + else if (node.parent.kind === 222 || node.parent.kind === 251) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128) { @@ -23106,10 +23407,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 221 || node.parent.kind === 250) { + else if (node.parent.kind === 222 || node.parent.kind === 251) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -23131,10 +23432,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 2; @@ -23146,13 +23447,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 222) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4; @@ -23162,11 +23463,11 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 216) { - if (node.kind !== 143) { + if (node.kind !== 217) { + if (node.kind !== 144) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 216 && node.parent.flags & 128)) { + if (!(node.parent.kind === 217 && node.parent.flags & 128)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64) { @@ -23185,7 +23486,7 @@ var ts; else if (flags & 4 || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -23193,7 +23494,7 @@ var ts; break; } } - if (node.kind === 144) { + if (node.kind === 145) { if (flags & 64) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -23211,10 +23512,10 @@ var ts; } return; } - else if ((node.kind === 224 || node.kind === 223) && flags & 4) { + else if ((node.kind === 225 || node.kind === 224) && flags & 4) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 138 && (flags & 56) && ts.isBindingPattern(node.name)) { + else if (node.kind === 139 && (flags & 56) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } if (flags & 256) { @@ -23226,10 +23527,10 @@ var ts; return grammarErrorOnNode(asyncModifier, ts.Diagnostics.Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher); } switch (node.kind) { - case 143: - case 215: - case 175: + case 144: + case 216: case 176: + case 177: if (!node.asteriskToken) { return false; } @@ -23294,7 +23595,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 176) { + if (node.kind === 177) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -23361,7 +23662,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 189) { + if (arg.kind === 190) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -23432,19 +23733,19 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 136) { + if (node.kind !== 137) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 183 && computedPropertyName.expression.operatorToken.kind === 24) { + if (computedPropertyName.expression.kind === 184 && computedPropertyName.expression.operatorToken.kind === 24) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 215 || - node.kind === 175 || - node.kind === 143); + ts.Debug.assert(node.kind === 216 || + node.kind === 176 || + node.kind === 144); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -23468,58 +23769,58 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var _loop_1 = function(prop) { - var name_16 = prop.name; - if (prop.kind === 189 || - name_16.kind === 136) { - checkGrammarComputedPropertyName(name_16); + var name_19 = prop.name; + if (prop.kind === 190 || + name_19.kind === 137) { + checkGrammarComputedPropertyName(name_19); return "continue"; } - if (prop.kind === 248 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 249 && !inDestructuring && prop.objectAssignmentInitializer) { return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } ts.forEach(prop.modifiers, function (mod) { - if (mod.kind !== 118 || prop.kind !== 143) { + if (mod.kind !== 118 || prop.kind !== 144) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } }); var currentKind = void 0; - if (prop.kind === 247 || prop.kind === 248) { + if (prop.kind === 248 || prop.kind === 249) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_16.kind === 8) { - checkGrammarNumericLiteral(name_16); + if (name_19.kind === 8) { + checkGrammarNumericLiteral(name_19); } currentKind = Property; } - else if (prop.kind === 143) { + else if (prop.kind === 144) { currentKind = Property; } - else if (prop.kind === 145) { + else if (prop.kind === 146) { currentKind = GetAccessor; } - else if (prop.kind === 146) { + else if (prop.kind === 147) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_16.text)) { - seen[name_16.text] = currentKind; + if (!ts.hasProperty(seen, name_19.text)) { + seen[name_19.text] = currentKind; } else { - var existingKind = seen[name_16.text]; + var existingKind = seen[name_19.text]; if (currentKind === Property && existingKind === Property) { return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name_16.text] = currentKind | existingKind; + seen[name_19.text] = currentKind | existingKind; } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } }; @@ -23534,19 +23835,19 @@ var ts; var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 241) { + if (attr.kind === 242) { continue; } var jsxAttr = attr; - var name_17 = jsxAttr.name; - if (!ts.hasProperty(seen, name_17.text)) { - seen[name_17.text] = true; + var name_20 = jsxAttr.name; + if (!ts.hasProperty(seen, name_20.text)) { + seen[name_20.text] = true; } else { - return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name_20, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 242 && !initializer.expression) { + if (initializer && initializer.kind === 243 && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -23555,7 +23856,7 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 214) { + if (forInOrOfStatement.initializer.kind === 215) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -23563,20 +23864,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 202 + var diagnostic = forInOrOfStatement.kind === 203 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 202 + var diagnostic = forInOrOfStatement.kind === 203 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 202 + var diagnostic = forInOrOfStatement.kind === 203 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -23599,10 +23900,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 145 && accessor.parameters.length) { + else if (kind === 146 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 146) { + else if (kind === 147) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -23637,12 +23938,12 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 167) { + if (node.parent.kind === 168) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } else if (node.body === undefined) { - return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -23656,10 +23957,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 218) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 155) { + else if (node.parent.kind === 156) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -23670,9 +23971,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 209: + case 210: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 204 + var isMisplacedContinueLabel = node.kind === 205 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -23680,8 +23981,8 @@ var ts; return false; } break; - case 208: - if (node.kind === 205 && !node.label) { + case 209: + if (node.kind === 206 && !node.label) { return false; } break; @@ -23694,13 +23995,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 205 + var message = node.kind === 206 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 205 + var message = node.kind === 206 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -23712,7 +24013,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 164 || node.name.kind === 163) { + if (node.name.kind === 165 || node.name.kind === 164) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -23721,7 +24022,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 202 && node.parent.parent.kind !== 203) { + if (node.parent.parent.kind !== 203 && node.parent.parent.kind !== 204) { if (ts.isInAmbientContext(node)) { if (node.initializer) { var equalsTokenLength = "=".length; @@ -23750,7 +24051,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 189) { + if (element.kind !== 190) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -23767,15 +24068,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 198: case 199: case 200: - case 207: case 201: + case 208: case 202: case 203: + case 204: return false; - case 209: + case 210: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -23831,7 +24132,7 @@ var ts; return true; } } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 218) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -23839,7 +24140,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 155) { + else if (node.parent.kind === 156) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -23852,12 +24153,12 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 217 || - node.kind === 218 || + if (node.kind === 218 || + node.kind === 219 || + node.kind === 225 || node.kind === 224 || - node.kind === 223 || + node.kind === 231 || node.kind === 230 || - node.kind === 229 || (node.flags & 4) || (node.flags & (2 | 512))) { return false; @@ -23867,7 +24168,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 195) { + if (ts.isDeclaration(decl) || decl.kind === 196) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -23886,7 +24187,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 194 || node.parent.kind === 221 || node.parent.kind === 250) { + if (node.parent.kind === 195 || node.parent.kind === 222 || node.parent.kind === 251) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -23922,8 +24223,9 @@ var ts; getSourceMapData: function () { return undefined; }, setSourceFile: function (sourceFile) { }, emitStart: function (range) { }, - emitEnd: function (range) { }, + emitEnd: function (range, stopOverridingSpan) { }, emitPos: function (pos) { }, + changeEmitSourcePos: function () { }, getText: function () { return undefined; }, getSourceMappingURL: function () { return undefined; }, initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, @@ -23937,6 +24239,8 @@ var ts; var compilerOptions = host.getCompilerOptions(); var currentSourceFile; var sourceMapDir; + var stopOverridingSpan = false; + var modifyLastSourcePos = false; var sourceMapSourceIndex; var lastRecordedSourceMapSpan; var lastEncodedSourceMapSpan; @@ -23948,6 +24252,7 @@ var ts; emitPos: emitPos, emitStart: emitStart, emitEnd: emitEnd, + changeEmitSourcePos: changeEmitSourcePos, getText: getText, getSourceMappingURL: getSourceMappingURL, initialize: initialize, @@ -24011,6 +24316,29 @@ var ts; lastEncodedNameIndex = undefined; sourceMapData = undefined; } + function updateLastEncodedAndRecordedSpans() { + if (modifyLastSourcePos) { + modifyLastSourcePos = false; + lastRecordedSourceMapSpan.emittedLine = lastEncodedSourceMapSpan.emittedLine; + lastRecordedSourceMapSpan.emittedColumn = lastEncodedSourceMapSpan.emittedColumn; + sourceMapData.sourceMapDecodedMappings.pop(); + lastEncodedSourceMapSpan = sourceMapData.sourceMapDecodedMappings.length ? + sourceMapData.sourceMapDecodedMappings[sourceMapData.sourceMapDecodedMappings.length - 1] : + undefined; + var sourceMapMappings = sourceMapData.sourceMapMappings; + var lenthToSet = sourceMapMappings.length - 1; + for (; lenthToSet >= 0; lenthToSet--) { + var currentChar = sourceMapMappings.charAt(lenthToSet); + if (currentChar === ",") { + break; + } + if (currentChar === ";" && lenthToSet !== 0 && sourceMapMappings.charAt(lenthToSet - 1) !== ";") { + break; + } + } + sourceMapData.sourceMapMappings = sourceMapMappings.substr(0, Math.max(0, lenthToSet)); + } + } function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { return; @@ -24032,6 +24360,7 @@ var ts; sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); if (lastRecordedSourceMapSpan.nameIndex >= 0) { + ts.Debug.assert(false, "We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this"); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; } @@ -24061,19 +24390,29 @@ var ts; sourceColumn: sourceLinePos.character, sourceIndex: sourceMapSourceIndex }; + stopOverridingSpan = false; } - else { + else if (!stopOverridingSpan) { lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } + updateLastEncodedAndRecordedSpans(); + } + function getStartPos(range) { + var rangeHasDecorators = !!range.decorators; + return range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1; } function emitStart(range) { - var rangeHasDecorators = !!range.decorators; - emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + emitPos(getStartPos(range)); } - function emitEnd(range) { + function emitEnd(range, stopOverridingEnd) { emitPos(range.end); + stopOverridingSpan = stopOverridingEnd; + } + function changeEmitSourcePos() { + ts.Debug.assert(!modifyLastSourcePos); + modifyLastSourcePos = true; } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -24160,6 +24499,7 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; + var resultHasExternalModuleIndicator; var currentText; var currentLineMap; var currentIdentifiers; @@ -24190,6 +24530,7 @@ var ts; } }); } + resultHasExternalModuleIndicator = false; if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { noDeclare = false; emitSourceFile(sourceFile); @@ -24208,7 +24549,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 224); + ts.Debug.assert(aliasEmitInfo.node.kind === 225); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -24225,6 +24566,10 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } + if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { + write("export {};"); + writeLine(); + } }); return { reportedDeclarationError: reportedDeclarationError, @@ -24271,10 +24616,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 213) { + if (declaration.kind === 214) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 227 || declaration.kind === 228 || declaration.kind === 225) { + else if (declaration.kind === 228 || declaration.kind === 229 || declaration.kind === 226) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -24285,7 +24630,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 224) { + if (moduleElementEmitInfo.node.kind === 225) { moduleElementEmitInfo.isVisible = true; } else { @@ -24293,12 +24638,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 220) { + if (nodeToCheck.kind === 221) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 220) { + if (nodeToCheck.kind === 221) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -24401,35 +24746,35 @@ var ts; case 120: case 131: case 103: - case 161: case 162: + case 163: return writeTextOfNode(currentText, type); - case 190: + case 191: return emitExpressionWithTypeArguments(type); - case 151: - return emitTypeReference(type); - case 154: - return emitTypeQuery(type); - case 156: - return emitArrayType(type); - case 157: - return emitTupleType(type); - case 158: - return emitUnionType(type); - case 159: - return emitIntersectionType(type); - case 160: - return emitParenType(type); case 152: - case 153: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 155: + return emitTypeQuery(type); + case 157: + return emitArrayType(type); + case 158: + return emitTupleType(type); + case 159: + return emitUnionType(type); + case 160: + return emitIntersectionType(type); + case 161: + return emitParenType(type); + case 153: + case 154: + return emitSignatureDeclarationWithJsDocComments(type); + case 156: return emitTypeLiteral(type); case 69: return emitEntityName(type); - case 135: + case 136: return emitEntityName(type); - case 150: + case 151: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -24437,21 +24782,21 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 135 ? entityName.left : entityName.expression; - var right = entityName.kind === 135 ? entityName.right : entityName.name; + var left = entityName.kind === 136 ? entityName.left : entityName.expression; + var right = entityName.kind === 136 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 223 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 224 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 168); + ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 169); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -24525,9 +24870,9 @@ var ts; var count = 0; while (true) { count++; - var name_18 = baseName + "_" + count; - if (!ts.hasProperty(currentIdentifiers, name_18)) { - return name_18; + var name_21 = baseName + "_" + count; + if (!ts.hasProperty(currentIdentifiers, name_21)) { + return name_21; } } } @@ -24568,10 +24913,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 223 || - (node.parent.kind === 250 && isCurrentFileExternalModule)) { + else if (node.kind === 224 || + (node.parent.kind === 251 && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 251) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -24580,7 +24925,7 @@ var ts; }); } else { - if (node.kind === 224) { + if (node.kind === 225) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -24598,37 +24943,37 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 215: - return writeFunctionDeclaration(node); - case 195: - return writeVariableStatement(node); - case 217: - return writeInterfaceDeclaration(node); case 216: - return writeClassDeclaration(node); + return writeFunctionDeclaration(node); + case 196: + return writeVariableStatement(node); case 218: - return writeTypeAliasDeclaration(node); + return writeInterfaceDeclaration(node); + case 217: + return writeClassDeclaration(node); case 219: - return writeEnumDeclaration(node); + return writeTypeAliasDeclaration(node); case 220: + return writeEnumDeclaration(node); + case 221: return writeModuleDeclaration(node); - case 223: - return writeImportEqualsDeclaration(node); case 224: + return writeImportEqualsDeclaration(node); + case 225: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 250) { + if (node.parent.kind === 251) { if (node.flags & 2) { write("export "); } if (node.flags & 512) { write("default "); } - else if (node.kind !== 217 && !noDeclare) { + else if (node.kind !== 218 && !noDeclare) { write("declare "); } } @@ -24675,7 +25020,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 226) { + if (namedBindings.kind === 227) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -24701,7 +25046,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 226) { + if (node.importClause.namedBindings.kind === 227) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -24718,11 +25063,15 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 221; var moduleSpecifier; - if (parent.kind === 223) { + if (parent.kind === 224) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } + else if (parent.kind === 221) { + moduleSpecifier = parent.name; + } else { var node = parent; moduleSpecifier = node.moduleSpecifier; @@ -24771,14 +25120,24 @@ var ts; function writeModuleDeclaration(node) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); - if (node.flags & 65536) { - write("namespace "); + if (ts.isGlobalScopeAugmentation(node)) { + write("global "); } else { - write("module "); + if (node.flags & 65536) { + write("namespace "); + } + else { + write("module "); + } + if (ts.isExternalModuleAugmentation(node)) { + emitExternalModuleSpecifier(node); + } + else { + writeTextOfNode(currentText, node.name); + } } - writeTextOfNode(currentText, node.name); - while (node.body.kind !== 221) { + while (node.body.kind !== 222) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -24843,7 +25202,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 143 && (node.parent.flags & 16); + return node.parent.kind === 144 && (node.parent.flags & 16); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -24853,15 +25212,15 @@ var ts; writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 152 || - node.parent.kind === 153 || - (node.parent.parent && node.parent.parent.kind === 155)) { - ts.Debug.assert(node.parent.kind === 143 || - node.parent.kind === 142 || - node.parent.kind === 152 || + if (node.parent.kind === 153 || + node.parent.kind === 154 || + (node.parent.parent && node.parent.parent.kind === 156)) { + ts.Debug.assert(node.parent.kind === 144 || + node.parent.kind === 143 || node.parent.kind === 153 || - node.parent.kind === 147 || - node.parent.kind === 148); + node.parent.kind === 154 || + node.parent.kind === 148 || + node.parent.kind === 149); emitType(node.constraint); } else { @@ -24871,31 +25230,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 216: + case 217: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 217: + case 218: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 148: + case 149: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 147: + case 148: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 144: case 143: - case 142: if (node.parent.flags & 64) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216) { + else if (node.parent.parent.kind === 217) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 215: + case 216: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -24928,7 +25287,7 @@ var ts; } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 216) { + if (node.parent.parent.kind === 217) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; @@ -25008,16 +25367,16 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 213 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 214 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeTextOfNode(currentText, node.name); - if ((node.kind === 141 || node.kind === 140) && ts.hasQuestionToken(node)) { + if ((node.kind === 142 || node.kind === 141) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 141 || node.kind === 140) && node.parent.kind === 155) { + if ((node.kind === 142 || node.kind === 141) && node.parent.kind === 156) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 16)) { @@ -25026,14 +25385,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 213) { + if (node.kind === 214) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 141 || node.kind === 140) { + else if (node.kind === 142 || node.kind === 141) { if (node.flags & 64) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -25041,7 +25400,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25067,7 +25426,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189) { + if (element.kind !== 190) { elements.push(element); } } @@ -25133,7 +25492,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 145 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 146 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -25146,7 +25505,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 145 + return accessor.kind === 146 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -25155,7 +25514,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 146) { + if (accessorWithTypeAnnotation.kind === 147) { if (accessorWithTypeAnnotation.parent.flags & 64) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -25201,17 +25560,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 215) { + if (node.kind === 216) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 143) { + else if (node.kind === 144) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 215) { + if (node.kind === 216) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 144) { + else if (node.kind === 145) { write("constructor"); } else { @@ -25230,31 +25589,31 @@ var ts; function emitSignatureDeclaration(node) { var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; - if (node.kind === 148 || node.kind === 153) { + if (node.kind === 149 || node.kind === 154) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 149) { + if (node.kind === 150) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 149) { + if (node.kind === 150) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 152 || node.kind === 153; - if (isFunctionTypeOrConstructorType || node.parent.kind === 155) { + var isFunctionTypeOrConstructorType = node.kind === 153 || node.kind === 154; + if (isFunctionTypeOrConstructorType || node.parent.kind === 156) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 144 && !(node.flags & 16)) { + else if (node.kind !== 145 && !(node.flags & 16)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -25265,23 +25624,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 148: + case 149: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 147: + case 148: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 149: + case 150: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 144: case 143: - case 142: if (node.flags & 64) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -25289,7 +25648,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -25302,7 +25661,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 215: + case 216: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -25334,9 +25693,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 152 || - node.parent.kind === 153 || - node.parent.parent.kind === 155) { + if (node.parent.kind === 153 || + node.parent.kind === 154 || + node.parent.parent.kind === 156) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 16)) { @@ -25352,22 +25711,22 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 144: + case 145: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 148: + case 149: return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 147: + case 148: return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + case 144: case 143: - case 142: if (node.parent.flags & 64) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -25375,7 +25734,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216) { + else if (node.parent.parent.kind === 217) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25387,7 +25746,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 215: + case 216: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25398,12 +25757,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 163) { + if (bindingPattern.kind === 164) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 164) { + else if (bindingPattern.kind === 165) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -25414,10 +25773,10 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 189) { + if (bindingElement.kind === 190) { write(" "); } - else if (bindingElement.kind === 165) { + else if (bindingElement.kind === 166) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -25439,39 +25798,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 215: - case 220: - case 223: - case 217: case 216: - case 218: - case 219: - return emitModuleElement(node, isModuleElementVisible(node)); - case 195: - return emitModuleElement(node, isVariableStatementVisible(node)); + case 221: case 224: + case 218: + case 217: + case 219: + case 220: + return emitModuleElement(node, isModuleElementVisible(node)); + case 196: + return emitModuleElement(node, isVariableStatementVisible(node)); + case 225: return emitModuleElement(node, !node.importClause); - case 230: + case 231: return emitExportDeclaration(node); + case 145: case 144: case 143: - case 142: return writeFunctionDeclaration(node); - case 148: - case 147: case 149: + case 148: + case 150: return emitSignatureDeclarationWithJsDocComments(node); - case 145: case 146: + case 147: return emitAccessorDeclaration(node); + case 142: case 141: - case 140: return emitPropertyDeclaration(node); - case 249: - return emitEnumMemberDeclaration(node); - case 229: - return emitExportAssignment(node); case 250: + return emitEnumMemberDeclaration(node); + case 230: + return emitExportAssignment(node); + case 251: return emitSourceFile(node); } } @@ -25798,7 +26157,7 @@ var ts; var decorateHelper = "\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};"; var metadataHelper = "\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; - var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; + var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new P(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.call(thisArg, _arguments)).next());\n });\n};"; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); @@ -25886,6 +26245,7 @@ var ts; var sourceMapData; var isOwnFileEmit; var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; + var setSourceMapWriterEmit = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? changeSourceMapEmit : function (writer) { }; var moduleEmitDelegates = (_a = {}, _a[5] = emitES6Module, _a[2] = emitAMDModule, @@ -25964,19 +26324,19 @@ var ts; } function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_19 = flags === 268435456 ? "_i" : "_n"; - if (isUniqueName(name_19)) { + var name_22 = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name_22)) { tempFlags |= flags; - return name_19; + return name_22; } } while (true) { var count = tempFlags & 268435455; tempFlags++; if (count !== 8 && count !== 13) { - var name_20 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_20)) { - return name_20; + var name_23 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_23)) { + return name_23; } } } @@ -26014,17 +26374,17 @@ var ts; switch (node.kind) { case 69: return makeUniqueName(node.text); + case 221: case 220: - case 219: return generateNameForModuleOrEnum(node); - case 224: - case 230: + case 225: + case 231: return generateNameForImportOrExportDeclaration(node); - case 215: case 216: - case 229: + case 217: + case 230: return generateNameForExportDefault(); - case 188: + case 189: return generateNameForClassExpression(); } } @@ -26264,10 +26624,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 185) { + if (node.template.kind === 186) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 183 + var needsParens = templateSpan.expression.kind === 184 && templateSpan.expression.operatorToken.kind === 24; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -26291,7 +26651,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 174 + var needsParens = templateSpan.expression.kind !== 175 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -26311,11 +26671,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 170: case 171: - return parent.expression === template; case 172: - case 174: + return parent.expression === template; + case 173: + case 175: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -26323,7 +26683,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 183: + case 184: switch (expression.operatorToken.kind) { case 37: case 39: @@ -26335,8 +26695,8 @@ var ts; default: return -1; } - case 186: - case 184: + case 187: + case 185: return -1; default: return 1; @@ -26392,37 +26752,37 @@ var ts; } else { var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 241; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 242; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; - for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 241) { - if (i_1 === 0) { + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].kind === 242) { + if (i === 0) { write("{}, "); } if (haveOpenedObjectLiteral) { write("}"); haveOpenedObjectLiteral = false; } - if (i_1 > 0) { + if (i > 0) { write(", "); } - emit(attrs[i_1].expression); + emit(attrs[i].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 240); + ts.Debug.assert(attrs[i].kind === 241); if (haveOpenedObjectLiteral) { write(", "); } else { haveOpenedObjectLiteral = true; - if (i_1 > 0) { + if (i > 0) { write(", "); } write("{"); } - emitJsxAttribute(attrs[i_1]); + emitJsxAttribute(attrs[i]); } } if (haveOpenedObjectLiteral) @@ -26431,7 +26791,7 @@ var ts; } else { write("{"); - for (var i = 0; i < attrs.length; i++) { + for (var i = 0, n = attrs.length; i < n; i++) { if (i > 0) { write(", "); } @@ -26442,10 +26802,10 @@ var ts; } if (children) { for (var i = 0; i < children.length; i++) { - if (children[i].kind === 242 && !(children[i].expression)) { + if (children[i].kind === 243 && !(children[i].expression)) { continue; } - if (children[i].kind === 238) { + if (children[i].kind === 239) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -26462,11 +26822,11 @@ var ts; write(")"); emitTrailingComments(openingNode); } - if (node.kind === 235) { + if (node.kind === 236) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 236); + ts.Debug.assert(node.kind === 237); emitJsxElement(node); } } @@ -26488,11 +26848,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 241) { + if (attribs[i].kind === 242) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 240); + ts.Debug.assert(attribs[i].kind === 241); emitJsxAttribute(attribs[i]); } } @@ -26500,11 +26860,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 236)) { + if (node.attributes.length > 0 || (node.kind === 237)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 236) { + if (node.kind === 237) { write("/>"); } else { @@ -26523,20 +26883,20 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 235) { + if (node.kind === 236) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 236); + ts.Debug.assert(node.kind === 237); emitJsxOpeningOrSelfClosingElement(node); } } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 165); + ts.Debug.assert(node.kind !== 166); if (node.kind === 9) { emitLiteral(node); } - else if (node.kind === 136) { + else if (node.kind === 137) { if (ts.nodeIsDecorated(node.parent)) { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; @@ -26567,62 +26927,62 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 166: - case 191: - case 183: - case 170: - case 243: - case 136: + case 167: + case 192: case 184: - case 139: - case 177: - case 199: - case 169: - case 229: - case 197: - case 190: - case 201: + case 171: + case 244: + case 137: + case 185: + case 140: + case 178: + case 200: + case 170: + case 230: + case 198: + case 191: case 202: case 203: - case 198: - case 239: - case 236: + case 204: + case 199: + case 240: case 237: - case 241: + case 238: case 242: - case 171: - case 174: - case 182: - case 181: - case 206: - case 248: - case 187: - case 208: + case 243: case 172: - case 192: - case 210: - case 173: - case 178: - case 179: - case 200: - case 207: - case 186: - return true; - case 165: - case 249: - case 138: - case 247: - case 141: - case 213: - return parent.initializer === node; - case 168: - return parent.expression === node; - case 176: case 175: + case 183: + case 182: + case 207: + case 249: + case 188: + case 209: + case 173: + case 193: + case 211: + case 174: + case 179: + case 180: + case 201: + case 208: + case 187: + return true; + case 166: + case 250: + case 139: + case 248: + case 142: + case 214: + return parent.initializer === node; + case 169: + return parent.expression === node; + case 177: + case 176: return parent.body === node; - case 223: + case 224: return parent.moduleReference === node; - case 135: + case 136: return parent.left === node; } return false; @@ -26634,7 +26994,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 250) { + if (container.kind === 251) { if (modulekind !== 5 && modulekind !== 4) { write("exports."); } @@ -26648,15 +27008,15 @@ var ts; if (modulekind !== 5) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 225) { + if (declaration.kind === 226) { write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 228) { + else if (declaration.kind === 229) { write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_21 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); + var name_24 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_24); if (languageVersion === 0 && identifier === "default") { write("[\"default\"]"); } @@ -26685,13 +27045,13 @@ var ts; } function isNameOfNestedRedeclaration(node) { if (languageVersion < 2) { - var parent_6 = node.parent; - switch (parent_6.kind) { - case 165: - case 216: - case 219: - case 213: - return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); + var parent_7 = node.parent; + switch (parent_7.kind) { + case 166: + case 217: + case 220: + case 214: + return parent_7.name === node && resolver.isNestedRedeclaration(parent_7); } } return false; @@ -26699,8 +27059,8 @@ var ts; function emitIdentifier(node) { if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { - var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_22); + var name_25 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_25); return; } } @@ -26800,10 +27160,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 183 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 184 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 184 && node.parent.condition === node) { + else if (node.parent.kind === 185 && node.parent.condition === node) { return true; } return false; @@ -26811,11 +27171,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69: - case 166: - case 168: + case 167: case 169: case 170: - case 174: + case 171: + case 175: return false; } return true; @@ -26832,17 +27192,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 187) { + if (e.kind === 188) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 167) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 187) { + while (i < length && elements[i].kind !== 188) { i++; } write("["); @@ -26865,7 +27225,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 187; + return node.kind === 188; } function emitArrayLiteral(node) { var elements = node.elements; @@ -26926,7 +27286,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 145 || property.kind === 146) { + if (property.kind === 146 || property.kind === 147) { var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { continue; @@ -26977,13 +27337,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 247) { + if (property.kind === 248) { emit(property.initializer); } - else if (property.kind === 248) { + else if (property.kind === 249) { emitExpressionIdentifier(property.name); } - else if (property.kind === 143) { + else if (property.kind === 144) { emitFunctionDeclaration(property); } else { @@ -27015,7 +27375,7 @@ var ts; var numProperties = properties.length; var numInitialNonComputedProperties = numProperties; for (var i = 0, n = properties.length; i < n; i++) { - if (properties[i].name.kind === 136) { + if (properties[i].name.kind === 137) { numInitialNonComputedProperties = i; break; } @@ -27029,35 +27389,35 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(183, startsOnNewLine); + var result = ts.createSynthesizedNode(184, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(168); + var result = ts.createSynthesizedNode(169); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(169); + var result = ts.createSynthesizedNode(170); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; } function parenthesizeForAccess(expr) { - while (expr.kind === 173 || expr.kind === 191) { + while (expr.kind === 174 || expr.kind === 192) { expr = expr.expression; } if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 171 && + expr.kind !== 172 && expr.kind !== 8) { return expr; } - var node = ts.createSynthesizedNode(174); + var node = ts.createSynthesizedNode(175); node.expression = expr; return node; } @@ -27084,7 +27444,7 @@ var ts; } function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 250; + return container && container.kind !== 251; } function emitShorthandPropertyAssignment(node) { writeTextOfNode(currentText, node.name); @@ -27102,7 +27462,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 168 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 169 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -27113,7 +27473,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 168 || node.kind === 169 + return node.kind === 169 || node.kind === 170 ? resolver.getConstantValue(node) : undefined; } @@ -27193,7 +27553,7 @@ var ts; } emitExpressionIdentifier(node); break; - case 135: + case 136: emitQualifiedNameAsExpression(node, useFallback); break; default: @@ -27211,10 +27571,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 187; }); + return ts.forEach(elements, function (e) { return e.kind === 188; }); } function skipParentheses(node) { - while (node.kind === 174 || node.kind === 173 || node.kind === 191) { + while (node.kind === 175 || node.kind === 174 || node.kind === 192) { node = node.expression; } return node; @@ -27235,12 +27595,12 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 168) { + if (expr.kind === 169) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 169) { + else if (expr.kind === 170) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); @@ -27281,7 +27641,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 168 && node.expression.expression.kind === 95; + superCall = node.expression.kind === 169 && node.expression.expression.kind === 95; } if (superCall && languageVersion < 2) { write(".call("); @@ -27332,21 +27692,21 @@ var ts; } } function emitParenExpression(node) { - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176) { - if (node.expression.kind === 173 || node.expression.kind === 191) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 177) { + if (node.expression.kind === 174 || node.expression.kind === 192) { var operand = node.expression.expression; - while (operand.kind === 173 || operand.kind === 191) { + while (operand.kind === 174 || operand.kind === 192) { operand = operand.expression; } - if (operand.kind !== 181 && + if (operand.kind !== 182 && + operand.kind !== 180 && operand.kind !== 179 && operand.kind !== 178 && - operand.kind !== 177 && - operand.kind !== 182 && - operand.kind !== 171 && - !(operand.kind === 170 && node.parent.kind === 171) && - !(operand.kind === 175 && node.parent.kind === 170) && - !(operand.kind === 8 && node.parent.kind === 168)) { + operand.kind !== 183 && + operand.kind !== 172 && + !(operand.kind === 171 && node.parent.kind === 172) && + !(operand.kind === 176 && node.parent.kind === 171) && + !(operand.kind === 8 && node.parent.kind === 169)) { emit(operand); return; } @@ -27375,7 +27735,7 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 || node.parent.kind === 165); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 214 || node.parent.kind === 166); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); @@ -27390,7 +27750,7 @@ var ts; write("\", "); } write(ts.tokenToString(node.operator)); - if (node.operand.kind === 181) { + if (node.operand.kind === 182) { var operand = node.operand; if (node.operator === 35 && (operand.operator === 35 || operand.operator === 41)) { write(" "); @@ -27433,10 +27793,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 250) { + if (current.kind === 251) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 221) { + else if (ts.isFunctionLike(current) || current.kind === 222) { return false; } else { @@ -27452,14 +27812,14 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(169, false); + synthesizedLHS = ts.createSynthesizedNode(170, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 && leftHandSideExpression.argumentExpression.kind !== 9) { var tempArgumentExpression = createAndRecordTempVariable(268435456); synthesizedLHS.argumentExpression = tempArgumentExpression; - emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, true); + emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, true, leftHandSideExpression.expression); } else { synthesizedLHS.argumentExpression = leftHandSideExpression.argumentExpression; @@ -27469,7 +27829,7 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(168, false); + synthesizedLHS = ts.createSynthesizedNode(169, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; @@ -27497,8 +27857,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 && node.operatorToken.kind === 56 && - (node.left.kind === 167 || node.left.kind === 166)) { - emitDestructuring(node, node.parent.kind === 197); + (node.left.kind === 168 || node.left.kind === 167)) { + emitDestructuring(node, node.parent.kind === 198); } else { var exportChanged = node.operatorToken.kind >= 56 && @@ -27550,7 +27910,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 194) { + if (node && node.kind === 195) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -27564,12 +27924,12 @@ var ts; } emitToken(15, node.pos); increaseIndent(); - if (node.kind === 221) { - ts.Debug.assert(node.parent.kind === 220); + if (node.kind === 222) { + ts.Debug.assert(node.parent.kind === 221); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 221) { + if (node.kind === 222) { emitTempDeclarations(true); } decreaseIndent(); @@ -27577,7 +27937,7 @@ var ts; emitToken(16, node.statements.end); } function emitEmbeddedStatement(node) { - if (node.kind === 194) { + if (node.kind === 195) { write(" "); emit(node); } @@ -27589,7 +27949,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 176); + emitParenthesizedIf(node.expression, node.expression.kind === 177); write(";"); } function emitIfStatement(node) { @@ -27602,7 +27962,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80, node.thenStatement.end); - if (node.elseStatement.kind === 198) { + if (node.elseStatement.kind === 199) { write(" "); emit(node.elseStatement); } @@ -27622,7 +27982,7 @@ var ts; else { emitNormalLoopBody(node, true); } - if (node.statement.kind === 194) { + if (node.statement.kind === 195) { write(" "); } else { @@ -27646,7 +28006,7 @@ var ts; emitNormalLoopBody(node, true); } } - function tryEmitStartOfVariableDeclarationList(decl, startPos) { + function tryEmitStartOfVariableDeclarationList(decl) { if (shouldHoistVariable(decl, true)) { return false; } @@ -27657,31 +28017,20 @@ var ts; } return false; } - var tokenKind = 102; + emitStart(decl); if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 108; + write("let "); } else if (ts.isConst(decl)) { - tokenKind = 74; + write("const "); + } + else { + write("var "); } - } - if (startPos !== undefined) { - emitToken(tokenKind, startPos); - write(" "); } else { - switch (tokenKind) { - case 102: - write("var "); - break; - case 108: - write("let "); - break; - case 74: - write("const "); - break; - } + write("var "); } return true; } @@ -27713,7 +28062,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 209) { + if (node.parent.kind === 210) { emitLabelAndColon(node.parent); } loopEmitter(node, loop); @@ -27723,10 +28072,11 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 201: case 202: case 203: - if (node.initializer.kind === 214) { + case 204: + var initializer = node.initializer; + if (initializer && initializer.kind === 215) { loopInitializer = node.initializer; } break; @@ -27739,7 +28089,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 194; + var bodyIsBlock = node.statement.kind === 195; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -27836,7 +28186,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 194) { + else if (node.statement.kind === 195) { emitLines(node.statement.statements); } else { @@ -27932,9 +28282,9 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer && node.initializer.kind === 214) { + if (node.initializer && node.initializer.kind === 215) { var variableDeclarationList = node.initializer; - var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList); if (startIsEmitted) { emitCommaList(variableDeclarationList.declarations); } @@ -27958,7 +28308,7 @@ var ts; } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 203) { + if (languageVersion < 2 && node.kind === 204) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -27969,17 +28319,17 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + tryEmitStartOfVariableDeclarationList(variableDeclarationList); emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 202) { + if (node.kind === 203) { write(" in "); } else { @@ -28015,24 +28365,24 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); write("; "); - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write(" < "); emitNodeWithCommentsAndWithoutSourcemap(rhsReference); write(".length"); - emitEnd(node.initializer); + emitEnd(node.expression); write("; "); - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write("++"); - emitEnd(node.initializer); + emitEnd(node.expression); emitToken(18, node.expression.end); write(" {"); writeLine(); increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -28054,7 +28404,7 @@ var ts; } else { var assignmentExpression = createBinaryExpression(node.initializer, 56, rhsIterationValue, false); - if (node.initializer.kind === 166 || node.initializer.kind === 167) { + if (node.initializer.kind === 167 || node.initializer.kind === 168) { emitDestructuring(assignmentExpression, true, undefined); } else { @@ -28076,12 +28426,12 @@ var ts; } function emitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 205 ? 2 : 4; + var jump = node.kind === 206 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 205) { + if (node.kind === 206) { convertedLoopState.nonLocalJumps |= 2; write("return \"break\";"); } @@ -28092,7 +28442,7 @@ var ts; } else { var labelMarker; - if (node.kind === 205) { + if (node.kind === 206) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, true, node.label.text, labelMarker); } @@ -28105,7 +28455,7 @@ var ts; return; } } - emitToken(node.kind === 205 ? 70 : 75, node.pos); + emitToken(node.kind === 206 ? 70 : 75, node.pos); emitOptional(" ", node.label); write(";"); } @@ -28170,7 +28520,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 243) { + if (node.kind === 244) { write("case "); emit(node.expression); write(":"); @@ -28239,7 +28589,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 220); + } while (node && node.kind !== 221); return node; } function emitContainingModuleName(node) { @@ -28264,13 +28614,13 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8); zero.text = "0"; - var result = ts.createSynthesizedNode(179); + var result = ts.createSynthesizedNode(180); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 250) { - ts.Debug.assert(!!(node.flags & 512) || node.kind === 229); + if (node.parent.kind === 251) { + ts.Debug.assert(!!(node.flags & 512) || node.kind === 230); if (modulekind === 1 || modulekind === 2 || modulekind === 3) { if (!isEs6Module) { if (languageVersion !== 0) { @@ -28355,7 +28705,7 @@ var ts; emitEnd(specifier.name); write(";"); } - function emitAssignment(name, value, shouldEmitCommaBeforeAssignment) { + function emitAssignment(name, value, shouldEmitCommaBeforeAssignment, nodeForSourceMap) { if (shouldEmitCommaBeforeAssignment) { write(", "); } @@ -28365,63 +28715,75 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 || name.parent.kind === 165); - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } - write(" = "); - emit(value); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 214 || name.parent.kind === 166); + emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap); + withTemporaryNoSourceMap(function () { + if (isVariableDeclarationOrBindingElement) { + emitModuleMemberName(name.parent); + } + else { + emit(name); + } + write(" = "); + emit(value); + }); + emitEnd(nodeForSourceMap, true); if (exportChanged) { write(")"); } } - function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment) { + function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment, sourceMapNode) { var identifier = createTempVariable(0); if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); + emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment, sourceMapNode || expression.parent); return identifier; } + function isFirstVariableDeclaration(root) { + return root.kind === 214 && + root.parent.kind === 215 && + root.parent.declarations[0] === root; + } function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; var canDefineTempVariablesInPlace = false; - if (root.kind === 213) { + if (root.kind === 214) { var isExported = ts.getCombinedNodeFlags(root) & 2; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; } - else if (root.kind === 138) { + else if (root.kind === 139) { canDefineTempVariablesInPlace = true; } - if (root.kind === 183) { + if (root.kind === 184) { emitAssignmentExpression(root); } else { ts.Debug.assert(!isAssignmentExpressionStatement); + if (isFirstVariableDeclaration(root)) { + sourceMap.changeEmitSourcePos(); + } emitBindingElement(root, value); } - function ensureIdentifier(expr, reuseIdentifierExpressions) { + function ensureIdentifier(expr, reuseIdentifierExpressions, sourceMapNode) { if (expr.kind === 69 && reuseIdentifierExpressions) { return expr; } - var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0); + var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0, sourceMapNode); emitCount++; return identifier; } - function createDefaultValueCheck(value, defaultValue) { - value = ensureIdentifier(value, true); - var equals = ts.createSynthesizedNode(183); + function createDefaultValueCheck(value, defaultValue, sourceMapNode) { + value = ensureIdentifier(value, true, sourceMapNode); + var equals = ts.createSynthesizedNode(184); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(184); + var cond = ts.createSynthesizedNode(185); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53); cond.whenTrue = whenTrue; @@ -28436,9 +28798,9 @@ var ts; } function createPropertyAccessForDestructuringProperty(object, propName) { var index; - var nameIsComputed = propName.kind === 136; + var nameIsComputed = propName.kind === 137; if (nameIsComputed) { - index = ensureIdentifier(propName.expression, false); + index = ensureIdentifier(propName.expression, false, propName); } else { index = ts.createSynthesizedNode(propName.kind); @@ -28449,7 +28811,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(170); + var call = ts.createSynthesizedNode(171); var sliceIdentifier = ts.createSynthesizedNode(69); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -28457,56 +28819,56 @@ var ts; call.arguments[0] = createNumericLiteral(sliceIndex); return call; } - function emitObjectLiteralAssignment(target, value) { + function emitObjectLiteralAssignment(target, value, sourceMapNode) { var properties = target.properties; if (properties.length !== 1) { - value = ensureIdentifier(value, true); + value = ensureIdentifier(value, true, sourceMapNode); } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 247 || p.kind === 248) { + if (p.kind === 248 || p.kind === 249) { var propName = p.name; - var target_1 = p.kind === 248 ? p : p.initializer || propName; - emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); + var target_1 = p.kind === 249 ? p : p.initializer || propName; + emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName), p); } } } - function emitArrayLiteralAssignment(target, value) { + function emitArrayLiteralAssignment(target, value, sourceMapNode) { var elements = target.elements; if (elements.length !== 1) { - value = ensureIdentifier(value, true); + value = ensureIdentifier(value, true, sourceMapNode); } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189) { - if (e.kind !== 187) { - emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); + if (e.kind !== 190) { + if (e.kind !== 188) { + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)), e); } else if (i === elements.length - 1) { - emitDestructuringAssignment(e.expression, createSliceCall(value, i)); + emitDestructuringAssignment(e.expression, createSliceCall(value, i), e); } } } } - function emitDestructuringAssignment(target, value) { - if (target.kind === 248) { + function emitDestructuringAssignment(target, value, sourceMapNode) { + if (target.kind === 249) { if (target.objectAssignmentInitializer) { - value = createDefaultValueCheck(value, target.objectAssignmentInitializer); + value = createDefaultValueCheck(value, target.objectAssignmentInitializer, sourceMapNode); } target = target.name; } - else if (target.kind === 183 && target.operatorToken.kind === 56) { - value = createDefaultValueCheck(value, target.right); + else if (target.kind === 184 && target.operatorToken.kind === 56) { + value = createDefaultValueCheck(value, target.right, sourceMapNode); target = target.left; } - if (target.kind === 167) { - emitObjectLiteralAssignment(target, value); + if (target.kind === 168) { + emitObjectLiteralAssignment(target, value, sourceMapNode); } - else if (target.kind === 166) { - emitArrayLiteralAssignment(target, value); + else if (target.kind === 167) { + emitArrayLiteralAssignment(target, value, sourceMapNode); } else { - emitAssignment(target, value, emitCount > 0); + emitAssignment(target, value, emitCount > 0, sourceMapNode); emitCount++; } } @@ -28517,24 +28879,24 @@ var ts; emit(value); } else if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + emitDestructuringAssignment(target, value, ts.nodeIsSynthesized(root) ? target : root); } else { - if (root.parent.kind !== 174) { + if (root.parent.kind !== 175) { write("("); } - value = ensureIdentifier(value, true); - emitDestructuringAssignment(target, value); + value = ensureIdentifier(value, true, root); + emitDestructuringAssignment(target, value, root); write(", "); emit(value); - if (root.parent.kind !== 174) { + if (root.parent.kind !== 175) { write(")"); } } } function emitBindingElement(target, value) { if (target.initializer) { - value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; + value = value ? createDefaultValueCheck(value, target.initializer, target) : target.initializer; } else if (!value) { value = createVoidZero(); @@ -28544,15 +28906,15 @@ var ts; var elements = pattern.elements; var numElements = elements.length; if (numElements !== 1) { - value = ensureIdentifier(value, numElements !== 0); + value = ensureIdentifier(value, numElements !== 0, target); } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 163) { + if (pattern.kind === 164) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 189) { + else if (element.kind !== 190) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } @@ -28563,7 +28925,7 @@ var ts; } } else { - emitAssignment(target.name, value, emitCount > 0); + emitAssignment(target.name, value, emitCount > 0, target); emitCount++; } } @@ -28584,8 +28946,8 @@ var ts; var isLetDefinedInLoop = (resolver.getNodeCheckFlags(node) & 16384) && (getCombinedFlagsForIdentifier(node.name) & 8192); if (isLetDefinedInLoop && - node.parent.parent.kind !== 202 && - node.parent.parent.kind !== 203) { + node.parent.parent.kind !== 203 && + node.parent.parent.kind !== 204) { initializer = createVoidZero(); } } @@ -28603,7 +28965,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 189) { + if (node.kind === 190) { return; } var name = node.name; @@ -28615,7 +28977,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 213 && node.parent.kind !== 165)) { + if (!node.parent || (node.parent.kind !== 214 && node.parent.kind !== 166)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -28623,7 +28985,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2) && modulekind === 5 && - node.parent.kind === 250; + node.parent.kind === 251; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -28668,12 +29030,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name_23 = createTempVariable(0); + var name_26 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_23); - emit(name_23); + tempParameters.push(name_26); + emit(name_26); } else { emit(node.name); @@ -28772,12 +29134,12 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 145 ? "get " : "set "); + write(node.kind === 146 ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 176 && languageVersion >= 2; + return node.kind === 177 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { @@ -28788,10 +29150,10 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 175) { + if (node.kind === 176) { return !!node.name; } - if (node.kind === 215) { + if (node.kind === 216) { return !!node.name || modulekind !== 5; } } @@ -28800,12 +29162,12 @@ var ts; return emitCommentsOnNotEmittedNode(node); } var kind = node.kind, parent = node.parent; - if (kind !== 143 && - kind !== 142 && + if (kind !== 144 && + kind !== 143 && parent && - parent.kind !== 247 && - parent.kind !== 170 && - parent.kind !== 166) { + parent.kind !== 248 && + parent.kind !== 171 && + parent.kind !== 167) { emitLeadingComments(node); } emitStart(node); @@ -28826,11 +29188,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 && kind === 215 && parent === currentSourceFile && node.name) { + if (modulekind !== 5 && kind === 216 && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (kind !== 143 && kind !== 142) { + if (kind !== 144 && kind !== 143) { emitTrailingComments(node); } } @@ -28862,7 +29224,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 176; + var isArrowFunction = node.kind === 177; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096) !== 0; if (!isArrowFunction) { write(" {"); @@ -28903,7 +29265,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 194) { + if (node.body.kind === 195) { emitBlockFunctionBody(node, node.body); } else { @@ -28955,10 +29317,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 173) { + while (current.kind === 174) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 167); + emitParenthesizedIf(body, current.kind === 168); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -29028,9 +29390,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 197) { + if (statement && statement.kind === 198) { var expr = statement.expression; - if (expr && expr.kind === 170) { + if (expr && expr.kind === 171) { var func = expr.expression; if (func && func.kind === 95) { return statement; @@ -29061,7 +29423,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(memberName); write("]"); } - else if (memberName.kind === 136) { + else if (memberName.kind === 137) { emitComputedPropertyName(memberName); } else { @@ -29073,7 +29435,7 @@ var ts; var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 141 && isStatic === ((member.flags & 64) !== 0) && member.initializer) { + if (member.kind === 142 && isStatic === ((member.flags & 64) !== 0) && member.initializer) { properties.push(member); } } @@ -29113,11 +29475,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 193) { + if (member.kind === 194) { writeLine(); write(";"); } - else if (member.kind === 143 || node.kind === 142) { + else if (member.kind === 144 || node.kind === 143) { if (!member.body) { return emitCommentsOnNotEmittedNode(member); } @@ -29134,7 +29496,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 145 || member.kind === 146) { + else if (member.kind === 146 || member.kind === 147) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -29184,22 +29546,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 143 || node.kind === 142) && !member.body) { + if ((member.kind === 144 || node.kind === 143) && !member.body) { emitCommentsOnNotEmittedNode(member); } - else if (member.kind === 143 || - member.kind === 145 || - member.kind === 146) { + else if (member.kind === 144 || + member.kind === 146 || + member.kind === 147) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 64) { write("static "); } - if (member.kind === 145) { + if (member.kind === 146) { write("get "); } - else if (member.kind === 146) { + else if (member.kind === 147) { write("set "); } if (member.asteriskToken) { @@ -29210,7 +29572,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 193) { + else if (member.kind === 194) { writeLine(); write(";"); } @@ -29235,10 +29597,10 @@ var ts; function emitConstructorWorker(node, baseTypeElement) { var hasInstancePropertyWithInitializer = false; ts.forEach(node.members, function (member) { - if (member.kind === 144 && !member.body) { + if (member.kind === 145 && !member.body) { emitCommentsOnNotEmittedNode(member); } - if (member.kind === 141 && member.initializer && (member.flags & 64) === 0) { + if (member.kind === 142 && member.initializer && (member.flags & 64) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -29342,7 +29704,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 216) { + if (node.kind === 217) { if (thisNodeIsDecorated) { if (isES6ExportedDeclaration(node) && !(node.flags & 512)) { write("export "); @@ -29359,7 +29721,7 @@ var ts; } } var staticProperties = getInitializedProperties(node, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 189; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0); @@ -29422,7 +29784,7 @@ var ts; write(";"); } } - else if (node.parent.kind !== 250) { + else if (node.parent.kind !== 251) { writeLine(); emitStart(node); emitModuleMemberName(node); @@ -29434,7 +29796,7 @@ var ts; } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 216) { + if (node.kind === 217) { if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); } @@ -29494,11 +29856,11 @@ var ts; emit(baseTypeNode.expression); } write("))"); - if (node.kind === 216) { + if (node.kind === 217) { write(";"); } emitEnd(node); - if (node.kind === 216) { + if (node.kind === 217) { emitExportMemberAssignment(node); } } @@ -29565,7 +29927,7 @@ var ts; } else { decorators = member.decorators; - if (member.kind === 143) { + if (member.kind === 144) { functionLikeMember = member; } } @@ -29591,7 +29953,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); if (languageVersion > 0) { - if (member.kind !== 141) { + if (member.kind !== 142) { write(", null"); } else { @@ -29626,45 +29988,45 @@ var ts; } function shouldEmitTypeMetadata(node) { switch (node.kind) { - case 143: - case 145: + case 144: case 146: - case 141: + case 147: + case 142: return true; } return false; } function shouldEmitReturnTypeMetadata(node) { switch (node.kind) { - case 143: + case 144: return true; } return false; } function shouldEmitParamTypesMetadata(node) { switch (node.kind) { - case 216: - case 143: - case 146: + case 217: + case 144: + case 147: return true; } return false; } function emitSerializedTypeOfNode(node) { switch (node.kind) { - case 216: + case 217: write("Function"); return; - case 141: + case 142: emitSerializedTypeNode(node.type); return; - case 138: - emitSerializedTypeNode(node.type); - return; - case 145: + case 139: emitSerializedTypeNode(node.type); return; case 146: + emitSerializedTypeNode(node.type); + return; + case 147: emitSerializedTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); return; } @@ -29680,23 +30042,23 @@ var ts; case 103: write("void 0"); return; - case 160: + case 161: emitSerializedTypeNode(node.type); return; - case 152: case 153: + case 154: write("Function"); return; - case 156: case 157: + case 158: write("Array"); return; - case 150: + case 151: case 120: write("Boolean"); return; case 130: - case 162: + case 163: write("String"); return; case 128: @@ -29705,15 +30067,15 @@ var ts; case 131: write("Symbol"); return; - case 151: + case 152: emitSerializedTypeReferenceNode(node); return; - case 154: case 155: - case 158: + case 156: case 159: + case 160: case 117: - case 161: + case 162: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -29777,7 +30139,7 @@ var ts; function emitSerializedParameterTypesOfNode(node) { if (node) { var valueDeclaration; - if (node.kind === 216) { + if (node.kind === 217) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -29793,10 +30155,10 @@ var ts; } if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 156) { + if (parameterType.kind === 157) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 151 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 152 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -29868,7 +30230,7 @@ var ts; } if (!shouldHoistDeclarationInSystemJsModule(node)) { var isES6ExportedEnum = isES6ExportedDeclaration(node); - if (!(node.flags & 2) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219))) { + if (!(node.flags & 2) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220))) { emitStart(node); if (isES6ExportedEnum) { write("export "); @@ -29948,7 +30310,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 220) { + if (moduleDeclaration.body.kind === 221) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -29971,7 +30333,7 @@ var ts; var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { var isES6ExportedNamespace = isES6ExportedDeclaration(node); - if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220)) { + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 221)) { emitStart(node); if (isES6ExportedNamespace) { write("export "); @@ -29989,7 +30351,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 221) { + if (node.body.kind === 222) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -30060,16 +30422,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 223) { + if (node.kind === 224) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 227) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 224 && node.importClause && !!node.importClause.name; + return node.kind === 225 && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -30096,7 +30458,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 226) { + if (node.importClause.namedBindings.kind === 227) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -30122,7 +30484,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 223 && (node.flags & 2) !== 0; + var isExportedImport = node.kind === 224 && (node.flags & 2) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2) { emitLeadingComments(node); @@ -30134,7 +30496,7 @@ var ts; write(" = "); } else { - var isNakedImport = 224 && !node.importClause; + var isNakedImport = 225 && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -30301,8 +30663,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 215 && - expression.kind !== 216) { + if (expression.kind !== 216 && + expression.kind !== 217) { write(";"); } emitEnd(node); @@ -30339,18 +30701,18 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 224: + case 225: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { externalImports.push(node); } break; - case 223: - if (node.moduleReference.kind === 234 && resolver.isReferencedAliasDeclaration(node)) { + case 224: + if (node.moduleReference.kind === 235 && resolver.isReferencedAliasDeclaration(node)) { externalImports.push(node); } break; - case 230: + case 231: if (node.moduleSpecifier) { if (!node.exportClause) { if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) { @@ -30365,12 +30727,12 @@ var ts; else { for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_24 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); + var name_27 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_27] || (exportSpecifiers[name_27] = [])).push(specifier); } } break; - case 229: + case 230: if (node.isExportEquals && !exportEquals) { exportEquals = node; } @@ -30395,18 +30757,18 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 224 && node.importClause) { + if (node.kind === 225 && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 230 && node.moduleSpecifier) { + if (node.kind === 231 && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { if (emitRelativePathAsModuleName) { - var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_25) { - return "\"" + name_25 + "\""; + var name_28 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_28) { + return "\"" + name_28 + "\""; } } var moduleName = ts.getExternalModuleName(importNode); @@ -30423,8 +30785,8 @@ var ts; var started = false; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; - var skipNode = importNode.kind === 230 || - (importNode.kind === 224 && !importNode.importClause); + var skipNode = importNode.kind === 231 || + (importNode.kind === 225 && !importNode.importClause); if (skipNode) { continue; } @@ -30449,7 +30811,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 230 && externalImport.exportClause) { + if (externalImport.kind === 231 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -30478,7 +30840,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 230) { + if (externalImport.kind !== 231) { continue; } var exportDecl = externalImport; @@ -30552,11 +30914,11 @@ var ts; var seen = {}; for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_26 = local.kind === 69 + var name_29 = local.kind === 69 ? local : local.name; - if (name_26) { - var text = ts.unescapeIdentifier(name_26.text); + if (name_29) { + var text = ts.unescapeIdentifier(name_29.text); if (ts.hasProperty(seen, text)) { continue; } @@ -30567,7 +30929,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 216 || local.kind === 220 || local.kind === 219) { + if (local.kind === 217 || local.kind === 221 || local.kind === 220) { emitDeclarationName(local); } else { @@ -30601,21 +30963,21 @@ var ts; if (node.flags & 4) { return; } - if (node.kind === 215) { + if (node.kind === 216) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 216) { + if (node.kind === 217) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 219) { + if (node.kind === 220) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -30624,7 +30986,7 @@ var ts; } return; } - if (node.kind === 220) { + if (node.kind === 221) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -30633,17 +30995,17 @@ var ts; } return; } - if (node.kind === 213 || node.kind === 165) { + if (node.kind === 214 || node.kind === 166) { if (shouldHoistVariable(node, false)) { - var name_27 = node.name; - if (name_27.kind === 69) { + var name_30 = node.name; + if (name_30.kind === 69) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_27); + hoistedVars.push(name_30); } else { - ts.forEachChild(name_27, visit); + ts.forEachChild(name_30, visit); } } return; @@ -30669,7 +31031,7 @@ var ts; return false; } return (ts.getCombinedNodeFlags(node) & 24576) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 250; + ts.getEnclosingBlockScopeContainer(node).kind === 251; } function isCurrentFileSystemExternalModule() { return modulekind === 4 && isCurrentFileExternalModule; @@ -30707,29 +31069,29 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 224: + case 225: if (!entry.importClause) { break; } - case 223: + case 224: ts.Debug.assert(importVariableName !== ""); writeLine(); write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 230: + case 231: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { writeLine(); write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { - if (i_2 !== 0) { + for (var i_1 = 0, len = entry.exportClause.elements.length; i_1 < len; i_1++) { + if (i_1 !== 0) { write(","); writeLine(); } - var e = entry.exportClause.elements[i_2]; + var e = entry.exportClause.elements[i_1]; write("\""); emitNodeWithCommentsAndWithoutSourcemap(e.name); write("\": " + parameterName + "[\""); @@ -30761,10 +31123,10 @@ var ts; for (var i = startIndex; i < node.statements.length; i++) { var statement = node.statements[i]; switch (statement.kind) { - case 215: - case 224: + case 216: + case 225: continue; - case 230: + case 231: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -30772,7 +31134,7 @@ var ts; } } continue; - case 223: + case 224: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { continue; } @@ -31088,22 +31450,22 @@ var ts; } function emitEmitHelpers(node) { if (!compilerOptions.noEmitHelpers) { - if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { + if ((languageVersion < 2) && (!extendsEmitted && node.flags & 4194304)) { writeLines(extendsHelper); extendsEmitted = true; } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 16) { + if (!decorateEmitted && node.flags & 8388608) { writeLines(decorateHelper); if (compilerOptions.emitDecoratorMetadata) { writeLines(metadataHelper); } decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 32) { + if (!paramEmitted && node.flags & 16777216) { writeLines(paramHelper); paramEmitted = true; } - if (!awaiterEmitted && resolver.getNodeCheckFlags(node) & 64) { + if (!awaiterEmitted && node.flags & 33554432) { writeLines(awaiterHelper); awaiterEmitted = true; } @@ -31171,30 +31533,43 @@ var ts; emitJavaScriptWorker(node); } } + function changeSourceMapEmit(writer) { + sourceMap = writer; + emitStart = writer.emitStart; + emitEnd = writer.emitEnd; + emitPos = writer.emitPos; + setSourceFile = writer.setSourceFile; + } + function withTemporaryNoSourceMap(callback) { + var prevSourceMap = sourceMap; + setSourceMapWriterEmit(ts.getNullSourceMapWriter()); + callback(); + setSourceMapWriterEmit(prevSourceMap); + } function isSpecializedCommentHandling(node) { switch (node.kind) { - case 217: - case 215: - case 224: - case 223: case 218: - case 229: + case 216: + case 225: + case 224: + case 219: + case 230: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 195: + case 196: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 220: + case 221: return shouldEmitModuleDeclaration(node); - case 219: + case 220: return shouldEmitEnumDeclaration(node); } ts.Debug.assert(!isSpecializedCommentHandling(node)); - if (node.kind !== 194 && + if (node.kind !== 195 && node.parent && - node.parent.kind === 176 && + node.parent.kind === 177 && node.parent.body === node && compilerOptions.target <= 1) { return false; @@ -31205,13 +31580,13 @@ var ts; switch (node.kind) { case 69: return emitIdentifier(node); - case 138: + case 139: return emitParameter(node); + case 144: case 143: - case 142: return emitMethod(node); - case 145: case 146: + case 147: return emitAccessor(node); case 97: return emitThis(node); @@ -31231,142 +31606,142 @@ var ts; case 13: case 14: return emitLiteral(node); - case 185: - return emitTemplateExpression(node); - case 192: - return emitTemplateSpan(node); - case 235: - case 236: - return emitJsxElement(node); - case 238: - return emitJsxText(node); - case 242: - return emitJsxExpression(node); - case 135: - return emitQualifiedName(node); - case 163: - return emitObjectBindingPattern(node); - case 164: - return emitArrayBindingPattern(node); - case 165: - return emitBindingElement(node); - case 166: - return emitArrayLiteral(node); - case 167: - return emitObjectLiteral(node); - case 247: - return emitPropertyAssignment(node); - case 248: - return emitShorthandPropertyAssignment(node); - case 136: - return emitComputedPropertyName(node); - case 168: - return emitPropertyAccess(node); - case 169: - return emitIndexedAccess(node); - case 170: - return emitCallExpression(node); - case 171: - return emitNewExpression(node); - case 172: - return emitTaggedTemplateExpression(node); - case 173: - return emit(node.expression); - case 191: - return emit(node.expression); - case 174: - return emitParenExpression(node); - case 215: - case 175: - case 176: - return emitFunctionDeclaration(node); - case 177: - return emitDeleteExpression(node); - case 178: - return emitTypeOfExpression(node); - case 179: - return emitVoidExpression(node); - case 180: - return emitAwaitExpression(node); - case 181: - return emitPrefixUnaryExpression(node); - case 182: - return emitPostfixUnaryExpression(node); - case 183: - return emitBinaryExpression(node); - case 184: - return emitConditionalExpression(node); - case 187: - return emitSpreadElementExpression(node); case 186: - return emitYieldExpression(node); - case 189: - return; - case 194: - case 221: - return emitBlock(node); - case 195: - return emitVariableStatement(node); - case 196: - return write(";"); - case 197: - return emitExpressionStatement(node); - case 198: - return emitIfStatement(node); - case 199: - return emitDoStatement(node); - case 200: - return emitWhileStatement(node); - case 201: - return emitForStatement(node); - case 203: - case 202: - return emitForInOrForOfStatement(node); - case 204: - case 205: - return emitBreakOrContinueStatement(node); - case 206: - return emitReturnStatement(node); - case 207: - return emitWithStatement(node); - case 208: - return emitSwitchStatement(node); + return emitTemplateExpression(node); + case 193: + return emitTemplateSpan(node); + case 236: + case 237: + return emitJsxElement(node); + case 239: + return emitJsxText(node); case 243: - case 244: - return emitCaseOrDefaultClause(node); - case 209: - return emitLabeledStatement(node); - case 210: - return emitThrowStatement(node); - case 211: - return emitTryStatement(node); - case 246: - return emitCatchClause(node); - case 212: - return emitDebuggerStatement(node); - case 213: - return emitVariableDeclaration(node); - case 188: - return emitClassExpression(node); - case 216: - return emitClassDeclaration(node); - case 217: - return emitInterfaceDeclaration(node); - case 219: - return emitEnumDeclaration(node); + return emitJsxExpression(node); + case 136: + return emitQualifiedName(node); + case 164: + return emitObjectBindingPattern(node); + case 165: + return emitArrayBindingPattern(node); + case 166: + return emitBindingElement(node); + case 167: + return emitArrayLiteral(node); + case 168: + return emitObjectLiteral(node); + case 248: + return emitPropertyAssignment(node); case 249: - return emitEnumMember(node); + return emitShorthandPropertyAssignment(node); + case 137: + return emitComputedPropertyName(node); + case 169: + return emitPropertyAccess(node); + case 170: + return emitIndexedAccess(node); + case 171: + return emitCallExpression(node); + case 172: + return emitNewExpression(node); + case 173: + return emitTaggedTemplateExpression(node); + case 174: + return emit(node.expression); + case 192: + return emit(node.expression); + case 175: + return emitParenExpression(node); + case 216: + case 176: + case 177: + return emitFunctionDeclaration(node); + case 178: + return emitDeleteExpression(node); + case 179: + return emitTypeOfExpression(node); + case 180: + return emitVoidExpression(node); + case 181: + return emitAwaitExpression(node); + case 182: + return emitPrefixUnaryExpression(node); + case 183: + return emitPostfixUnaryExpression(node); + case 184: + return emitBinaryExpression(node); + case 185: + return emitConditionalExpression(node); + case 188: + return emitSpreadElementExpression(node); + case 187: + return emitYieldExpression(node); + case 190: + return; + case 195: + case 222: + return emitBlock(node); + case 196: + return emitVariableStatement(node); + case 197: + return write(";"); + case 198: + return emitExpressionStatement(node); + case 199: + return emitIfStatement(node); + case 200: + return emitDoStatement(node); + case 201: + return emitWhileStatement(node); + case 202: + return emitForStatement(node); + case 204: + case 203: + return emitForInOrForOfStatement(node); + case 205: + case 206: + return emitBreakOrContinueStatement(node); + case 207: + return emitReturnStatement(node); + case 208: + return emitWithStatement(node); + case 209: + return emitSwitchStatement(node); + case 244: + case 245: + return emitCaseOrDefaultClause(node); + case 210: + return emitLabeledStatement(node); + case 211: + return emitThrowStatement(node); + case 212: + return emitTryStatement(node); + case 247: + return emitCatchClause(node); + case 213: + return emitDebuggerStatement(node); + case 214: + return emitVariableDeclaration(node); + case 189: + return emitClassExpression(node); + case 217: + return emitClassDeclaration(node); + case 218: + return emitInterfaceDeclaration(node); case 220: - return emitModuleDeclaration(node); - case 224: - return emitImportDeclaration(node); - case 223: - return emitImportEqualsDeclaration(node); - case 230: - return emitExportDeclaration(node); - case 229: - return emitExportAssignment(node); + return emitEnumDeclaration(node); case 250: + return emitEnumMember(node); + case 221: + return emitModuleDeclaration(node); + case 225: + return emitImportDeclaration(node); + case 224: + return emitImportEqualsDeclaration(node); + case 231: + return emitExportDeclaration(node); + case 230: + return emitExportAssignment(node); + case 251: return emitSourceFileNode(node); } } @@ -31396,7 +31771,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 250 || node.pos !== node.parent.pos) { + if (node.parent.kind === 251 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { return getLeadingCommentsWithoutDetachedComments(); } @@ -31408,7 +31783,7 @@ var ts; } function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 250 || node.end !== node.parent.end) { + if (node.parent.kind === 251 || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -31794,7 +32169,23 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) - : (function (moduleNames, containingFile) { return ts.map(moduleNames, function (moduleName) { return resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }); }); + : (function (moduleNames, containingFile) { + var resolvedModuleNames = []; + var lookup = {}; + for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { + var moduleName = moduleNames_1[_i]; + var resolvedName = void 0; + if (ts.hasProperty(lookup, moduleName)) { + resolvedName = lookup[moduleName]; + } + else { + resolvedName = resolveModuleName(moduleName, containingFile, options, host).resolvedModule; + lookup[moduleName] = resolvedName; + } + resolvedModuleNames.push(resolvedName); + } + return resolvedModuleNames; + }); var filesByName = ts.createFileMap(); var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createFileMap(function (fileName) { return fileName.toLowerCase(); }) : undefined; if (oldProgram) { @@ -31896,8 +32287,11 @@ var ts; if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { return false; } + if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { + return false; + } if (resolveModuleNamesWorker) { - var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); for (var i = 0; i < moduleNames.length; i++) { var newResolution = resolutions[i]; @@ -32034,44 +32428,44 @@ var ts; return false; } switch (node.kind) { - case 223: + case 224: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return true; - case 229: + case 230: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return true; - case 216: + case 217: var classDeclaration = node; if (checkModifiers(classDeclaration.modifiers) || checkTypeParameters(classDeclaration.typeParameters)) { return true; } break; - case 245: + case 246: var heritageClause = node; if (heritageClause.token === 106) { diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return true; } break; - case 217: + case 218: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return true; - case 220: + case 221: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return true; - case 218: + case 219: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return true; - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 175: - case 215: + case 147: case 176: - case 215: + case 216: + case 177: + case 216: var functionDeclaration = node; if (checkModifiers(functionDeclaration.modifiers) || checkTypeParameters(functionDeclaration.typeParameters) || @@ -32079,20 +32473,20 @@ var ts; return true; } break; - case 195: + case 196: var variableStatement = node; if (checkModifiers(variableStatement.modifiers)) { return true; } break; - case 213: + case 214: var variableDeclaration = node; if (checkTypeAnnotation(variableDeclaration.type)) { return true; } break; - case 170: case 171: + case 172: var expression = node; if (expression.typeArguments && expression.typeArguments.length > 0) { var start_2 = expression.typeArguments.pos; @@ -32100,7 +32494,7 @@ var ts; return true; } break; - case 138: + case 139: var parameter = node; if (parameter.modifiers) { var start_3 = parameter.modifiers.pos; @@ -32116,17 +32510,17 @@ var ts; return true; } break; - case 141: + case 142: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); return true; - case 219: + case 220: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return true; - case 173: + case 174: var typeAssertionExpression = node; diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return true; - case 139: + case 140: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); return true; } @@ -32202,51 +32596,64 @@ var ts; function moduleNameIsEqualTo(a, b) { return a.text === b.text; } + function getTextOfLiteral(literal) { + return literal.text; + } function collectExternalModuleReferences(file) { if (file.imports) { return; } var isJavaScriptFile = ts.isSourceFileJavaScript(file); + var isExternalModuleFile = ts.isExternalModule(file); var imports; + var moduleAugmentations; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, true, false); + collectModuleReferences(node, false); + if (isJavaScriptFile) { + collectRequireCalls(node); + } } file.imports = imports || emptyArray; + file.moduleAugmentations = moduleAugmentations || emptyArray; return; - function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { - if (!collectOnlyRequireCalls) { - switch (node.kind) { - case 224: - case 223: - case 230: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9) { - break; - } - if (!moduleNameExpr.text) { - break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } + function collectModuleReferences(node, inAmbientModule) { + switch (node.kind) { + case 225: + case 224: + case 231: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9) { break; - case 220: - if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { - ts.forEachChild(node.body, function (node) { - collect(node, false, collectOnlyRequireCalls); - }); - } + } + if (!moduleNameExpr.text) { break; - } + } + if (!inAmbientModule || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } + break; + case 221: + if (ts.isAmbientModule(node) && (inAmbientModule || node.flags & 4 || ts.isDeclarationFile(file))) { + var moduleName = node.name; + if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) { + (moduleAugmentations || (moduleAugmentations = [])).push(moduleName); + } + else if (!inAmbientModule) { + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + collectModuleReferences(statement, true); + } + } + } } - if (isJavaScriptFile) { - if (ts.isRequireCall(node)) { - (imports || (imports = [])).push(node.arguments[0]); - } - else { - ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, true); }); - } + } + function collectRequireCalls(node) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, collectRequireCalls); } } } @@ -32352,14 +32759,17 @@ var ts; } function processImportedModules(file, basePath) { collectExternalModuleReferences(file); - if (file.imports.length) { + if (file.imports.length || file.moduleAugmentations.length) { file.resolvedModules = {}; - var moduleNames = ts.map(file.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(file.imports, file.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; i++) { + for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); - if (resolution && !options.noResolve) { + var shouldAddFile = resolution && + !options.noResolve && + i < file.imports.length; + if (shouldAddFile) { var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { if (!ts.isExternalModule(importedFile)) { @@ -33351,7 +33761,8 @@ var ts; return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } if (configFileName) { - configFileWatcher = ts.sys.watchFile(configFileName, configFileChanged); + var configFilePath = ts.toPath(configFileName, ts.sys.getCurrentDirectory(), ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)); + configFileWatcher = ts.sys.watchFile(configFilePath, configFileChanged); } if (ts.sys.watchDirectory && configFileName) { var directory = ts.getDirectoryPath(configFileName); @@ -33435,7 +33846,8 @@ var ts; } var sourceFile = hostGetSourceFile(fileName, languageVersion, onError); if (sourceFile && compilerOptions.watch) { - sourceFile.fileWatcher = ts.sys.watchFile(sourceFile.fileName, function (fileName, removed) { return sourceFileChanged(sourceFile, removed); }); + var filePath = ts.toPath(sourceFile.fileName, ts.sys.getCurrentDirectory(), ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)); + sourceFile.fileWatcher = ts.sys.watchFile(filePath, function (fileName, removed) { return sourceFileChanged(sourceFile, removed); }); } return sourceFile; } @@ -33646,10 +34058,10 @@ var ts; function serializeCompilerOptions(options) { var result = {}; var optionsNameMap = ts.getOptionNameMap().optionNameMap; - for (var name_28 in options) { - if (ts.hasProperty(options, name_28)) { - var value = options[name_28]; - switch (name_28) { + for (var name_31 in options) { + if (ts.hasProperty(options, name_31)) { + var value = options[name_31]; + switch (name_31) { case "init": case "watch": case "version": @@ -33657,17 +34069,17 @@ var ts; case "project": break; default: - var optionDefinition = optionsNameMap[name_28.toLowerCase()]; + var optionDefinition = optionsNameMap[name_31.toLowerCase()]; if (optionDefinition) { if (typeof optionDefinition.type === "string") { - result[name_28] = value; + result[name_31] = value; } else { var typeMap = optionDefinition.type; for (var key in typeMap) { if (ts.hasProperty(typeMap, key)) { if (typeMap[key] === value) - result[name_28] = key; + result[name_31] = key; } } } diff --git a/lib/tsserver.js b/lib/tsserver.js index b04981dc6db..ba62ebe0dde 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -636,7 +636,8 @@ var ts; if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { directoryComponents.length--; } - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + var joinStartIndex; + for (joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } @@ -773,6 +774,12 @@ var ts; return copiedList; } ts.copyListRemovingItem = copyListRemovingItem; + function createGetCanonicalFileName(useCaseSensitivefileNames) { + return useCaseSensitivefileNames + ? (function (fileName) { return fileName; }) + : (function (fileName) { return fileName.toLowerCase(); }); + } + ts.createGetCanonicalFileName = createGetCanonicalFileName; })(ts || (ts = {})); var ts; (function (ts) { @@ -911,7 +918,7 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - function createWatchedFileSet(interval, chunkSize) { + function createPollingWatchedFileSet(interval, chunkSize) { if (interval === void 0) { interval = 2500; } if (chunkSize === void 0) { chunkSize = 30; } var watchedFiles = []; @@ -925,13 +932,13 @@ var ts; if (!watchedFile) { return; } - _fs.stat(watchedFile.fileName, function (err, stats) { + _fs.stat(watchedFile.filePath, function (err, stats) { if (err) { - watchedFile.callback(watchedFile.fileName); + watchedFile.callback(watchedFile.filePath); } else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { - watchedFile.mtime = getModifiedTime(watchedFile.fileName); - watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0); + watchedFile.mtime = getModifiedTime(watchedFile.filePath); + watchedFile.callback(watchedFile.filePath, watchedFile.mtime.getTime() === 0); } }); } @@ -954,11 +961,11 @@ var ts; nextFileToCheck = nextToCheck; }, interval); } - function addFile(fileName, callback) { + function addFile(filePath, callback) { var file = { - fileName: fileName, + filePath: filePath, callback: callback, - mtime: getModifiedTime(fileName) + mtime: getModifiedTime(filePath) }; watchedFiles.push(file); if (watchedFiles.length === 1) { @@ -977,7 +984,77 @@ var ts; removeFile: removeFile }; } + function createWatchedFileSet() { + var dirWatchers = ts.createFileMap(); + var fileWatcherCallbacks = ts.createFileMap(); + return { addFile: addFile, removeFile: removeFile }; + function reduceDirWatcherRefCountForFile(filePath) { + var dirPath = ts.getDirectoryPath(filePath); + if (dirWatchers.contains(dirPath)) { + var watcher = dirWatchers.get(dirPath); + watcher.referenceCount -= 1; + if (watcher.referenceCount <= 0) { + watcher.close(); + dirWatchers.remove(dirPath); + } + } + } + function addDirWatcher(dirPath) { + if (dirWatchers.contains(dirPath)) { + var watcher_1 = dirWatchers.get(dirPath); + watcher_1.referenceCount += 1; + return; + } + var watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher.referenceCount = 1; + dirWatchers.set(dirPath, watcher); + return; + } + function addFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + fileWatcherCallbacks.get(filePath).push(callback); + } + else { + fileWatcherCallbacks.set(filePath, [callback]); + } + } + function addFile(filePath, callback) { + addFileWatcherCallback(filePath, callback); + addDirWatcher(ts.getDirectoryPath(filePath)); + return { filePath: filePath, callback: callback }; + } + function removeFile(watchedFile) { + removeFileWatcherCallback(watchedFile.filePath, watchedFile.callback); + reduceDirWatcherRefCountForFile(watchedFile.filePath); + } + function removeFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + var newCallbacks = ts.copyListRemovingItem(callback, fileWatcherCallbacks.get(filePath)); + if (newCallbacks.length === 0) { + fileWatcherCallbacks.remove(filePath); + } + else { + fileWatcherCallbacks.set(filePath, newCallbacks); + } + } + } + function fileEventHandler(eventName, relativeFileName, baseDirPath) { + var filePath = typeof relativeFileName !== "string" + ? undefined + : ts.toPath(relativeFileName, baseDirPath, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)); + if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) { + for (var _i = 0, _a = fileWatcherCallbacks.get(filePath); _i < _a.length; _i++) { + var fileCallback = _a[_i]; + fileCallback(filePath); + } + } + } + } + var pollingWatchedFileSet = createPollingWatchedFileSet(); var watchedFileSet = createWatchedFileSet(); + function isNode4OrLater() { + return parseInt(process.version.charAt(1)) >= 4; + } var platform = _os.platform(); var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; function readFile(fileName, encoding) { @@ -1019,7 +1096,7 @@ var ts; } } function getCanonicalPath(path) { - return useCaseSensitiveFileNames ? path.toLowerCase() : path; + return useCaseSensitiveFileNames ? path : path.toLowerCase(); } function readDirectory(path, extension, exclude) { var result = []; @@ -1059,14 +1136,22 @@ var ts; }, readFile: readFile, writeFile: writeFile, - watchFile: function (fileName, callback) { - var watchedFile = watchedFileSet.addFile(fileName, callback); + watchFile: function (filePath, callback) { + var watchSet = isNode4OrLater() ? watchedFileSet : pollingWatchedFileSet; + var watchedFile = watchSet.addFile(filePath, callback); return { - close: function () { return watchedFileSet.removeFile(watchedFile); } + close: function () { return watchSet.removeFile(watchedFile); } }; }, watchDirectory: function (path, callback, recursive) { - return _fs.watch(path, { persistent: true, recursive: !!recursive }, function (eventName, relativeFileName) { + var options; + if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + options = { persistent: true, recursive: !!recursive }; + } + else { + options = { persistent: true }; + } + return _fs.watch(path, options, function (eventName, relativeFileName) { if (eventName === "rename") { callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(path, relativeFileName))); } @@ -1325,7 +1410,6 @@ var ts; Cannot_find_parameter_0: { code: 1225, category: ts.DiagnosticCategory.Error, key: "Cannot_find_parameter_0_1225", message: "Cannot find parameter '{0}'." }, Type_predicate_0_is_not_assignable_to_1: { code: 1226, category: ts.DiagnosticCategory.Error, key: "Type_predicate_0_is_not_assignable_to_1_1226", message: "Type predicate '{0}' is not assignable to '{1}'." }, Parameter_0_is_not_in_the_same_position_as_parameter_1: { code: 1227, category: ts.DiagnosticCategory.Error, key: "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", message: "Parameter '{0}' is not in the same position as parameter '{1}'." }, - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: { code: 1228, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", message: "A type predicate is only allowed in return type position for functions and methods." }, A_type_predicate_cannot_reference_a_rest_parameter: { code: 1229, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_a_rest_parameter_1229", message: "A type predicate cannot reference a rest parameter." }, A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: { code: 1230, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", message: "A type predicate cannot reference element '{0}' in a binding pattern." }, An_export_assignment_can_only_be_used_in_a_module: { code: 1231, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_can_only_be_used_in_a_module_1231", message: "An export assignment can only be used in a module." }, @@ -1561,7 +1645,6 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, - A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -1590,6 +1673,16 @@ var ts; Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, + Cannot_re_export_name_that_is_not_defined_in_the_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_re_export_name_that_is_not_defined_in_the_module_2661", message: "Cannot re-export name that is not defined in the module." }, + Cannot_find_name_0_Did_you_mean_the_static_member_1_0: { code: 2662, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", message: "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?" }, + Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: { code: 2663, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", message: "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?" }, + Invalid_module_name_in_augmentation_module_0_cannot_be_found: { code: 2664, category: ts.DiagnosticCategory.Error, key: "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", message: "Invalid module name in augmentation, module '{0}' cannot be found." }, + Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope: { code: 2665, category: ts.DiagnosticCategory.Error, key: "Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope_2665", message: "Module augmentation cannot introduce new names in the top level scope." }, + Exports_and_export_assignments_are_not_permitted_in_module_augmentations: { code: 2666, category: ts.DiagnosticCategory.Error, key: "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", message: "Exports and export assignments are not permitted in module augmentations." }, + Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: { code: 2667, category: ts.DiagnosticCategory.Error, key: "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", message: "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module." }, + export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: { code: 2668, category: ts.DiagnosticCategory.Error, key: "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", message: "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible." }, + Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: { code: 2669, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", message: "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations." }, + Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: { code: 2670, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", message: "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -1754,6 +1847,7 @@ var ts; _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", message: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", message: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", message: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: { code: 7015, category: ts.DiagnosticCategory.Error, key: "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", message: "Element implicitly has an 'any' type because index expression is not of type 'number'." }, Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation_7016", message: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index_signature_of_object_type_implicitly_has_an_any_type_7017", message: "Index signature of object type implicitly has an 'any' type." }, Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: ts.DiagnosticCategory.Error, key: "Object_literal_s_property_0_implicitly_has_an_1_type_7018", message: "Object literal's property '{0}' implicitly has an '{1}' type." }, @@ -1849,6 +1943,7 @@ var ts; "protected": 111, "public": 112, "require": 127, + "global": 134, "return": 94, "set": 129, "static": 113, @@ -1869,7 +1964,7 @@ var ts; "yield": 114, "async": 118, "await": 119, - "of": 134, + "of": 135, "{": 15, "}": 16, "(": 17, @@ -3130,7 +3225,7 @@ var ts; break; } } - return token = 238; + return token = 239; } function scanJsxIdentifier() { if (tokenIsIdentifierOrKeyword(token)) { @@ -3831,7 +3926,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 250) { + while (node && node.kind !== 251) { node = node.parent; } return node; @@ -3915,6 +4010,28 @@ var ts; isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function isAmbientModule(node) { + return node && node.kind === 221 && + (node.name.kind === 9 || isGlobalScopeAugmentation(node)); + } + ts.isAmbientModule = isAmbientModule; + function isGlobalScopeAugmentation(module) { + return !!(module.flags & 2097152); + } + ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; + function isExternalModuleAugmentation(node) { + if (!node || !isAmbientModule(node)) { + return false; + } + switch (node.parent.kind) { + case 251: + return isExternalModule(node.parent); + case 222: + return isAmbientModule(node.parent.parent) && !isExternalModule(node.parent.parent.parent); + } + return false; + } + ts.isExternalModuleAugmentation = isExternalModuleAugmentation; function getEnclosingBlockScopeContainer(node) { var current = node.parent; while (current) { @@ -3922,15 +4039,15 @@ var ts; return current; } switch (current.kind) { - case 250: - case 222: - case 246: - case 220: - case 201: + case 251: + case 223: + case 247: + case 221: case 202: case 203: + case 204: return current; - case 194: + case 195: if (!isFunctionLike(current.parent)) { return current; } @@ -3941,9 +4058,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 213 && + declaration.kind === 214 && declaration.parent && - declaration.parent.kind === 246; + declaration.parent.kind === 247; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3979,23 +4096,24 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 250: + case 251: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 213: - case 165: - case 216: - case 188: + case 214: + case 166: case 217: + case 189: + case 218: + case 221: case 220: + case 250: + case 216: + case 176: + case 144: case 219: - case 249: - case 215: - case 175: - case 143: errorNode = node.name; break; } @@ -4021,11 +4139,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 219 && isConst(node); + return node.kind === 220 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 165 || isBindingPattern(node))) { + while (node && (node.kind === 166 || isBindingPattern(node))) { node = node.parent; } return node; @@ -4033,14 +4151,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 213) { + if (node.kind === 214) { node = node.parent; } - if (node && node.kind === 214) { + if (node && node.kind === 215) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 195) { + if (node && node.kind === 196) { flags |= node.flags; } return flags; @@ -4055,7 +4173,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 197 && node.expression.kind === 9; + return node.kind === 198 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -4071,7 +4189,7 @@ var ts; } ts.getJsDocComments = getJsDocComments; function getJsDocCommentsFromText(node, text) { - var commentRanges = (node.kind === 138 || node.kind === 137) ? + var commentRanges = (node.kind === 139 || node.kind === 138) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, isJsDocComment); @@ -4085,7 +4203,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (150 <= node.kind && node.kind <= 162) { + if (151 <= node.kind && node.kind <= 163) { return true; } switch (node.kind) { @@ -4096,56 +4214,56 @@ var ts; case 131: return true; case 103: - return node.parent.kind !== 179; - case 190: + return node.parent.kind !== 180; + case 191: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); case 69: - if (node.parent.kind === 135 && node.parent.right === node) { + if (node.parent.kind === 136 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 168 && node.parent.name === node) { + else if (node.parent.kind === 169 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 69 || node.kind === 135 || node.kind === 168, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); - case 135: - case 168: + ts.Debug.assert(node.kind === 69 || node.kind === 136 || node.kind === 169, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + case 136: + case 169: case 97: var parent_1 = node.parent; - if (parent_1.kind === 154) { + if (parent_1.kind === 155) { return false; } - if (150 <= parent_1.kind && parent_1.kind <= 162) { + if (151 <= parent_1.kind && parent_1.kind <= 163) { return true; } switch (parent_1.kind) { - case 190: + case 191: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 137: - return node === parent_1.constraint; - case 141: - case 140: case 138: - case 213: + return node === parent_1.constraint; + case 142: + case 141: + case 139: + case 214: return node === parent_1.type; - case 215: - case 175: + case 216: case 176: + case 177: + case 145: case 144: case 143: - case 142: - case 145: case 146: - return node === parent_1.type; case 147: + return node === parent_1.type; case 148: case 149: + case 150: return node === parent_1.type; - case 173: + case 174: return node === parent_1.type; - case 170: case 171: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; case 172: + return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; + case 173: return false; } } @@ -4156,23 +4274,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 206: + case 207: return visitor(node); - case 222: - case 194: - case 198: + case 223: + case 195: case 199: case 200: case 201: case 202: case 203: - case 207: + case 204: case 208: - case 243: - case 244: case 209: - case 211: - case 246: + case 244: + case 245: + case 210: + case 212: + case 247: return ts.forEachChild(node, traverse); } } @@ -4182,23 +4300,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186: + case 187: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 219: - case 217: case 220: case 218: - case 216: - case 188: + case 221: + case 219: + case 217: + case 189: return; default: if (isFunctionLike(node)) { var name_5 = node.name; - if (name_5 && name_5.kind === 136) { + if (name_5 && name_5.kind === 137) { traverse(name_5.expression); return; } @@ -4213,14 +4331,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 165: - case 249: - case 138: - case 247: - case 141: - case 140: + case 166: + case 250: + case 139: case 248: - case 213: + case 142: + case 141: + case 249: + case 214: return true; } } @@ -4228,11 +4346,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 145 || node.kind === 146); + return node && (node.kind === 146 || node.kind === 147); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 216 || node.kind === 188); + return node && (node.kind === 217 || node.kind === 189); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -4241,32 +4359,32 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 144: - case 175: - case 215: - case 176: - case 143: - case 142: case 145: + case 176: + case 216: + case 177: + case 144: + case 143: case 146: case 147: case 148: case 149: - case 152: + case 150: case 153: + case 154: return true; } } ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 215: - case 175: + case 147: + case 216: + case 176: return true; } return false; @@ -4274,24 +4392,24 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 201: case 202: case 203: - case 199: + case 204: case 200: + case 201: return true; - case 209: + case 210: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 194 && isFunctionLike(node.parent); + return node && node.kind === 195 && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 && node.parent.kind === 167; + return node && node.kind === 144 && node.parent.kind === 168; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isIdentifierTypePredicate(predicate) { @@ -4323,39 +4441,39 @@ var ts; return undefined; } switch (node.kind) { - case 136: + case 137: if (isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 139: - if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { + case 140: + if (node.parent.kind === 139 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 176: + case 177: if (!includeArrowFunctions) { continue; } - case 215: - case 175: - case 220: - case 141: - case 140: - case 143: + case 216: + case 176: + case 221: case 142: + case 141: case 144: + case 143: case 145: case 146: case 147: case 148: case 149: - case 219: - case 250: + case 150: + case 220: + case 251: return node; } } @@ -4368,25 +4486,25 @@ var ts; return node; } switch (node.kind) { - case 136: + case 137: node = node.parent; break; - case 215: - case 175: + case 216: case 176: + case 177: if (!stopOnFunctions) { continue; } - case 141: - case 140: - case 143: case 142: + case 141: case 144: + case 143: case 145: case 146: + case 147: return node; - case 139: - if (node.parent.kind === 138 && isClassElement(node.parent.parent)) { + case 140: + if (node.parent.kind === 139 && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { @@ -4400,12 +4518,12 @@ var ts; function getEntityNameFromTypeNode(node) { if (node) { switch (node.kind) { - case 151: + case 152: return node.typeName; - case 190: + case 191: return node.expression; case 69: - case 135: + case 136: return node; } } @@ -4413,7 +4531,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 172) { + if (node.kind === 173) { return node.tag; } return node.expression; @@ -4421,54 +4539,36 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 216: + case 217: return true; - case 141: - return node.parent.kind === 216; - case 138: - return node.parent.body && node.parent.parent.kind === 216; - case 145: + case 142: + return node.parent.kind === 217; case 146: - case 143: - return node.body && node.parent.kind === 216; + case 147: + case 144: + return node.body !== undefined + && node.parent.kind === 217; + case 139: + return node.parent.body !== undefined + && (node.parent.kind === 145 + || node.parent.kind === 144 + || node.parent.kind === 147) + && node.parent.parent.kind === 217; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { - switch (node.kind) { - case 216: - if (node.decorators) { - return true; - } - return false; - case 141: - case 138: - if (node.decorators) { - return true; - } - return false; - case 145: - if (node.body && node.decorators) { - return true; - } - return false; - case 143: - case 146: - if (node.body && node.decorators) { - return true; - } - return false; - } - return false; + return node.decorators !== undefined + && nodeCanBeDecorated(node); } ts.nodeIsDecorated = nodeIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 168; + return node.kind === 169; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 169; + return node.kind === 170; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -4478,42 +4578,42 @@ var ts; case 99: case 84: case 10: - case 166: case 167: case 168: case 169: case 170: case 171: case 172: - case 191: case 173: + case 192: case 174: case 175: - case 188: case 176: - case 179: + case 189: case 177: + case 180: case 178: - case 181: + case 179: case 182: case 183: case 184: - case 187: case 185: - case 11: - case 189: - case 235: - case 236: + case 188: case 186: - case 180: + case 11: + case 190: + case 236: + case 237: + case 187: + case 181: return true; - case 135: - while (node.parent.kind === 135) { + case 136: + while (node.parent.kind === 136) { node = node.parent; } - return node.parent.kind === 154; + return node.parent.kind === 155; case 69: - if (node.parent.kind === 154) { + if (node.parent.kind === 155) { return true; } case 8: @@ -4521,47 +4621,47 @@ var ts; case 97: var parent_2 = node.parent; switch (parent_2.kind) { - case 213: - case 138: + case 214: + case 139: + case 142: case 141: - case 140: - case 249: - case 247: - case 165: + case 250: + case 248: + case 166: return parent_2.initializer === node; - case 197: case 198: case 199: case 200: - case 206: + case 201: case 207: case 208: - case 243: - case 210: - case 208: + case 209: + case 244: + case 211: + case 209: return parent_2.expression === node; - case 201: + case 202: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 214) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 215) || forStatement.condition === node || forStatement.incrementor === node; - case 202: case 203: + case 204: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 215) || forInStatement.expression === node; - case 173: - case 191: - return node === parent_2.expression; + case 174: case 192: return node === parent_2.expression; - case 136: + case 193: return node === parent_2.expression; - case 139: + case 137: + return node === parent_2.expression; + case 140: + case 243: case 242: - case 241: return true; - case 190: + case 191: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -4583,7 +4683,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 && node.moduleReference.kind === 234; + return node.kind === 224 && node.moduleReference.kind === 235; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -4592,7 +4692,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 && node.moduleReference.kind !== 234; + return node.kind === 224 && node.moduleReference.kind !== 235; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -4604,7 +4704,7 @@ var ts; } ts.isInJavaScriptFile = isInJavaScriptFile; function isRequireCall(expression) { - return expression.kind === 170 && + return expression.kind === 171 && expression.expression.kind === 69 && expression.expression.text === "require" && expression.arguments.length === 1 && @@ -4612,11 +4712,11 @@ var ts; } ts.isRequireCall = isRequireCall; function getSpecialPropertyAssignmentKind(expression) { - if (expression.kind !== 183) { + if (expression.kind !== 184) { return 0; } var expr = expression; - if (expr.operatorToken.kind !== 56 || expr.left.kind !== 168) { + if (expr.operatorToken.kind !== 56 || expr.left.kind !== 169) { return 0; } var lhs = expr.left; @@ -4632,7 +4732,7 @@ var ts; else if (lhs.expression.kind === 97) { return 4; } - else if (lhs.expression.kind === 168) { + else if (lhs.expression.kind === 169) { var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 69 && innerPropertyAccess.name.text === "prototype") { return 3; @@ -4642,30 +4742,33 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 224) { + if (node.kind === 225) { return node.moduleSpecifier; } - if (node.kind === 223) { + if (node.kind === 224) { var reference = node.moduleReference; - if (reference.kind === 234) { + if (reference.kind === 235) { return reference.expression; } } - if (node.kind === 230) { + if (node.kind === 231) { return node.moduleSpecifier; } + if (node.kind === 221 && node.name.kind === 9) { + return node.name; + } } ts.getExternalModuleName = getExternalModuleName; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 138: + case 139: + case 144: case 143: - case 142: + case 249: case 248: - case 247: + case 142: case 141: - case 140: return node.questionToken !== undefined; } } @@ -4673,9 +4776,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 263 && + return node.kind === 264 && node.parameters.length > 0 && - node.parameters[0].type.kind === 265; + node.parameters[0].type.kind === 266; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -4689,15 +4792,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 271); + return getJSDocTag(node, 272); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 270); + return getJSDocTag(node, 271); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 272); + return getJSDocTag(node, 273); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -4706,7 +4809,7 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 269) { + if (t.kind === 270) { var parameterTag = t; var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; if (name_6.text === parameterName) { @@ -4725,12 +4828,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32) { - if (node.type && node.type.kind === 264) { + if (node.type && node.type.kind === 265) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 264; + return paramTag.typeExpression.type.kind === 265; } } return node.dotDotDotToken !== undefined; @@ -4751,7 +4854,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 164 || node.kind === 163); + return !!node && (node.kind === 165 || node.kind === 164); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -4775,34 +4878,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 176: - case 165: - case 216: - case 188: - case 144: - case 219: - case 249: - case 232: - case 215: - case 175: - case 145: - case 225: - case 223: - case 228: + case 177: + case 166: case 217: - case 143: - case 142: + case 189: + case 145: case 220: - case 226: - case 138: - case 247: - case 141: - case 140: + case 250: + case 233: + case 216: + case 176: case 146: - case 248: + case 226: + case 224: + case 229: case 218: - case 137: - case 213: + case 144: + case 143: + case 221: + case 227: + case 139: + case 248: + case 142: + case 141: + case 147: + case 249: + case 219: + case 138: + case 214: return true; } return false; @@ -4810,25 +4913,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 205: - case 204: - case 212: - case 199: - case 197: - case 196: - case 202: - case 203: - case 201: - case 198: - case 209: case 206: - case 208: - case 210: - case 211: - case 195: + case 205: + case 213: case 200: + case 198: + case 197: + case 203: + case 204: + case 202: + case 199: + case 210: case 207: - case 229: + case 209: + case 211: + case 212: + case 196: + case 201: + case 208: + case 230: return true; default: return false; @@ -4837,13 +4940,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 144: - case 141: - case 143: case 145: - case 146: case 142: - case 149: + case 144: + case 146: + case 147: + case 143: + case 150: return true; default: return false; @@ -4855,7 +4958,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 228 || parent.kind === 232) { + if (parent.kind === 229 || parent.kind === 233) { if (parent.propertyName) { return true; } @@ -4869,40 +4972,40 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 141: - case 140: - case 143: case 142: - case 145: + case 141: + case 144: + case 143: case 146: - case 249: - case 247: - case 168: + case 147: + case 250: + case 248: + case 169: return parent.name === node; - case 135: + case 136: if (parent.right === node) { - while (parent.kind === 135) { + while (parent.kind === 136) { parent = parent.parent; } - return parent.kind === 154; + return parent.kind === 155; } return false; - case 165: - case 228: + case 166: + case 229: return parent.propertyName === node; - case 232: + case 233: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 223 || - node.kind === 225 && !!node.name || - node.kind === 226 || - node.kind === 228 || - node.kind === 232 || - node.kind === 229 && node.expression.kind === 69; + return node.kind === 224 || + node.kind === 226 && !!node.name || + node.kind === 227 || + node.kind === 229 || + node.kind === 233 || + node.kind === 230 && node.expression.kind === 69; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -4984,7 +5087,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 70 <= token && token <= 134; + return 70 <= token && token <= 135; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -5004,7 +5107,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 136 && + return name.kind === 137 && !isStringOrNumericLiteral(name.expression.kind) && !isWellKnownSymbolSyntactically(name.expression); } @@ -5017,7 +5120,7 @@ var ts; if (name.kind === 69 || name.kind === 9 || name.kind === 8) { return name.text; } - if (name.kind === 136) { + if (name.kind === 137) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -5054,18 +5157,18 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 138; + return root.kind === 139; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 165) { + while (node.kind === 166) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 220 || n.kind === 250; + return isFunctionLike(n) || n.kind === 221 || n.kind === 251; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function cloneNode(node, location, flags, parent) { @@ -5098,7 +5201,7 @@ var ts; } ts.cloneEntityName = cloneEntityName; function isQualifiedName(node) { - return node.kind === 135; + return node.kind === 136; } ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { @@ -5411,7 +5514,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 144 && nodeIsPresent(member.body)) { + if (member.kind === 145 && nodeIsPresent(member.body)) { return member; } }); @@ -5428,10 +5531,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 145) { + if (accessor.kind === 146) { getAccessor = accessor; } - else if (accessor.kind === 146) { + else if (accessor.kind === 147) { setAccessor = accessor; } else { @@ -5440,7 +5543,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 145 || member.kind === 146) + if ((member.kind === 146 || member.kind === 147) && (member.flags & 64) === (accessor.flags & 64)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -5451,10 +5554,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 145 && !getAccessor) { + if (member.kind === 146 && !getAccessor) { getAccessor = member; } - if (member.kind === 146 && !setAccessor) { + if (member.kind === 147 && !setAccessor) { setAccessor = member; } } @@ -5620,24 +5723,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 168: case 169: - case 171: case 170: - case 235: - case 236: case 172: - case 166: - case 174: + case 171: + case 236: + case 237: + case 173: case 167: - case 188: case 175: + case 168: + case 189: + case 176: case 69: case 10: case 8: case 9: case 11: - case 185: + case 186: case 84: case 93: case 97: @@ -5654,7 +5757,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 190 && + return node.kind === 191 && node.parent.token === 83 && isClassLike(node.parent.parent); } @@ -5675,16 +5778,16 @@ var ts; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 135 && node.parent.right === node) || - (node.parent.kind === 168 && node.parent.name === node); + return (node.parent.kind === 136 && node.parent.right === node) || + (node.parent.kind === 169 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 167) { + if (kind === 168) { return expression.properties.length === 0; } - if (kind === 166) { + if (kind === 167) { return expression.elements.length === 0; } return false; @@ -5928,9 +6031,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 137) { + if (d && d.kind === 138) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 218) { return current; } } @@ -5938,7 +6041,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return node.flags & 56 && node.parent.kind === 144 && ts.isClassLike(node.parent.parent); + return node.flags & 56 && node.parent.kind === 145 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); @@ -5948,7 +6051,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 250) { + if (kind === 251) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -5984,26 +6087,26 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 135: + case 136: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 137: + case 138: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 248: + case 249: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 138: + case 139: + case 142: case 141: - case 140: - case 247: - case 213: - case 165: + case 248: + case 214: + case 166: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -6012,24 +6115,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 152: case 153: - case 147: + case 154: case 148: case 149: + case 150: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 175: - case 215: + case 147: case 176: + case 216: + case 177: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -6040,160 +6143,153 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 151: + case 152: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 150: + case 151: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 154: - return visitNode(cbNode, node.exprName); case 155: - return visitNodes(cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 156: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNodes, node.members); case 157: - return visitNodes(cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 158: + return visitNodes(cbNodes, node.elementTypes); case 159: - return visitNodes(cbNodes, node.types); case 160: + return visitNodes(cbNodes, node.types); + case 161: return visitNode(cbNode, node.type); - case 163: case 164: - return visitNodes(cbNodes, node.elements); - case 166: + case 165: return visitNodes(cbNodes, node.elements); case 167: - return visitNodes(cbNodes, node.properties); + return visitNodes(cbNodes, node.elements); case 168: + return visitNodes(cbNodes, node.properties); + case 169: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 169: + case 170: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 170: case 171: + case 172: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 172: + case 173: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 173: + case 174: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 174: - return visitNode(cbNode, node.expression); - case 177: + case 175: return visitNode(cbNode, node.expression); case 178: return visitNode(cbNode, node.expression); case 179: return visitNode(cbNode, node.expression); - case 181: - return visitNode(cbNode, node.operand); - case 186: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 180: return visitNode(cbNode, node.expression); case 182: return visitNode(cbNode, node.operand); + case 187: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 181: + return visitNode(cbNode, node.expression); case 183: + return visitNode(cbNode, node.operand); + case 184: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 191: + case 192: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 184: + case 185: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 187: + case 188: return visitNode(cbNode, node.expression); - case 194: - case 221: + case 195: + case 222: return visitNodes(cbNodes, node.statements); - case 250: + case 251: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 195: + case 196: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 214: + case 215: return visitNodes(cbNodes, node.declarations); - case 197: - return visitNode(cbNode, node.expression); case 198: + return visitNode(cbNode, node.expression); + case 199: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 199: + case 200: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 200: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); case 201: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.incrementor) || + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 202: return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || + visitNode(cbNode, node.condition) || + visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); case 203: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 204: - case 205: - return visitNode(cbNode, node.label); - case 206: - return visitNode(cbNode, node.expression); - case 207: - return visitNode(cbNode, node.expression) || + return visitNode(cbNode, node.initializer) || + visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + case 205: + case 206: + return visitNode(cbNode, node.label); + case 207: + return visitNode(cbNode, node.expression); case 208: + return visitNode(cbNode, node.expression) || + visitNode(cbNode, node.statement); + case 209: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 222: + case 223: return visitNodes(cbNodes, node.clauses); - case 243: + case 244: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 244: + case 245: return visitNodes(cbNodes, node.statements); - case 209: + case 210: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 210: - return visitNode(cbNode, node.expression); case 211: + return visitNode(cbNode, node.expression); + case 212: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 246: + case 247: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 139: + case 140: return visitNode(cbNode, node.expression); - case 216: - case 188: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); case 217: + case 189: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -6205,125 +6301,132 @@ var ts; visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); + visitNodes(cbNodes, node.heritageClauses) || + visitNodes(cbNodes, node.members); case 219: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 249: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); + visitNodes(cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); case 220: + return visitNodes(cbNodes, node.decorators) || + visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); + case 250: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 221: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 223: + case 224: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 224: + case 225: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 225: + case 226: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 226: - return visitNode(cbNode, node.name); case 227: - case 231: + return visitNode(cbNode, node.name); + case 228: + case 232: return visitNodes(cbNodes, node.elements); - case 230: + case 231: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 228: - case 232: + case 229: + case 233: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 229: + case 230: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 185: + case 186: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 192: + case 193: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 136: + case 137: return visitNode(cbNode, node.expression); - case 245: + case 246: return visitNodes(cbNodes, node.types); - case 190: + case 191: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 234: - return visitNode(cbNode, node.expression); - case 233: - return visitNodes(cbNodes, node.decorators); case 235: + return visitNode(cbNode, node.expression); + case 234: + return visitNodes(cbNodes, node.decorators); + case 236: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 236: case 237: + case 238: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 240: + case 241: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 241: - return visitNode(cbNode, node.expression); case 242: return visitNode(cbNode, node.expression); - case 239: + case 243: + return visitNode(cbNode, node.expression); + case 240: return visitNode(cbNode, node.tagName); - case 251: + case 252: return visitNode(cbNode, node.type); - case 255: - return visitNodes(cbNodes, node.types); case 256: return visitNodes(cbNodes, node.types); - case 254: + case 257: + return visitNodes(cbNodes, node.types); + case 255: return visitNode(cbNode, node.elementType); + case 259: + return visitNode(cbNode, node.type); case 258: return visitNode(cbNode, node.type); - case 257: - return visitNode(cbNode, node.type); - case 259: + case 260: return visitNodes(cbNodes, node.members); - case 261: + case 262: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 262: - return visitNode(cbNode, node.type); case 263: + return visitNode(cbNode, node.type); + case 264: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 264: - return visitNode(cbNode, node.type); case 265: return visitNode(cbNode, node.type); case 266: return visitNode(cbNode, node.type); - case 260: + case 267: + return visitNode(cbNode, node.type); + case 261: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 267: + case 268: return visitNodes(cbNodes, node.tags); - case 269: + case 270: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 270: - return visitNode(cbNode, node.typeExpression); case 271: return visitNode(cbNode, node.typeExpression); case 272: + return visitNode(cbNode, node.typeExpression); + case 273: return visitNodes(cbNodes, node.typeParameters); } } @@ -6430,9 +6533,9 @@ var ts; return; function visit(node) { switch (node.kind) { - case 195: - case 215: - case 138: + case 196: + case 216: + case 139: addJSDocComment(node); } forEachChild(node, visit); @@ -6466,7 +6569,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion) { - var sourceFile = new SourceFileConstructor(250, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(251, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -6757,7 +6860,7 @@ var ts; return token === 9 || token === 8 || ts.tokenIsIdentifierOrKeyword(token); } function parseComputedPropertyName() { - var node = createNode(136); + var node = createNode(137); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); @@ -7056,14 +7159,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 144: - case 149: case 145: + case 150: case 146: - case 141: - case 193: + case 147: + case 142: + case 194: return true; - case 143: + case 144: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 69 && methodDeclaration.name.originalKeywordKind === 121; @@ -7075,8 +7178,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 243: case 244: + case 245: return true; } } @@ -7085,65 +7188,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 215: + case 216: + case 196: case 195: - case 194: + case 199: case 198: - case 197: - case 210: + case 211: + case 207: + case 209: case 206: - case 208: case 205: + case 203: case 204: case 202: - case 203: case 201: - case 200: - case 207: - case 196: - case 211: - case 209: - case 199: + case 208: + case 197: case 212: + case 210: + case 200: + case 213: + case 225: case 224: - case 223: + case 231: case 230: - case 229: - case 220: - case 216: + case 221: case 217: - case 219: case 218: + case 220: + case 219: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 249; + return node.kind === 250; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 148: - case 142: case 149: - case 140: - case 147: + case 143: + case 150: + case 141: + case 148: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 213) { + if (node.kind !== 214) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 138) { + if (node.kind !== 139) { return false; } var parameter = node; @@ -7243,7 +7346,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(21)) { - var node = createNode(135, entity.pos); + var node = createNode(136, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -7260,7 +7363,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(185); + var template = createNode(186); template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12, "Template head has wrong token kind"); var templateSpans = []; @@ -7273,7 +7376,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(192); + var span = createNode(193); span.expression = allowInAnd(parseExpression); var literal; if (token === 16) { @@ -7287,7 +7390,7 @@ var ts; return finishNode(span); } function parseStringLiteralTypeNode() { - return parseLiteralLikeNode(162, true); + return parseLiteralLikeNode(163, true); } function parseLiteralNode(internName) { return parseLiteralLikeNode(token, internName); @@ -7315,12 +7418,9 @@ var ts; } return node; } - function parseTypeReferenceOrTypePredicate() { + function parseTypeReference() { var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - if (typeName.kind === 69 && token === 124 && !scanner.hasPrecedingLineBreak()) { - return parseTypePredicate(typeName); - } - var node = createNode(151, typeName.pos); + var node = createNode(152, typeName.pos); node.typeName = typeName; if (!scanner.hasPrecedingLineBreak() && token === 25) { node.typeArguments = parseBracketedList(18, parseType, 25, 27); @@ -7329,24 +7429,24 @@ var ts; } function parseTypePredicate(lhs) { nextToken(); - var node = createNode(150, lhs.pos); + var node = createNode(151, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(161); + var node = createNode(162); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(154); + var node = createNode(155); parseExpected(101); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(137); + var node = createNode(138); node.name = parseIdentifier(); if (parseOptional(83)) { if (isStartOfType() || !isStartOfExpression()) { @@ -7379,7 +7479,7 @@ var ts; } } function parseParameter() { - var node = createNode(138); + var node = createNode(139); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(22); @@ -7404,10 +7504,10 @@ var ts; signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList); if (returnTokenRequired) { parseExpected(returnToken); - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } else if (parseOptional(returnToken)) { - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } } function parseParameterList(yieldContext, awaitContext, requireCompleteParameterList) { @@ -7434,7 +7534,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 148) { + if (kind === 149) { parseExpected(92); } fillSignature(54, false, false, false, node); @@ -7474,7 +7574,7 @@ var ts; return token === 54 || token === 24 || token === 20; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(149, fullStart); + var node = createNode(150, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(16, parseParameter, 19, 20); @@ -7487,7 +7587,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(53); if (token === 17 || token === 25) { - var method = createNode(142, fullStart); + var method = createNode(143, fullStart); method.name = name; method.questionToken = questionToken; fillSignature(54, false, false, false, method); @@ -7495,7 +7595,7 @@ var ts; return finishNode(method); } else { - var property = createNode(140, fullStart); + var property = createNode(141, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -7540,14 +7640,14 @@ var ts; switch (token) { case 17: case 25: - return parseSignatureMember(147); + return parseSignatureMember(148); case 19: return isIndexSignature() ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); case 92: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(148); + return parseSignatureMember(149); } case 9: case 8: @@ -7577,7 +7677,7 @@ var ts; return token === 17 || token === 25; } function parseTypeLiteral() { - var node = createNode(155); + var node = createNode(156); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -7593,12 +7693,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(157); + var node = createNode(158); node.elementTypes = parseBracketedList(19, parseType, 19, 20); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(160); + var node = createNode(161); parseExpected(17); node.type = parseType(); parseExpected(18); @@ -7606,7 +7706,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 153) { + if (kind === 154) { parseExpected(92); } fillSignature(34, false, false, false, node); @@ -7624,7 +7724,7 @@ var ts; case 120: case 131: var node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReferenceOrTypePredicate(); + return node || parseTypeReference(); case 9: return parseStringLiteralTypeNode(); case 103: @@ -7647,7 +7747,7 @@ var ts; case 17: return parseParenthesizedType(); default: - return parseTypeReferenceOrTypePredicate(); + return parseTypeReference(); } } function isStartOfType() { @@ -7680,7 +7780,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(19)) { parseExpected(20); - var node = createNode(156, type.pos); + var node = createNode(157, type.pos); node.elementType = type; type = finishNode(node); } @@ -7702,10 +7802,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(159, parseArrayTypeOrHigher, 46); + return parseUnionOrIntersectionType(160, parseArrayTypeOrHigher, 46); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(158, parseIntersectionTypeOrHigher, 47); + return parseUnionOrIntersectionType(159, parseIntersectionTypeOrHigher, 47); } function isStartOfFunctionType() { if (token === 25) { @@ -7734,15 +7834,35 @@ var ts; } return false; } + function parseTypeOrTypePredicate() { + var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); + var type = parseType(); + if (typePredicateVariable) { + var node = createNode(151, typePredicateVariable.pos); + node.parameterName = typePredicateVariable; + node.type = type; + return finishNode(node); + } + else { + return type; + } + } + function parseTypePredicatePrefix() { + var id = parseIdentifier(); + if (token === 124 && !scanner.hasPrecedingLineBreak()) { + nextToken(); + return id; + } + } function parseType() { return doOutsideOfContext(10, parseTypeWorker); } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(152); + return parseFunctionOrConstructorType(153); } if (token === 92) { - return parseFunctionOrConstructorType(153); + return parseFunctionOrConstructorType(154); } return parseUnionTypeOrHigher(); } @@ -7861,7 +7981,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(186); + var node = createNode(187); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token === 37 || isStartOfExpression())) { @@ -7875,8 +7995,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(176, identifier.pos); - var parameter = createNode(138, identifier.pos); + var node = createNode(177, identifier.pos); + var parameter = createNode(139, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -7987,7 +8107,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(176); + var node = createNode(177); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256); fillSignature(54, false, isAsync, !allowAmbiguity, node); @@ -8019,7 +8139,7 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(184, leftOperand.pos); + var node = createNode(185, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -8032,7 +8152,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 90 || t === 134; + return t === 90 || t === 135; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -8110,43 +8230,43 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(183, left.pos); + var node = createNode(184, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(191, left.pos); + var node = createNode(192, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(181); + var node = createNode(182); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(177); - nextToken(); - node.expression = parseSimpleUnaryExpression(); - return finishNode(node); - } - function parseTypeOfExpression() { var node = createNode(178); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } - function parseVoidExpression() { + function parseTypeOfExpression() { var node = createNode(179); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } + function parseVoidExpression() { + var node = createNode(180); + nextToken(); + node.expression = parseSimpleUnaryExpression(); + return finishNode(node); + } function isAwaitExpression() { if (token === 119) { if (inAwaitContext()) { @@ -8157,7 +8277,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(180); + var node = createNode(181); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -8176,7 +8296,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 173) { + if (simpleUnaryExpression.kind === 174) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -8224,7 +8344,7 @@ var ts; } function parseIncrementExpression() { if (token === 41 || token === 42) { - var node = createNode(181); + var node = createNode(182); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -8236,7 +8356,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 || token === 42) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(182, expression.pos); + var node = createNode(183, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -8259,7 +8379,7 @@ var ts; if (token === 17 || token === 21 || token === 19) { return expression; } - var node = createNode(168, expression.pos); + var node = createNode(169, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); @@ -8278,8 +8398,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 237) { - var node = createNode(235, opening.pos); + if (opening.kind === 238) { + var node = createNode(236, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -8289,14 +8409,14 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 236); + ts.Debug.assert(opening.kind === 237); result = opening; } if (inExpressionContext && token === 25) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(183, result.pos); + var badNode = createNode(184, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -8308,13 +8428,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(238, scanner.getStartPos()); + var node = createNode(239, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 238: + case 239: return parseJsxText(); case 15: return parseJsxExpression(false); @@ -8350,7 +8470,7 @@ var ts; var attributes = parseList(13, parseJsxAttribute); var node; if (token === 27) { - node = createNode(237, fullStart); + node = createNode(238, fullStart); scanJsxText(); } else { @@ -8362,7 +8482,7 @@ var ts; parseExpected(27, undefined, false); scanJsxText(); } - node = createNode(236, fullStart); + node = createNode(237, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -8373,7 +8493,7 @@ var ts; var elementName = parseIdentifierName(); while (parseOptional(21)) { scanJsxIdentifier(); - var node = createNode(135, elementName.pos); + var node = createNode(136, elementName.pos); node.left = elementName; node.right = parseIdentifierName(); elementName = finishNode(node); @@ -8381,7 +8501,7 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(242); + var node = createNode(243); parseExpected(15); if (token !== 16) { node.expression = parseAssignmentExpressionOrHigher(); @@ -8400,7 +8520,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(240); + var node = createNode(241); node.name = parseIdentifierName(); if (parseOptional(56)) { switch (token) { @@ -8415,7 +8535,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(241); + var node = createNode(242); parseExpected(15); parseExpected(22); node.expression = parseExpression(); @@ -8423,7 +8543,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(239); + var node = createNode(240); parseExpected(26); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -8436,7 +8556,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(173); + var node = createNode(174); parseExpected(25); node.type = parseType(); parseExpected(27); @@ -8447,7 +8567,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21); if (dotToken) { - var propertyAccess = createNode(168, expression.pos); + var propertyAccess = createNode(169, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); @@ -8455,7 +8575,7 @@ var ts; continue; } if (!inDecoratorContext() && parseOptional(19)) { - var indexedAccess = createNode(169, expression.pos); + var indexedAccess = createNode(170, expression.pos); indexedAccess.expression = expression; if (token !== 20) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -8469,7 +8589,7 @@ var ts; continue; } if (token === 11 || token === 12) { - var tagExpression = createNode(172, expression.pos); + var tagExpression = createNode(173, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 ? parseLiteralNode() @@ -8488,7 +8608,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(170, expression.pos); + var callExpr = createNode(171, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -8496,7 +8616,7 @@ var ts; continue; } else if (token === 17) { - var callExpr = createNode(170, expression.pos); + var callExpr = createNode(171, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -8591,28 +8711,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(174); + var node = createNode(175); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); return finishNode(node); } function parseSpreadElement() { - var node = createNode(187); + var node = createNode(188); parseExpected(22); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 ? parseSpreadElement() : - token === 24 ? createNode(189) : + token === 24 ? createNode(190) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(166); + var node = createNode(167); parseExpected(19); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024; @@ -8622,10 +8742,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(123)) { - return parseAccessorDeclaration(145, fullStart, decorators, modifiers); + return parseAccessorDeclaration(146, fullStart, decorators, modifiers); } else if (parseContextualModifier(129)) { - return parseAccessorDeclaration(146, fullStart, decorators, modifiers); + return parseAccessorDeclaration(147, fullStart, decorators, modifiers); } return undefined; } @@ -8646,7 +8766,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 || token === 16 || token === 56); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(248, fullStart); + var shorthandDeclaration = createNode(249, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56); @@ -8657,7 +8777,7 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(247, fullStart); + var propertyAssignment = createNode(248, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -8667,7 +8787,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(167); + var node = createNode(168); parseExpected(15); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024; @@ -8681,7 +8801,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(175); + var node = createNode(176); setModifiers(node, parseModifiers()); parseExpected(87); node.asteriskToken = parseOptionalToken(37); @@ -8703,7 +8823,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(171); + var node = createNode(172); parseExpected(92); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -8713,7 +8833,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(194); + var node = createNode(195); if (parseExpected(15, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -8741,12 +8861,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(196); + var node = createNode(197); parseExpected(23); return finishNode(node); } function parseIfStatement() { - var node = createNode(198); + var node = createNode(199); parseExpected(88); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8756,7 +8876,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(199); + var node = createNode(200); parseExpected(79); node.statement = parseStatement(); parseExpected(104); @@ -8767,7 +8887,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(200); + var node = createNode(201); parseExpected(104); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8790,21 +8910,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90)) { - var forInStatement = createNode(202, pos); + var forInStatement = createNode(203, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(134)) { - var forOfStatement = createNode(203, pos); + else if (parseOptional(135)) { + var forOfStatement = createNode(204, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(201, pos); + var forStatement = createNode(202, pos); forStatement.initializer = initializer; parseExpected(23); if (token !== 23 && token !== 18) { @@ -8822,7 +8942,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 205 ? 70 : 75); + parseExpected(kind === 206 ? 70 : 75); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -8830,7 +8950,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(206); + var node = createNode(207); parseExpected(94); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -8839,7 +8959,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(207); + var node = createNode(208); parseExpected(105); parseExpected(17); node.expression = allowInAnd(parseExpression); @@ -8848,7 +8968,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(243); + var node = createNode(244); parseExpected(71); node.expression = allowInAnd(parseExpression); parseExpected(54); @@ -8856,7 +8976,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(244); + var node = createNode(245); parseExpected(77); parseExpected(54); node.statements = parseList(3, parseStatement); @@ -8866,12 +8986,12 @@ var ts; return token === 71 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(208); + var node = createNode(209); parseExpected(96); parseExpected(17); node.expression = allowInAnd(parseExpression); parseExpected(18); - var caseBlock = createNode(222, scanner.getStartPos()); + var caseBlock = createNode(223, scanner.getStartPos()); parseExpected(15); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(16); @@ -8879,14 +8999,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(210); + var node = createNode(211); parseExpected(98); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(211); + var node = createNode(212); parseExpected(100); node.tryBlock = parseBlock(false); node.catchClause = token === 72 ? parseCatchClause() : undefined; @@ -8897,7 +9017,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(246); + var result = createNode(247); parseExpected(72); if (parseExpected(17)) { result.variableDeclaration = parseVariableDeclaration(); @@ -8907,7 +9027,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(212); + var node = createNode(213); parseExpected(76); parseSemicolon(); return finishNode(node); @@ -8916,13 +9036,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 && parseOptional(54)) { - var labeledStatement = createNode(209, fullStart); + var labeledStatement = createNode(210, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(197, fullStart); + var expressionStatement = createNode(198, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -8967,6 +9087,8 @@ var ts; return false; } continue; + case 134: + return nextToken() === 15; case 89: nextToken(); return token === 9 || token === 37 || @@ -9024,6 +9146,7 @@ var ts; case 125: case 126: case 132: + case 134: return true; case 112: case 110: @@ -9067,9 +9190,9 @@ var ts; case 86: return parseForOrForInOrForOfStatement(); case 75: - return parseBreakOrContinueStatement(204); - case 70: return parseBreakOrContinueStatement(205); + case 70: + return parseBreakOrContinueStatement(206); case 94: return parseReturnStatement(); case 105: @@ -9101,6 +9224,7 @@ var ts; case 112: case 115: case 113: + case 134: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -9127,6 +9251,7 @@ var ts; return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 81: return parseEnumDeclaration(fullStart, decorators, modifiers); + case 134: case 125: case 126: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -9139,7 +9264,7 @@ var ts; parseExportDeclaration(fullStart, decorators, modifiers); default: if (decorators || modifiers) { - var node = createMissingNode(233, true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(234, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -9160,16 +9285,16 @@ var ts; } function parseArrayBindingElement() { if (token === 24) { - return createNode(189); + return createNode(190); } - var node = createNode(165); + var node = createNode(166); node.dotDotDotToken = parseOptionalToken(22); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(165); + var node = createNode(166); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54) { @@ -9184,14 +9309,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(163); + var node = createNode(164); parseExpected(15); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(16); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(164); + var node = createNode(165); parseExpected(19); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(20); @@ -9210,7 +9335,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(213); + var node = createNode(214); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -9219,7 +9344,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(214); + var node = createNode(215); switch (token) { case 102: break; @@ -9233,7 +9358,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token === 134 && lookAhead(canFollowContextualOfKeyword)) { + if (token === 135 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -9248,7 +9373,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(195, fullStart); + var node = createNode(196, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -9256,7 +9381,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(216, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87); @@ -9269,7 +9394,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(144, pos); + var node = createNode(145, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(121); @@ -9278,7 +9403,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(143, fullStart); + var method = createNode(144, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -9291,7 +9416,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(141, fullStart); + var property = createNode(142, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -9387,7 +9512,7 @@ var ts; decorators = []; decorators.pos = decoratorStart; } - var decorator = createNode(139, decoratorStart); + var decorator = createNode(140, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -9443,7 +9568,7 @@ var ts; } function parseClassElement() { if (token === 23) { - var result = createNode(193); + var result = createNode(194); nextToken(); return finishNode(result); } @@ -9474,10 +9599,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 188); + return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 189); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 217); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -9512,7 +9637,7 @@ var ts; } function parseHeritageClause() { if (token === 83 || token === 106) { - var node = createNode(245); + var node = createNode(246); node.token = token; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); @@ -9521,7 +9646,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(190); + var node = createNode(191); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25) { node.typeArguments = parseBracketedList(18, parseType, 25, 27); @@ -9535,7 +9660,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217, fullStart); + var node = createNode(218, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107); @@ -9546,7 +9671,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218, fullStart); + var node = createNode(219, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132); @@ -9558,13 +9683,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(249, scanner.getStartPos()); + var node = createNode(250, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(219, fullStart); + var node = createNode(220, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81); @@ -9579,7 +9704,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(221, scanner.getStartPos()); + var node = createNode(222, scanner.getStartPos()); if (parseExpected(15)) { node.statements = parseList(1, parseStatement); parseExpected(16); @@ -9590,7 +9715,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(220, fullStart); + var node = createNode(221, fullStart); var namespaceFlag = flags & 65536; node.decorators = decorators; setModifiers(node, modifiers); @@ -9602,16 +9727,25 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(220, fullStart); + var node = createNode(221, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - node.name = parseLiteralNode(true); + if (token === 134) { + node.name = parseIdentifier(); + node.flags |= 2097152; + } + else { + node.name = parseLiteralNode(true); + } node.body = parseModuleBlock(); return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = modifiers ? modifiers.flags : 0; - if (parseOptional(126)) { + if (token === 134) { + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + else if (parseOptional(126)) { flags |= 65536; } else { @@ -9639,7 +9773,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 24 && token !== 133) { - var importEqualsDeclaration = createNode(223, fullStart); + var importEqualsDeclaration = createNode(224, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -9649,7 +9783,7 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(224, fullStart); + var importDeclaration = createNode(225, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); if (identifier || @@ -9663,13 +9797,13 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(225, fullStart); + var importClause = createNode(226, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(24)) { - importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(227); + importClause.namedBindings = token === 37 ? parseNamespaceImport() : parseNamedImportsOrExports(228); } return finishNode(importClause); } @@ -9679,7 +9813,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(234); + var node = createNode(235); parseExpected(127); parseExpected(17); node.expression = parseModuleSpecifier(); @@ -9697,7 +9831,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(226); + var namespaceImport = createNode(227); parseExpected(37); parseExpected(116); namespaceImport.name = parseIdentifier(); @@ -9705,14 +9839,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(21, kind === 227 ? parseImportSpecifier : parseExportSpecifier, 15, 16); + node.elements = parseBracketedList(21, kind === 228 ? parseImportSpecifier : parseExportSpecifier, 15, 16); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(232); + return parseImportOrExportSpecifier(233); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(228); + return parseImportOrExportSpecifier(229); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -9731,13 +9865,13 @@ var ts; else { node.name = identifierName; } - if (kind === 228 && checkIdentifierIsKeyword) { + if (kind === 229 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230, fullStart); + var node = createNode(231, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37)) { @@ -9745,7 +9879,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(231); + node.exportClause = parseNamedImportsOrExports(232); if (token === 133 || (token === 9 && !scanner.hasPrecedingLineBreak())) { parseExpected(133); node.moduleSpecifier = parseModuleSpecifier(); @@ -9755,7 +9889,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(229, fullStart); + var node = createNode(230, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56)) { @@ -9827,10 +9961,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 - || node.kind === 223 && node.moduleReference.kind === 234 - || node.kind === 224 - || node.kind === 229 + || node.kind === 224 && node.moduleReference.kind === 235 + || node.kind === 225 || node.kind === 230 + || node.kind === 231 ? node : undefined; }); @@ -9865,7 +9999,7 @@ var ts; function parseJSDocTypeExpression(start, length) { scanner.setText(sourceText, start, length); token = nextToken(); - var result = createNode(251); + var result = createNode(252); parseExpected(15); result.type = parseJSDocTopLevelType(); parseExpected(16); @@ -9876,12 +10010,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47) { - var unionType = createNode(255, type.pos); + var unionType = createNode(256, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56) { - var optionalType = createNode(262, type.pos); + var optionalType = createNode(263, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -9892,20 +10026,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19) { - var arrayType = createNode(254, type.pos); + var arrayType = createNode(255, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20); type = finishNode(arrayType); } else if (token === 53) { - var nullableType = createNode(257, type.pos); + var nullableType = createNode(258, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49) { - var nonNullableType = createNode(258, type.pos); + var nonNullableType = createNode(259, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -9949,27 +10083,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(266); + var result = createNode(267); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(265); + var result = createNode(266); nextToken(); parseExpected(54); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(264); + var result = createNode(265); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(263); + var result = createNode(264); nextToken(); parseExpected(17); result.parameters = parseDelimitedList(22, parseJSDocParameter); @@ -9982,12 +10116,12 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(138); + var parameter = createNode(139); parameter.type = parseJSDocType(); return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(261); + var result = createNode(262); result.name = parseSimplePropertyName(); while (parseOptional(21)) { if (token === 25) { @@ -10016,13 +10150,13 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(135, left.pos); + var result = createNode(136, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(259); + var result = createNode(260); nextToken(); result.members = parseDelimitedList(24, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -10030,7 +10164,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(260); + var result = createNode(261); result.name = parseSimplePropertyName(); if (token === 54) { nextToken(); @@ -10039,13 +10173,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(258); + var result = createNode(259); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(256); + var result = createNode(257); nextToken(); result.types = parseDelimitedList(25, parseJSDocType); checkForTrailingComma(result.types); @@ -10059,7 +10193,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(255); + var result = createNode(256); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18); @@ -10077,7 +10211,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(252); + var result = createNode(253); nextToken(); return finishNode(result); } @@ -10090,11 +10224,11 @@ var ts; token === 27 || token === 56 || token === 47) { - var result = createNode(253, pos); + var result = createNode(254, pos); return finishNode(result); } else { - var result = createNode(257, pos); + var result = createNode(258, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -10165,7 +10299,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(267, start); + var result = createNode(268, start); result.tags = tags; return finishNode(result, end); } @@ -10202,7 +10336,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(268, atToken.pos); + var result = createNode(269, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -10253,7 +10387,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(269, atToken.pos); + var result = createNode(270, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -10263,16 +10397,6 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270; })) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); - } - var result = createNode(270, atToken.pos); - result.atToken = atToken; - result.tagName = tagName; - result.typeExpression = tryParseTypeExpression(); - return finishNode(result, pos); - } - function handleTypeTag(atToken, tagName) { if (ts.forEach(tags, function (t) { return t.kind === 271; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } @@ -10282,10 +10406,20 @@ var ts; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } - function handleTemplateTag(atToken, tagName) { + function handleTypeTag(atToken, tagName) { if (ts.forEach(tags, function (t) { return t.kind === 272; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } + var result = createNode(272, atToken.pos); + result.atToken = atToken; + result.tagName = tagName; + result.typeExpression = tryParseTypeExpression(); + return finishNode(result, pos); + } + function handleTemplateTag(atToken, tagName) { + if (ts.forEach(tags, function (t) { return t.kind === 273; })) { + parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); + } var typeParameters = []; typeParameters.pos = pos; while (true) { @@ -10296,7 +10430,7 @@ var ts; parseErrorAtPosition(startPos, 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(137, name_8.pos); + var typeParameter = createNode(138, name_8.pos); typeParameter.name = name_8; finishNode(typeParameter, pos); typeParameters.push(typeParameter); @@ -10307,7 +10441,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(272, atToken.pos); + var result = createNode(273, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -10629,16 +10763,16 @@ var ts; : 4; } function getModuleInstanceState(node) { - if (node.kind === 217 || node.kind === 218) { + if (node.kind === 218 || node.kind === 219) { return 0; } else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 224 || node.kind === 223) && !(node.flags & 2)) { + else if ((node.kind === 225 || node.kind === 224) && !(node.flags & 2)) { return 0; } - else if (node.kind === 221) { + else if (node.kind === 222) { var state = 0; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -10654,7 +10788,7 @@ var ts; }); return state; } - else if (node.kind === 220) { + else if (node.kind === 221) { return getModuleInstanceState(node.body); } else { @@ -10682,6 +10816,10 @@ var ts; var labelStack; var labelIndexMap; var implicitLabels; + var hasClassExtends; + var hasAsyncFunctions; + var hasDecorators; + var hasParameterDecorators; var inStrictMode; var symbolCount = 0; var Symbol; @@ -10708,6 +10846,10 @@ var ts; labelStack = undefined; labelIndexMap = undefined; implicitLabels = undefined; + hasClassExtends = false; + hasAsyncFunctions = false; + hasDecorators = false; + hasParameterDecorators = false; } return bindSourceFile; function createSymbol(flags, name) { @@ -10730,17 +10872,17 @@ var ts; if (symbolFlags & 107455) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 221)) { symbol.valueDeclaration = node; } } } function getDeclarationName(node) { if (node.name) { - if (node.kind === 220 && node.name.kind === 9) { - return "\"" + node.name.text + "\""; + if (ts.isAmbientModule(node)) { + return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 136) { + if (node.name.kind === 137) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression.kind)) { return nameExpression.text; @@ -10751,21 +10893,21 @@ var ts; return node.name.text; } switch (node.kind) { - case 144: + case 145: return "__constructor"; - case 152: - case 147: - return "__call"; case 153: case 148: - return "__new"; + return "__call"; + case 154: case 149: + return "__new"; + case 150: return "__index"; - case 230: + case 231: return "__export"; - case 229: + case 230: return node.isExportEquals ? "export=" : "default"; - case 183: + case 184: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2: return "export="; @@ -10777,8 +10919,8 @@ var ts; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 215: case 216: + case 217: return node.flags & 512 ? "default" : undefined; } } @@ -10826,7 +10968,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2; if (symbolFlags & 8388608) { - if (node.kind === 232 || (node.kind === 223 && hasExportModifier)) { + if (node.kind === 233 || (node.kind === 224 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -10834,7 +10976,7 @@ var ts; } } else { - if (hasExportModifier || container.flags & 131072) { + if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 131072)) { var exportKind = (symbolFlags & 107455 ? 1048576 : 0) | (symbolFlags & 793056 ? 2097152 : 0) | (symbolFlags & 1536 ? 4194304 : 0); @@ -10873,10 +11015,11 @@ var ts; var kind = node.kind; var flags = node.flags; flags &= ~1572864; - if (kind === 217) { + flags &= ~62914560; + if (kind === 218) { seenThisKeyword = false; } - var saveState = kind === 250 || kind === 221 || ts.isFunctionLikeKind(kind); + var saveState = kind === 251 || kind === 222 || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -10894,9 +11037,23 @@ var ts; flags |= 1048576; } } - if (kind === 217) { + if (kind === 218) { flags = seenThisKeyword ? flags | 262144 : flags & ~262144; } + if (kind === 251) { + if (hasClassExtends) { + flags |= 4194304; + } + if (hasDecorators) { + flags |= 8388608; + } + if (hasParameterDecorators) { + flags |= 16777216; + } + if (hasAsyncFunctions) { + flags |= 33554432; + } + } node.flags = flags; if (saveState) { hasExplicitReturn = savedHasExplicitReturn; @@ -10915,40 +11072,40 @@ var ts; return; } switch (node.kind) { - case 200: + case 201: bindWhileStatement(node); break; - case 199: + case 200: bindDoStatement(node); break; - case 201: + case 202: bindForStatement(node); break; - case 202: case 203: + case 204: bindForInOrForOfStatement(node); break; - case 198: + case 199: bindIfStatement(node); break; - case 206: - case 210: + case 207: + case 211: bindReturnOrThrow(node); break; + case 206: case 205: - case 204: bindBreakOrContinueStatement(node); break; - case 211: + case 212: bindTryStatement(node); break; - case 208: + case 209: bindSwitchStatement(node); break; - case 222: + case 223: bindCaseBlock(node); break; - case 209: + case 210: bindLabeledStatement(node); break; default: @@ -11010,14 +11167,14 @@ var ts; } function bindReturnOrThrow(n) { bind(n.expression); - if (n.kind === 206) { + if (n.kind === 207) { hasExplicitReturn = true; } currentReachabilityState = 4; } function bindBreakOrContinueStatement(n) { bind(n.label); - var isValidJump = jumpToLabel(n.label, n.kind === 205 ? currentReachabilityState : 4); + var isValidJump = jumpToLabel(n.label, n.kind === 206 ? currentReachabilityState : 4); if (isValidJump) { currentReachabilityState = 4; } @@ -11038,7 +11195,7 @@ var ts; var postSwitchLabel = pushImplicitLabel(); bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 245; }); var postSwitchState = hasDefault && currentReachabilityState !== 2 ? 4 : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); } @@ -11063,37 +11220,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 188: - case 216: + case 189: case 217: - case 219: - case 155: - case 167: + case 218: + case 220: + case 156: + case 168: return 1; - case 147: case 148: case 149: - case 143: - case 142: - case 215: + case 150: case 144: + case 143: + case 216: case 145: case 146: - case 152: + case 147: case 153: - case 175: + case 154: case 176: - case 220: - case 250: - case 218: + case 177: + case 221: + case 251: + case 219: return 5; - case 246: - case 201: + case 247: case 202: case 203: - case 222: + case 204: + case 223: return 2; - case 194: + case 195: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -11109,33 +11266,33 @@ var ts; } function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 220: + case 221: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 250: + case 251: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 188: - case 216: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 219: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 155: - case 167: + case 189: case 217: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 220: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 156: + case 168: + case 218: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 152: case 153: - case 147: + case 154: case 148: case 149: - case 143: - case 142: + case 150: case 144: + case 143: case 145: case 146: - case 215: - case 175: + case 147: + case 216: case 176: - case 218: + case 177: + case 219: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -11150,11 +11307,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 250 ? node : node.body; - if (body.kind === 250 || body.kind === 221) { + var body = node.kind === 251 ? node : node.body; + if (body.kind === 251 || body.kind === 222) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 230 || stat.kind === 229) { + if (stat.kind === 231 || stat.kind === 230) { return true; } } @@ -11171,7 +11328,10 @@ var ts; } function bindModuleDeclaration(node) { setExportContextFlag(node); - if (node.name.kind === 9) { + if (ts.isAmbientModule(node)) { + if (node.flags & 2) { + errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); + } declareSymbolAndAddToSymbolTable(node, 512, 106639); } else { @@ -11213,7 +11373,7 @@ var ts; continue; } var identifier = prop.name; - var currentKind = prop.kind === 247 || prop.kind === 248 || prop.kind === 143 + var currentKind = prop.kind === 248 || prop.kind === 249 || prop.kind === 144 ? 1 : 2; var existingKind = seen[identifier.text]; @@ -11235,10 +11395,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 220: + case 221: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 250: + case 251: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -11360,17 +11520,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 250: - case 221: + case 251: + case 222: updateStrictModeStatementList(node.statements); return; - case 194: + case 195: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 216: - case 188: + case 217: + case 189: inStrictMode = true; return; } @@ -11395,7 +11555,7 @@ var ts; switch (node.kind) { case 69: return checkStrictModeIdentifier(node); - case 183: + case 184: if (ts.isInJavaScriptFile(node)) { var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { @@ -11418,94 +11578,91 @@ var ts; } } return checkStrictModeBinaryExpression(node); - case 246: + case 247: return checkStrictModeCatchClause(node); - case 177: + case 178: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 182: + case 183: return checkStrictModePostfixUnaryExpression(node); - case 181: + case 182: return checkStrictModePrefixUnaryExpression(node); - case 207: + case 208: return checkStrictModeWithStatement(node); - case 161: + case 162: seenThisKeyword = true; return; - case 150: + case 151: return checkTypePredicate(node); - case 137: - return declareSymbolAndAddToSymbolTable(node, 262144, 530912); case 138: + return declareSymbolAndAddToSymbolTable(node, 262144, 530912); + case 139: return bindParameter(node); - case 213: - case 165: + case 214: + case 166: return bindVariableDeclarationOrBindingElement(node); + case 142: case 141: - case 140: return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455); - case 247: case 248: - return bindPropertyOrMethodOrAccessor(node, 4, 107455); case 249: + return bindPropertyOrMethodOrAccessor(node, 4, 107455); + case 250: return bindPropertyOrMethodOrAccessor(node, 8, 107455); - case 147: case 148: case 149: + case 150: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 143: - case 142: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); - case 215: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, 16, 106927); case 144: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 143: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263); + case 216: + return bindFunctionDeclaration(node); case 145: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 146: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 147: return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 152: case 153: + case 154: return bindFunctionOrConstructorType(node); - case 155: + case 156: return bindAnonymousDeclaration(node, 2048, "__type"); - case 167: + case 168: return bindObjectLiteralExpression(node); - case 175: case 176: - checkStrictModeFunctionName(node); - var bindingName = node.name ? node.name.text : "__function"; - return bindAnonymousDeclaration(node, 16, bindingName); - case 170: + case 177: + return bindFunctionExpression(node); + case 171: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 188: - case 216: - return bindClassLikeDeclaration(node); + case 189: case 217: - return bindBlockScopedDeclaration(node, 64, 792960); + return bindClassLikeDeclaration(node); case 218: - return bindBlockScopedDeclaration(node, 524288, 793056); + return bindBlockScopedDeclaration(node, 64, 792960); case 219: - return bindEnumDeclaration(node); + return bindBlockScopedDeclaration(node, 524288, 793056); case 220: + return bindEnumDeclaration(node); + case 221: return bindModuleDeclaration(node); - case 223: - case 226: - case 228: - case 232: - return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); - case 225: - return bindImportClause(node); - case 230: - return bindExportDeclaration(node); + case 224: + case 227: case 229: + case 233: + return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608); + case 226: + return bindImportClause(node); + case 231: + return bindExportDeclaration(node); + case 230: return bindExportAssignment(node); - case 250: + case 251: return bindSourceFileIfExternalModule(); } } @@ -11514,7 +11671,7 @@ var ts; if (parameterName && parameterName.kind === 69) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 161) { + if (parameterName && parameterName.kind === 162) { seenThisKeyword = true; } bind(type); @@ -11529,7 +11686,7 @@ var ts; bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 229 ? node.expression : node.right; + var boundExpression = node.kind === 230 ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); } @@ -11568,7 +11725,7 @@ var ts; bindExportAssignment(node); } function bindThisPropertyAssignment(node) { - if (container.kind === 175 || container.kind === 215) { + if (container.kind === 176 || container.kind === 216) { container.symbol.members = container.symbol.members || {}; declareSymbol(container.symbol.members, container.symbol, node, 4, 107455); } @@ -11590,7 +11747,15 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 216) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { + hasClassExtends = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } + if (node.kind === 217) { bindBlockScopedDeclaration(node, 32, 899519); } else { @@ -11633,6 +11798,12 @@ var ts; } } function bindParameter(node) { + if (!ts.isDeclarationFile(file) && + !ts.isInAmbientContext(node) && + ts.nodeIsDecorated(node)) { + hasDecorators = true; + hasParameterDecorators = true; + } if (inStrictMode) { checkStrictModeEvalOrArguments(node, node.name); } @@ -11647,7 +11818,34 @@ var ts; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } } + function bindFunctionDeclaration(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, 16, 106927); + } + function bindFunctionExpression(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.text : "__function"; + return bindAnonymousDeclaration(node, 16, bindingName); + } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } return ts.hasDynamicName(node) ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); @@ -11707,15 +11905,15 @@ var ts; function checkUnreachable(node) { switch (currentReachabilityState) { case 4: - var reportError = (ts.isStatement(node) && node.kind !== 196) || - node.kind === 216 || - (node.kind === 220 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 219 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatement(node) && node.kind !== 197) || + node.kind === 217 || + (node.kind === 221 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 220 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8; var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 195 || + (node.kind !== 196 || ts.getCombinedNodeFlags(node.declarationList) & 24576 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -11789,6 +11987,7 @@ var ts; getTypeCount: function () { return typeCount; }, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getNarrowedTypeOfSymbol, @@ -11803,6 +12002,7 @@ var ts; getSymbolsInScope: getSymbolsInScope, getSymbolAtLocation: getSymbolAtLocation, getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, + getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, getTypeAtLocation: getTypeOfNode, typeToString: typeToString, getSymbolDisplayBuilder: getSymbolDisplayBuilder, @@ -11876,11 +12076,6 @@ var ts; var unionTypes = {}; var intersectionTypes = {}; var stringLiteralTypes = {}; - var emitExtends = false; - var emitDecorate = false; - var emitParam = false; - var emitAwaiter = false; - var emitGenerator = false; var resolutionTargets = []; var resolutionResults = []; var resolutionPropertyNames = []; @@ -12013,7 +12208,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 220 && source.valueDeclaration.kind !== 220))) { + (target.valueDeclaration.kind === 221 && source.valueDeclaration.kind !== 221))) { target.valueDeclaration = source.valueDeclaration; } ts.forEach(source.declarations, function (node) { @@ -12067,6 +12262,24 @@ var ts; } } } + function mergeModuleAugmentation(moduleName) { + var moduleAugmentation = moduleName.parent; + if (moduleAugmentation.symbol.valueDeclaration !== moduleAugmentation) { + ts.Debug.assert(moduleAugmentation.symbol.declarations.length > 1); + return; + } + if (ts.isGlobalScopeAugmentation(moduleAugmentation)) { + mergeSymbolTable(globals, moduleAugmentation.symbol.exports); + } + else { + var mainModule = resolveExternalModuleNameWorker(moduleName, moduleName, ts.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found); + if (!mainModule) { + return; + } + mainModule = mainModule.flags & 33554432 ? mainModule : cloneSymbol(mainModule); + mergeSymbol(mainModule, moduleAugmentation.symbol); + } + } function addToSymbolTable(target, source, message) { for (var id in source) { if (ts.hasProperty(source, id)) { @@ -12092,17 +12305,8 @@ var ts; var nodeId = getNodeId(node); return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } - function getSourceFile(node) { - return ts.getAncestor(node, 250); - } function isGlobalSourceFile(node) { - return node.kind === 250 && !ts.isExternalOrCommonJsModule(node); - } - function isPrimitiveApparentType(type) { - return type === globalStringType || - type === globalNumberType || - type === globalBooleanType || - type === globalESSymbolType; + return node.kind === 251 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -12140,18 +12344,18 @@ var ts; return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); } if (declaration.pos <= usage.pos) { - return declaration.kind !== 213 || + return declaration.kind !== 214 || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 195 || - declaration.parent.parent.kind === 201) { + if (declaration.parent.parent.kind === 196 || + declaration.parent.parent.kind === 202) { return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 203 || - declaration.parent.parent.kind === 202) { + else if (declaration.parent.parent.kind === 204 || + declaration.parent.parent.kind === 203) { var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); } @@ -12167,7 +12371,7 @@ var ts; return true; } var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 141 && + current.parent.kind === 142 && (current.parent.flags & 64) === 0 && current.parent.initializer === current; if (initializerOfNonStaticProperty) { @@ -12192,15 +12396,15 @@ var ts; if (meaning & result.flags & 793056) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 138 || - lastLocation.kind === 137 + lastLocation.kind === 139 || + lastLocation.kind === 138 : false; } if (meaning & 107455 && result.flags & 1) { useResult = - lastLocation.kind === 138 || + lastLocation.kind === 139 || (lastLocation === location.type && - result.valueDeclaration.kind === 138); + result.valueDeclaration.kind === 139); } } if (useResult) { @@ -12212,13 +12416,12 @@ var ts; } } switch (location.kind) { - case 250: + case 251: if (!ts.isExternalOrCommonJsModule(location)) break; - case 220: + case 221: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 250 || - (location.kind === 220 && location.name.kind === 9)) { + if (location.kind === 251 || ts.isAmbientModule(location)) { if (result = moduleExports["default"]) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.name === name) { @@ -12228,7 +12431,7 @@ var ts; } if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 && - ts.getDeclarationOfKind(moduleExports[name], 232)) { + ts.getDeclarationOfKind(moduleExports[name], 233)) { break; } } @@ -12236,13 +12439,13 @@ var ts; break loop; } break; - case 219: + case 220: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 142: case 141: - case 140: if (ts.isClassLike(location.parent) && !(location.flags & 64)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -12252,9 +12455,9 @@ var ts; } } break; - case 216: - case 188: case 217: + case 189: + case 218: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { if (lastLocation && lastLocation.flags & 64) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -12262,7 +12465,7 @@ var ts; } break loop; } - if (location.kind === 188 && meaning & 32) { + if (location.kind === 189 && meaning & 32) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -12270,28 +12473,28 @@ var ts; } } break; - case 136: + case 137: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 217) { + if (ts.isClassLike(grandparent) || grandparent.kind === 218) { if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 215: - case 176: + case 147: + case 216: + case 177: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 175: + case 176: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -12304,8 +12507,8 @@ var ts; } } break; - case 139: - if (location.parent && location.parent.kind === 138) { + case 140: + if (location.parent && location.parent.kind === 139) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -12321,7 +12524,9 @@ var ts; } if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + if (!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg)) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + } } return undefined; } @@ -12340,11 +12545,40 @@ var ts; } return result; } + function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { + if (!errorLocation || (errorLocation.kind === 69 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + return false; + } + var container = ts.getThisContainer(errorLocation, true); + var location = container; + while (location) { + if (ts.isClassLike(location.parent)) { + var classSymbol = getSymbolOfNode(location.parent); + if (!classSymbol) { + break; + } + var constructorType = getTypeOfSymbol(classSymbol); + if (getPropertyOfType(constructorType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg), symbolToString(classSymbol)); + return true; + } + if (location === container && !(location.flags & 64)) { + var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; + if (getPropertyOfType(instanceType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + return true; + } + } + } + location = location.parent; + } + return false; + } function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert((result.flags & 2) !== 0); var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 214), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -12361,10 +12595,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 223) { + if (node.kind === 224) { return node; } - while (node && node.kind !== 224) { + while (node && node.kind !== 225) { node = node.parent; } return node; @@ -12374,7 +12608,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 234) { + if (node.moduleReference.kind === 235) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -12458,17 +12692,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 223: + case 224: return getTargetOfImportEqualsDeclaration(node); - case 225: - return getTargetOfImportClause(node); case 226: + return getTargetOfImportClause(node); + case 227: return getTargetOfNamespaceImport(node); - case 228: - return getTargetOfImportSpecifier(node); - case 232: - return getTargetOfExportSpecifier(node); case 229: + return getTargetOfImportSpecifier(node); + case 233: + return getTargetOfExportSpecifier(node); + case 230: return getTargetOfExportAssignment(node); } } @@ -12510,10 +12744,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 229) { + if (node.kind === 230) { checkExpressionCached(node.expression); } - else if (node.kind === 232) { + else if (node.kind === 233) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -12523,17 +12757,17 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 223); + importDeclaration = ts.getAncestor(entityName, 224); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 69 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 69 || entityName.parent.kind === 135) { + if (entityName.kind === 69 || entityName.parent.kind === 136) { return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 223); + ts.Debug.assert(entityName.parent.kind === 224); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -12552,9 +12786,9 @@ var ts; return undefined; } } - else if (name.kind === 135 || name.kind === 168) { - var left = name.kind === 135 ? name.left : name.expression; - var right = name.kind === 135 ? name.right : name.name; + else if (name.kind === 136 || name.kind === 169) { + var left = name.kind === 136 ? name.left : name.expression; + var right = name.kind === 136 ? name.right : name.name; var namespace = resolveEntityName(left, 1536, ignoreErrors); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -12574,6 +12808,9 @@ var ts; return symbol.flags & meaning ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + } + function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError) { if (moduleReferenceExpression.kind !== 9) { return; } @@ -12586,19 +12823,24 @@ var ts; if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512); if (symbol) { - return symbol; + return getMergedSymbol(symbol); } } - var resolvedModule = ts.getResolvedModule(getSourceFile(location), moduleReferenceLiteral.text); + var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReferenceLiteral.text); var sourceFile = resolvedModule && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - return sourceFile.symbol; + return getMergedSymbol(sourceFile.symbol); } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); - return; + if (moduleNotFoundError) { + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + } + return undefined; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); + if (moduleNotFoundError) { + error(moduleReferenceLiteral, moduleNotFoundError, moduleName); + } + return undefined; } function resolveExternalModuleSymbol(moduleSymbol) { return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; @@ -12709,7 +12951,7 @@ var ts; var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 144 && ts.nodeIsPresent(member.body)) { + if (member.kind === 145 && ts.nodeIsPresent(member.body)) { return member; } } @@ -12775,17 +13017,17 @@ var ts; } } switch (location_1.kind) { - case 250: + case 251: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 220: + case 221: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 216: case 217: + case 218: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -12818,7 +13060,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233)) { if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -12847,7 +13089,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -12902,8 +13144,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 220 && declaration.name.kind === 9) || - (declaration.kind === 250 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 251 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -12935,11 +13176,11 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 154) { + if (entityName.parent.kind === 155) { meaning = 107455 | 1048576; } - else if (entityName.kind === 135 || entityName.kind === 168 || - entityName.parent.kind === 223) { + else if (entityName.kind === 136 || entityName.kind === 169 || + entityName.parent.kind === 224) { meaning = 1536; } else { @@ -12990,15 +13231,20 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = type.symbol.declarations[0].parent; - while (node.kind === 160) { + while (node.kind === 161) { node = node.parent; } - if (node.kind === 218) { + if (node.kind === 219) { return getSymbolOfNode(node); } } return undefined; } + function isTopLevelInExternalModuleAugmentation(node) { + return node && node.parent && + node.parent.kind === 222 && + ts.isExternalModuleAugmentation(node.parent.parent); + } function getSymbolDisplayBuilder() { function getNameOfSymbol(symbol) { if (symbol.declarations && symbol.declarations.length) { @@ -13007,10 +13253,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 188: + case 189: return "(Anonymous class)"; - case 175: case 176: + case 177: return "(Anonymous function)"; } } @@ -13224,7 +13470,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 250 || declaration.parent.kind === 221; + return declaration.parent.kind === 251 || declaration.parent.kind === 222; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -13478,60 +13724,63 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 165: + case 166: return isDeclarationVisible(node.parent.parent); - case 213: + case 214: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 220: - case 216: + case 221: case 217: case 218: - case 215: case 219: - case 223: + case 216: + case 220: + case 224: + if (ts.isExternalModuleAugmentation(node)) { + return true; + } var parent_4 = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 2) && - !(node.kind !== 223 && parent_4.kind !== 250 && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 224 && parent_4.kind !== 251 && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } return isDeclarationVisible(parent_4); - case 141: - case 140: - case 145: - case 146: - case 143: case 142: + case 141: + case 146: + case 147: + case 144: + case 143: if (node.flags & (16 | 32)) { return false; } - case 144: - case 148: - case 147: + case 145: case 149: - case 138: - case 221: - case 152: + case 148: + case 150: + case 139: + case 222: case 153: - case 155: - case 151: + case 154: case 156: + case 152: case 157: case 158: case 159: case 160: + case 161: return isDeclarationVisible(node.parent); - case 225: case 226: - case 228: - return false; - case 137: - case 250: - return true; + case 227: case 229: return false; + case 138: + case 251: + return true; + case 230: + return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } @@ -13539,10 +13788,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 229) { + if (node.parent && node.parent.kind === 230) { exportSymbol = resolveName(node.parent, node.text, 107455 | 793056 | 1536 | 8388608, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 232) { + else if (node.parent.kind === 233) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -13564,7 +13813,9 @@ var ts; var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); - buildVisibleNodeList(importSymbol.declarations); + if (importSymbol) { + buildVisibleNodeList(importSymbol.declarations); + } } }); } @@ -13617,10 +13868,10 @@ var ts; } function getDeclarationContainer(node) { node = ts.getRootDeclaration(node); - return node.kind === 213 ? node.parent.parent.parent : node.parent; + return node.kind === 214 ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { - var classType = getDeclaredTypeOfSymbol(prototype.parent); + var classType = getDeclaredTypeOfSymbol(getMergedSymbol(prototype.parent)); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfPropertyOfType(type, name) { @@ -13641,7 +13892,7 @@ var ts; case 9: case 8: return name.text; - case 136: + case 137: if (ts.isStringOrNumericLiteral(name.expression.kind)) { return name.expression.text; } @@ -13649,7 +13900,7 @@ var ts; return undefined; } function isComputedNonLiteralName(name) { - return name.kind === 136 && !ts.isStringOrNumericLiteral(name.expression.kind); + return name.kind === 137 && !ts.isStringOrNumericLiteral(name.expression.kind); } function getTypeForBindingElement(declaration) { var pattern = declaration.parent; @@ -13664,7 +13915,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 163) { + if (pattern.kind === 164) { var name_10 = declaration.propertyName || declaration.name; if (isComputedNonLiteralName(name_10)) { return anyType; @@ -13702,10 +13953,10 @@ var ts; return type; } function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 202) { - return anyType; - } if (declaration.parent.parent.kind === 203) { + return stringType; + } + if (declaration.parent.parent.kind === 204) { return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { @@ -13714,10 +13965,10 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138) { + if (declaration.kind === 139) { var func = declaration.parent; - if (func.kind === 146 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 145); + if (func.kind === 147 && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 146); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -13730,7 +13981,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 248) { + if (declaration.kind === 249) { return checkIdentifier(declaration.name); } if (ts.isBindingPattern(declaration.name)) { @@ -13777,7 +14028,7 @@ var ts; if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) { return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; } - var elementTypes = ts.map(elements, function (e) { return e.kind === 189 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 190 ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -13786,7 +14037,7 @@ var ts; return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 163 + return pattern.kind === 164 ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -13796,10 +14047,10 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - if (declaration.kind === 247) { + if (declaration.kind === 248) { return type; } - if (type.flags & 134217728 && (declaration.kind === 141 || declaration.kind === 140)) { + if (type.flags & 134217728 && (declaration.kind === 142 || declaration.kind === 141)) { return type; } return getWidenedType(type); @@ -13807,7 +14058,7 @@ var ts; type = declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && compilerOptions.noImplicitAny) { var root = ts.getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 138 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 139 && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -13820,17 +14071,17 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 246) { + if (declaration.parent.kind === 247) { return links.type = anyType; } - if (declaration.kind === 229) { + if (declaration.kind === 230) { return links.type = checkExpression(declaration.expression); } - if (declaration.kind === 183) { + if (declaration.kind === 184) { return links.type = checkExpression(declaration.right); } - if (declaration.kind === 168) { - if (declaration.parent.kind === 183) { + if (declaration.kind === 169) { + if (declaration.parent.kind === 184) { return links.type = checkExpressionCached(declaration.parent.right); } } @@ -13856,7 +14107,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 145) { + if (accessor.kind === 146) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -13872,8 +14123,8 @@ var ts; if (!pushTypeResolution(symbol, 0)) { return unknownType; } - var getter = ts.getDeclarationOfKind(symbol, 145); - var setter = ts.getDeclarationOfKind(symbol, 146); + var getter = ts.getDeclarationOfKind(symbol, 146); + var setter = ts.getDeclarationOfKind(symbol, 147); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -13899,7 +14150,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 145); + var getter_1 = ts.getDeclarationOfKind(symbol, 146); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -13988,9 +14239,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 216 || node.kind === 188 || - node.kind === 215 || node.kind === 175 || - node.kind === 143 || node.kind === 176) { + if (node.kind === 217 || node.kind === 189 || + node.kind === 216 || node.kind === 176 || + node.kind === 144 || node.kind === 177) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -13999,15 +14250,15 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 218); return appendOuterTypeParameters(undefined, declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 217 || node.kind === 216 || - node.kind === 188 || node.kind === 218) { + if (node.kind === 218 || node.kind === 217 || + node.kind === 189 || node.kind === 219) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -14130,7 +14381,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 218 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -14159,7 +14410,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217) { + if (declaration.kind === 218) { if (declaration.flags & 262144) { return false; } @@ -14208,7 +14459,7 @@ var ts; if (!pushTypeResolution(symbol, 2)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 218); + var declaration = ts.getDeclarationOfKind(symbol, 219); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -14239,7 +14490,7 @@ var ts; if (!links.declaredType) { var type = createType(512); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 137).constraint) { + if (!ts.getDeclarationOfKind(symbol, 138).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -14291,11 +14542,11 @@ var ts; case 120: case 131: case 103: - case 162: + case 163: return true; - case 156: + case 157: return isIndependentType(node.elementType); - case 151: + case 152: return isIndependentTypeReference(node); } return false; @@ -14304,7 +14555,7 @@ var ts; return node.type && isIndependentType(node.type) || !node.type && !node.initializer; } function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 144 && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 145 && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -14320,12 +14571,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 141: - case 140: - return isIndependentVariableLikeDeclaration(declaration); - case 143: case 142: + case 141: + return isIndependentVariableLikeDeclaration(declaration); case 144: + case 143: + case 145: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -14838,7 +15089,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 144 ? + var classType = declaration.kind === 145 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : @@ -14854,7 +15105,7 @@ var ts; paramSymbol = resolvedSymbol; } parameters.push(paramSymbol); - if (param.type && param.type.kind === 162) { + if (param.type && param.type.kind === 163) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -14877,8 +15128,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 145 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 146); + if (declaration.kind === 146 && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 147); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -14896,19 +15147,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 152: case 153: - case 215: - case 143: - case 142: + case 154: + case 216: case 144: - case 147: + case 143: + case 145: case 148: case 149: - case 145: + case 150: case 146: - case 175: + case 147: case 176: + case 177: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -14988,7 +15239,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 144 || signature.declaration.kind === 148; + var isConstructor = signature.declaration.kind === 145 || signature.declaration.kind === 149; var type = createObjectType(65536 | 262144); type.members = emptySymbols; type.properties = emptyArray; @@ -15025,7 +15276,7 @@ var ts; : undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 137).constraint; + return ts.getDeclarationOfKind(type.symbol, 138).constraint; } function hasConstraintReferenceTo(type, target) { var checked; @@ -15058,7 +15309,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 138).parent); } function getTypeListId(types) { if (types) { @@ -15144,7 +15395,7 @@ var ts; function getTypeFromTypeReference(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var typeNameOrExpression = node.kind === 151 ? node.typeName : + var typeNameOrExpression = node.kind === 152 ? node.typeName : ts.isSupportedExpressionWithTypeArguments(node) ? node.expression : undefined; var symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, 793056) || unknownSymbol; @@ -15170,9 +15421,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 216: case 217: - case 219: + case 218: + case 220: return declaration; } } @@ -15388,9 +15639,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 217)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 218)) { if (!(container.flags & 64) && - (container.kind !== 144 || ts.isNodeDescendentOf(node, container.body))) { + (container.kind !== 145 || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -15434,34 +15685,34 @@ var ts; return esSymbolType; case 103: return voidType; - case 161: - return getTypeFromThisTypeNode(node); case 162: + return getTypeFromThisTypeNode(node); + case 163: return getTypeFromStringLiteralTypeNode(node); - case 151: - return getTypeFromTypeReference(node); - case 150: - return getTypeFromPredicateTypeNode(node); - case 190: - return getTypeFromTypeReference(node); - case 154: - return getTypeFromTypeQueryNode(node); - case 156: - return getTypeFromArrayTypeNode(node); - case 157: - return getTypeFromTupleTypeNode(node); - case 158: - return getTypeFromUnionTypeNode(node); - case 159: - return getTypeFromIntersectionTypeNode(node); - case 160: - return getTypeFromTypeNode(node.type); case 152: - case 153: + return getTypeFromTypeReference(node); + case 151: + return getTypeFromPredicateTypeNode(node); + case 191: + return getTypeFromTypeReference(node); case 155: + return getTypeFromTypeQueryNode(node); + case 157: + return getTypeFromArrayTypeNode(node); + case 158: + return getTypeFromTupleTypeNode(node); + case 159: + return getTypeFromUnionTypeNode(node); + case 160: + return getTypeFromIntersectionTypeNode(node); + case 161: + return getTypeFromTypeNode(node.type); + case 153: + case 154: + case 156: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); case 69: - case 135: + case 136: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -15641,27 +15892,27 @@ var ts; return type; } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 175: case 176: + case 177: return isContextSensitiveFunctionLikeDeclaration(node); - case 167: + case 168: return ts.forEach(node.properties, isContextSensitive); - case 166: + case 167: return ts.forEach(node.elements, isContextSensitive); - case 184: + case 185: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 183: + case 184: return node.operatorToken.kind === 52 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 247: + case 248: return isContextSensitive(node.initializer); + case 144: case 143: - case 142: return isContextSensitiveFunctionLikeDeclaration(node); - case 174: + case 175: return isContextSensitive(node.expression); } return false; @@ -15689,6 +15940,9 @@ var ts; function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 : 0; } + function compareTypesAssignable(source, target) { + return checkTypeRelatedTo(source, target, assignableRelation, undefined) ? -1 : 0; + } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, undefined); } @@ -15702,39 +15956,52 @@ var ts; return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + return compareSignaturesRelated(source, target, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0; + } + function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { if (source === target) { - return true; + return -1; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1; var sourceMax = getNumNonRestParameters(source); var targetMax = getNumNonRestParameters(target); var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + var sourceParams = source.parameters; + var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + var s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); + var related = compareTypes(t, s, false) || compareTypes(s, t, reportErrors); if (!related) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); + } + return 0; } + result &= related; } if (!ignoreReturnTypes) { var targetReturnType = getReturnTypeOfSignature(target); if (targetReturnType === voidType) { - return true; + return result; } var sourceReturnType = getReturnTypeOfSignature(source); if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { if (!(sourceReturnType.flags & 134217728)) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); + } + return 0; } } - return isTypeAssignableTo(sourceReturnType, targetReturnType); + result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); } - return true; + return result; } function isImplementationCompatibleWithOverload(implementation, overload) { var erasedSource = getErasedSignature(implementation); @@ -15777,18 +16044,12 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; - var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); + var result = isRelatedTo(source, target, !!errorNode, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { - if (errorInfo.next === undefined) { - errorInfo = undefined; - elaborateErrors = true; - isRelatedTo(source, target, errorNode !== undefined, headMessage); - } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); } @@ -15796,6 +16057,7 @@ var ts; } return result !== 0; function reportError(message, arg0, arg1, arg2) { + ts.Debug.assert(!!errorNode); errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } function reportRelationError(message, source, target) { @@ -15916,10 +16178,10 @@ var ts; return result; } } - var apparentType = getApparentType(source); - if (apparentType.flags & (80896 | 32768) && target.flags & 80896) { - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { + var apparentSource = getApparentType(source); + if (apparentSource.flags & (80896 | 32768) && target.flags & 80896) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 16777726); + if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } @@ -15974,6 +16236,7 @@ var ts; var prop = _a[_i]; if (!isKnownProperty(target, prop.name)) { if (reportErrors) { + ts.Debug.assert(!!errorNode); errorNode = prop.valueDeclaration; reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); } @@ -16066,7 +16329,7 @@ var ts; var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - if (elaborateErrors && related === 2) { + if (reportErrors && related === 2) { relation[id] = 3; } else { @@ -16260,7 +16523,7 @@ var ts; shouldElaborateErrors = false; } } - if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + if (shouldElaborateErrors) { reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, undefined, undefined, kind)); } return 0; @@ -16269,65 +16532,7 @@ var ts; return result; } function signatureRelatedTo(source, target, reportErrors) { - if (source === target) { - return -1; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return 0; - } - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var checkCount; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - var result = -1; - for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); - if (!related) { - related = isRelatedTo(t, s, false); - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); - } - return 0; - } - errorInfo = saveErrorInfo; - } - result &= related; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) { - return result; - } - var sourceReturnType = getReturnTypeOfSignature(source); - if (targetReturnType.flags & 134217728 && targetReturnType.predicate.kind === 1) { - if (!(sourceReturnType.flags & 134217728)) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0; - } - } - return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); + return compareSignaturesRelated(source, target, false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -16690,22 +16895,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 142: case 141: - case 140: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 138: + case 139: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 215: + case 216: + case 144: case 143: - case 142: - case 145: case 146: - case 175: + case 147: case 176: + case 177: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -16994,10 +17199,10 @@ var ts; function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 154: + case 155: return true; case 69: - case 135: + case 136: node = node.parent; continue; default: @@ -17038,55 +17243,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 183: + case 184: return isAssignedInBinaryExpression(node); - case 213: - case 165: - return isAssignedInVariableDeclaration(node); - case 163: - case 164: + case 214: case 166: + return isAssignedInVariableDeclaration(node); + case 164: + case 165: case 167: case 168: case 169: case 170: case 171: - case 173: - case 191: + case 172: case 174: - case 181: - case 177: - case 180: - case 178: - case 179: + case 192: + case 175: case 182: - case 186: - case 184: + case 178: + case 181: + case 179: + case 180: + case 183: case 187: - case 194: + case 185: + case 188: case 195: - case 197: + case 196: case 198: case 199: case 200: case 201: case 202: case 203: - case 206: + case 204: case 207: case 208: - case 243: - case 244: case 209: + case 244: + case 245: case 210: case 211: - case 246: - case 235: + case 212: + case 247: case 236: - case 240: - case 241: case 237: + case 241: case 242: + case 238: + case 243: return ts.forEachChild(node, isAssignedIn); } return false; @@ -17096,7 +17301,7 @@ var ts; var type = getTypeOfSymbol(symbol); if (node && symbol.flags & 3) { if (isTypeAny(type) || type.flags & (80896 | 16384 | 512)) { - var declaration = ts.getDeclarationOfKind(symbol, 213); + var declaration = ts.getDeclarationOfKind(symbol, 214); var top_1 = declaration && getDeclarationContainer(declaration); var originalType = type; var nodeStack = []; @@ -17104,13 +17309,13 @@ var ts; var child = node; node = node.parent; switch (node.kind) { - case 198: + case 199: + case 185: case 184: - case 183: nodeStack.push({ node: node, child: child }); break; - case 250: - case 220: + case 251: + case 221: break loop; } if (node === top_1) { @@ -17121,17 +17326,17 @@ var ts; while (nodes = nodeStack.pop()) { var node_1 = nodes.node, child = nodes.child; switch (node_1.kind) { - case 198: + case 199: if (child !== node_1.expression) { type = narrowType(type, node_1.expression, child === node_1.thenStatement); } break; - case 184: + case 185: if (child !== node_1.condition) { type = narrowType(type, node_1.condition, child === node_1.whenTrue); } break; - case 183: + case 184: if (child === node_1.right) { if (node_1.operatorToken.kind === 51) { type = narrowType(type, node_1.left, true); @@ -17155,7 +17360,7 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 178 || expr.right.kind !== 9) { + if (expr.left.kind !== 179 || expr.right.kind !== 9) { return type; } var left = expr.left; @@ -17170,9 +17375,6 @@ var ts; if (typeInfo && typeInfo.type === undefinedType) { return type; } - if (!!(type.flags & 1) && typeInfo && assumeTrue) { - return typeInfo.type; - } var flags; if (typeInfo) { flags = typeInfo.flags; @@ -17182,6 +17384,9 @@ var ts; flags = 132 | 258 | 16777216 | 8; } if (!(type.flags & 16384)) { + if (assumeTrue && typeInfo && isTypeSubtypeOf(typeInfo.type, type)) { + return typeInfo.type; + } return filterUnion(type) ? type : emptyUnionType; } return getUnionType(ts.filter(type.types, filterUnion), true); @@ -17296,7 +17501,7 @@ var ts; return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); } function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { - if (expression.kind === 169 || expression.kind === 168) { + if (expression.kind === 170 || expression.kind === 169) { var accessExpression = expression; var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); if (possibleIdentifier.kind === 69 && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { @@ -17309,18 +17514,18 @@ var ts; expr = skipParenthesizedNodes(expr); switch (expr.kind) { case 69: - case 168: - case 135: + case 169: + case 136: return getSymbolOfEntityNameOrPropertyAccessExpression(expr); } } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 170: + case 171: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 174: + case 175: return narrowType(type, expr.expression, assumeTrue); - case 183: + case 184: var operator = expr.operatorToken.kind; if (operator === 32 || operator === 33) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -17335,20 +17540,20 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 181: + case 182: if (expr.operator === 49) { return narrowType(type, expr.operand, !assumeTrue); } break; + case 170: case 169: - case 168: return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } function skipParenthesizedNodes(expression) { - while (expression.kind === 174) { + while (expression.kind === 175) { expression = expression.expression; } return expression; @@ -17357,7 +17562,7 @@ var ts; var symbol = getResolvedSymbol(node); if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 176) { + if (container.kind === 177) { if (languageVersion < 2) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -17388,7 +17593,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 246) { + symbol.valueDeclaration.parent.kind === 247) { return; } var container; @@ -17397,11 +17602,11 @@ var ts; } else { container = symbol.valueDeclaration; - while (container.kind !== 214) { + while (container.kind !== 215) { container = container.parent; } container = container.parent; - if (container.kind === 195) { + if (container.kind === 196) { container = container.parent; } } @@ -17420,7 +17625,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 141 || container.kind === 144) { + if (container.kind === 142 || container.kind === 145) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -17431,29 +17636,29 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 176) { + if (container.kind === 177) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 220: + case 221: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 219: + case 220: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 144: + case 145: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 142: case 141: - case 140: if (container.flags & 64) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 136: + case 137: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -17464,7 +17669,7 @@ var ts; var symbol = getSymbolOfNode(container.parent); return container.flags & 64 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; } - if (ts.isInJavaScriptFile(node) && container.kind === 175) { + if (ts.isInJavaScriptFile(node) && container.kind === 176) { if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { var className = container.parent .left @@ -17480,18 +17685,18 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 138) { + if (n.kind === 139) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 170 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 171 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 176) { + while (container && container.kind === 177) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -17500,16 +17705,16 @@ var ts; var nodeCheckFlag = 0; if (!canUseSuperExpression) { var current = node; - while (current && current !== container && current.kind !== 136) { + while (current && current !== container && current.kind !== 137) { current = current.parent; } - if (current && current.kind === 136) { + if (current && current.kind === 137) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 168)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -17527,7 +17732,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 167) { + if (container.parent.kind === 168) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -17545,7 +17750,7 @@ var ts; } return unknownType; } - if (container.kind === 144 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 145 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; } @@ -17557,24 +17762,24 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 144; + return container.kind === 145; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 167) { + if (ts.isClassLike(container.parent) || container.parent.kind === 168) { if (container.flags & 64) { - return container.kind === 143 || - container.kind === 142 || - container.kind === 145 || - container.kind === 146; + return container.kind === 144 || + container.kind === 143 || + container.kind === 146 || + container.kind === 147; } else { - return container.kind === 143 || - container.kind === 142 || - container.kind === 145 || + return container.kind === 144 || + container.kind === 143 || container.kind === 146 || + container.kind === 147 || + container.kind === 142 || container.kind === 141 || - container.kind === 140 || - container.kind === 144; + container.kind === 145; } } } @@ -17609,7 +17814,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138) { + if (declaration.kind === 139) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -17642,7 +17847,7 @@ var ts; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 138 && node.parent.initializer === node) { + if (node.parent.kind === 139 && node.parent.initializer === node) { return true; } node = node.parent; @@ -17651,8 +17856,8 @@ var ts; } function getContextualReturnType(functionDecl) { if (functionDecl.type || - functionDecl.kind === 144 || - functionDecl.kind === 145 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 146))) { + functionDecl.kind === 145 || + functionDecl.kind === 146 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 147))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); @@ -17671,7 +17876,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 172) { + if (template.parent.kind === 173) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -17782,13 +17987,13 @@ var ts; var kind = attribute.kind; var jsxElement = attribute.parent; var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 240) { + if (attribute.kind === 241) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - else if (attribute.kind === 241) { + else if (attribute.kind === 242) { return attrsType; } ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); @@ -17806,40 +18011,40 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 213: - case 138: + case 214: + case 139: + case 142: case 141: - case 140: - case 165: - return getContextualTypeForInitializerExpression(node); - case 176: - case 206: - return getContextualTypeForReturnExpression(node); - case 186: - return getContextualTypeForYieldOperand(parent); - case 170: - case 171: - return getContextualTypeForArgument(parent, node); - case 173: - case 191: - return getTypeFromTypeNode(parent.type); - case 183: - return getContextualTypeForBinaryOperand(node); - case 247: - return getContextualTypeForObjectLiteralElement(parent); case 166: - return getContextualTypeForElementExpression(node); - case 184: - return getContextualTypeForConditionalOperand(node); - case 192: - ts.Debug.assert(parent.parent.kind === 185); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + return getContextualTypeForInitializerExpression(node); + case 177: + case 207: + return getContextualTypeForReturnExpression(node); + case 187: + return getContextualTypeForYieldOperand(parent); + case 171: + case 172: + return getContextualTypeForArgument(parent, node); case 174: + case 192: + return getTypeFromTypeNode(parent.type); + case 184: + return getContextualTypeForBinaryOperand(node); + case 248: + return getContextualTypeForObjectLiteralElement(parent); + case 167: + return getContextualTypeForElementExpression(node); + case 185: + return getContextualTypeForConditionalOperand(node); + case 193: + ts.Debug.assert(parent.parent.kind === 186); + return getContextualTypeForSubstitutionExpression(parent.parent, node); + case 175: return getContextualType(parent); - case 242: + case 243: return getContextualType(parent); - case 240: case 241: + case 242: return getContextualTypeForJsxAttribute(parent); } return undefined; @@ -17854,7 +18059,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 175 || node.kind === 176; + return node.kind === 176 || node.kind === 177; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -17862,7 +18067,7 @@ var ts; : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getApparentTypeOfContextualType(node); @@ -17902,13 +18107,13 @@ var ts; } function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 183 && parent.operatorToken.kind === 56 && parent.left === node) { + if (parent.kind === 184 && parent.operatorToken.kind === 56 && parent.left === node) { return true; } - if (parent.kind === 247) { + if (parent.kind === 248) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 166) { + if (parent.kind === 167) { return isAssignmentTarget(parent); } return false; @@ -17918,8 +18123,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function hasDefaultValue(node) { - return (node.kind === 165 && !!node.initializer) || - (node.kind === 183 && node.operatorToken.kind === 56); + return (node.kind === 166 && !!node.initializer) || + (node.kind === 184 && node.operatorToken.kind === 56); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -17928,7 +18133,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 187) { + if (inDestructuringPattern && e.kind === 188) { var restArrayType = checkExpression(e.expression, contextualMapper); var restElementType = getIndexTypeOfType(restArrayType, 1) || (languageVersion >= 2 ? getElementTypeOfIterable(restArrayType, undefined) : undefined); @@ -17940,7 +18145,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 187; + hasSpreadElement = hasSpreadElement || e.kind === 188; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -17951,7 +18156,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 164 || pattern.kind === 166)) { + if (pattern && (pattern.kind === 165 || pattern.kind === 167)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -17959,7 +18164,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 189) { + if (patternElement.kind !== 190) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -17974,7 +18179,7 @@ var ts; return createArrayType(elementTypes.length ? getUnionType(elementTypes) : undefinedType); } function isNumericName(name) { - return name.kind === 136 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 137 ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 132); @@ -18005,31 +18210,31 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 163 || contextualType.pattern.kind === 167); + (contextualType.pattern.kind === 164 || contextualType.pattern.kind === 168); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 247 || - memberDecl.kind === 248 || + if (memberDecl.kind === 248 || + memberDecl.kind === 249 || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 247) { + if (memberDecl.kind === 248) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 143) { + else if (memberDecl.kind === 144) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 248); + ts.Debug.assert(memberDecl.kind === 249); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 247 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 248 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 248 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 249 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912; } @@ -18056,7 +18261,7 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 145 || memberDecl.kind === 146); + ts.Debug.assert(memberDecl.kind === 146 || memberDecl.kind === 147); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -18114,13 +18319,13 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 242: + case 243: checkJsxExpression(child); break; - case 235: + case 236: checkJsxElement(child); break; - case 236: + case 237: checkJsxSelfClosingElement(child); break; } @@ -18131,7 +18336,7 @@ var ts; return name.indexOf("-") < 0; } function isJsxIntrinsicIdentifier(tagName) { - if (tagName.kind === 135) { + if (tagName.kind === 136) { return false; } else { @@ -18225,6 +18430,7 @@ var ts; if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } + return unknownSymbol; } } function lookupClassTag(node) { @@ -18295,17 +18501,21 @@ var ts; var sym = getJsxElementTagSymbol(node); if (links.jsxFlags & 4) { var elemInstanceType = getJsxElementInstanceType(node); - var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896)) { - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); - } - return paramType; - } var elemClassType = getJsxGlobalElementClassType(); + if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { + var elemType = getTypeOfSymbol(sym); + var callSignatures = elemType && getSignaturesOfType(elemType, 0); + var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return links.resolvedJsxType = paramType; + } + } if (elemClassType) { checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } @@ -18403,11 +18613,11 @@ var ts; var nameTable = {}; var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 240) { + if (node.attributes[i].kind === 241) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 241); + ts.Debug.assert(node.attributes[i].kind === 242); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -18433,7 +18643,7 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 141; + return s.valueDeclaration ? s.valueDeclaration.kind : 142; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 8 | 64 : 0; @@ -18442,10 +18652,10 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95) { - var errorNode = node.kind === 168 ? + var errorNode = node.kind === 169 ? node.name : node.right; - if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 143) { + if (languageVersion < 2 && getDeclarationKindFromSymbol(prop) !== 144) { error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); return false; } @@ -18514,7 +18724,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 168 + var left = node.kind === 169 ? node.expression : node.left; var type = checkExpression(left); @@ -18526,10 +18736,47 @@ var ts; } return true; } + function getForInVariableSymbol(node) { + var initializer = node.initializer; + if (initializer.kind === 215) { + var variable = initializer.declarations[0]; + if (variable && !ts.isBindingPattern(variable.name)) { + return getSymbolOfNode(variable); + } + } + else if (initializer.kind === 69) { + return getResolvedSymbol(initializer); + } + return undefined; + } + function hasNumericPropertyNames(type) { + return getIndexTypeOfType(type, 1) && !getIndexTypeOfType(type, 0); + } + function isForInVariableForNumericPropertyNames(expr) { + var e = skipParenthesizedNodes(expr); + if (e.kind === 69) { + var symbol = getResolvedSymbol(e); + if (symbol.flags & 3) { + var child = expr; + var node = expr.parent; + while (node) { + if (node.kind === 203 && + child === node.statement && + getForInVariableSymbol(node) === symbol && + hasNumericPropertyNames(checkExpression(node.expression))) { + return true; + } + child = node; + node = node.parent; + } + } + } + return false; + } function checkIndexedAccess(node) { if (!node.argumentExpression) { - var sourceFile = getSourceFile(node); - if (node.parent.kind === 171 && node.parent.expression === node) { + var sourceFile = ts.getSourceFileOfNode(node); + if (node.parent.kind === 172 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -18566,7 +18813,7 @@ var ts; } } if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 258 | 132 | 16777216)) { - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132)) { + if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132) || isForInVariableForNumericPropertyNames(node.argumentExpression)) { var numberIndexType = getIndexTypeOfType(objectType, 1); if (numberIndexType) { return numberIndexType; @@ -18577,7 +18824,9 @@ var ts; return stringIndexType; } if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !isTypeAny(objectType)) { - error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + error(node, getIndexTypeOfType(objectType, 1) ? + ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number : + ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; } @@ -18588,7 +18837,7 @@ var ts; if (indexArgumentExpression.kind === 9 || indexArgumentExpression.kind === 8) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 169 || indexArgumentExpression.kind === 168) { + if (indexArgumentExpression.kind === 170 || indexArgumentExpression.kind === 169) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -18631,10 +18880,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 172) { + if (node.kind === 173) { checkExpression(node.template); } - else if (node.kind !== 139) { + else if (node.kind !== 140) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -18685,7 +18934,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 187) { + if (arg && arg.kind === 188) { return i; } } @@ -18697,11 +18946,11 @@ var ts; var callIsIncomplete; var isDecorator; var spreadArgIndex = -1; - if (node.kind === 172) { + if (node.kind === 173) { var tagExpression = node; adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 185) { + if (tagExpression.template.kind === 186) { var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); ts.Debug.assert(lastSpan !== undefined); @@ -18713,7 +18962,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 139) { + else if (node.kind === 140) { isDecorator = true; typeArguments = undefined; adjustedArgCount = getEffectiveArgumentCount(node, undefined, signature); @@ -18721,7 +18970,7 @@ var ts; else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 171); + ts.Debug.assert(callExpression.kind === 172); return signature.minArgumentCount === 0; } adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; @@ -18774,7 +19023,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 189) { + if (arg === undefined || arg.kind !== 190) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { @@ -18823,7 +19072,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 189) { + if (arg === undefined || arg.kind !== 190) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); if (argType === undefined) { @@ -18842,16 +19091,16 @@ var ts; } function getEffectiveCallArguments(node) { var args; - if (node.kind === 172) { + if (node.kind === 173) { var template = node.template; args = [undefined]; - if (template.kind === 185) { + if (template.kind === 186) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 139) { + else if (node.kind === 140) { return undefined; } else { @@ -18860,21 +19109,21 @@ var ts; return args; } function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 139) { + if (node.kind === 140) { switch (node.parent.kind) { - case 216: - case 188: + case 217: + case 189: return 1; - case 141: + case 142: return 2; - case 143: - case 145: + case 144: case 146: + case 147: if (languageVersion === 0) { return 2; } return signature.parameters.length >= 3 ? 3 : 2; - case 138: + case 139: return 3; } } @@ -18883,48 +19132,48 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 216) { + if (node.kind === 217) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 138) { + if (node.kind === 139) { node = node.parent; - if (node.kind === 144) { + if (node.kind === 145) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 141 || - node.kind === 143 || - node.kind === 145 || - node.kind === 146) { + if (node.kind === 142 || + node.kind === 144 || + node.kind === 146 || + node.kind === 147) { return getParentTypeOfClassElement(node); } ts.Debug.fail("Unsupported decorator target."); return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 216) { + if (node.kind === 217) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 138) { + if (node.kind === 139) { node = node.parent; - if (node.kind === 144) { + if (node.kind === 145) { return anyType; } } - if (node.kind === 141 || - node.kind === 143 || - node.kind === 145 || - node.kind === 146) { + if (node.kind === 142 || + node.kind === 144 || + node.kind === 146 || + node.kind === 147) { var element = node; switch (element.name.kind) { case 69: case 8: case 9: return getStringLiteralTypeForText(element.name.text); - case 136: + case 137: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216)) { return nameType; @@ -18941,20 +19190,20 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 216) { + if (node.kind === 217) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 138) { + if (node.kind === 139) { return numberType; } - if (node.kind === 141) { + if (node.kind === 142) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 143 || - node.kind === 145 || - node.kind === 146) { + if (node.kind === 144 || + node.kind === 146 || + node.kind === 147) { var propertyType = getTypeOfNode(node); return createTypedPropertyDescriptorType(propertyType); } @@ -18975,26 +19224,26 @@ var ts; return unknownType; } function getEffectiveArgumentType(node, argIndex, arg) { - if (node.kind === 139) { + if (node.kind === 140) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 172) { + else if (argIndex === 0 && node.kind === 173) { return globalTemplateStringsArrayType; } return undefined; } function getEffectiveArgument(node, args, argIndex) { - if (node.kind === 139 || - (argIndex === 0 && node.kind === 172)) { + if (node.kind === 140 || + (argIndex === 0 && node.kind === 173)) { return undefined; } return args[argIndex]; } function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 139) { + if (node.kind === 140) { return node.expression; } - else if (argIndex === 0 && node.kind === 172) { + else if (argIndex === 0 && node.kind === 173) { return node.template; } else { @@ -19002,8 +19251,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 172; - var isDecorator = node.kind === 139; + var isTaggedTemplate = node.kind === 173; + var isDecorator = node.kind === 140; var typeArguments; if (!isTaggedTemplate && !isDecorator) { typeArguments = node.typeArguments; @@ -19235,16 +19484,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 216: - case 188: + case 217: + case 189: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 138: + case 139: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 141: + case 142: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 143: - case 145: + case 144: case 146: + case 147: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -19272,16 +19521,16 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 170) { + if (node.kind === 171) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 171) { + else if (node.kind === 172) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 172) { + else if (node.kind === 173) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } - else if (node.kind === 139) { + else if (node.kind === 140) { links.resolvedSignature = resolveDecorator(node, candidatesOutArray); } else { @@ -19303,12 +19552,12 @@ var ts; if (node.expression.kind === 95) { return voidType; } - if (node.kind === 171) { + if (node.kind === 172) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 144 && - declaration.kind !== 148 && - declaration.kind !== 153) { + declaration.kind !== 145 && + declaration.kind !== 149 && + declaration.kind !== 154) { var funcSymbol = checkExpression(node.expression).symbol; if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16)) { return getInferredClassType(funcSymbol); @@ -19362,7 +19611,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189) { + if (element.kind !== 190) { if (element.name.kind === 69) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -19396,7 +19645,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 194) { + if (func.body.kind !== 195) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member); @@ -19501,7 +19750,7 @@ var ts; if (returnType === voidType || isTypeAny(returnType)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 || !(func.flags & 524288)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 195 || !(func.flags & 524288)) { return; } var hasExplicitReturn = func.flags & 1048576; @@ -19521,18 +19770,14 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 175) { + if (!hasGrammarError && node.kind === 176) { checkGrammarForGenerator(node); } if (contextualMapper === identityMapper && isContextSensitive(node)) { return anyFunctionType; } - var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); @@ -19560,18 +19805,15 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 143 && node.kind !== 142) { + if (produceDiagnostics && node.kind !== 144 && node.kind !== 143) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 143 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); if (!node.asteriskToken) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); @@ -19580,7 +19822,7 @@ var ts; if (!node.type) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 194) { + if (node.body.kind === 195) { checkSourceElement(node.body); } else { @@ -19615,13 +19857,13 @@ var ts; var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; } - case 168: { + case 169: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; } - case 169: + case 170: return true; - case 174: + case 175: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -19630,11 +19872,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69: - case 168: { + case 169: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384) !== 0; } - case 169: { + case 170: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9) { @@ -19644,7 +19886,7 @@ var ts; } return false; } - case 174: + case 175: return isConstVariableReference(n.expression); default: return false; @@ -19774,9 +20016,9 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 247 || p.kind === 248) { + if (p.kind === 248 || p.kind === 249) { var name_13 = p.name; - if (name_13.kind === 136) { + if (name_13.kind === 137) { checkComputedPropertyName(name_13); } if (isComputedNonLiteralName(name_13)) { @@ -19789,7 +20031,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - if (p.kind === 248) { + if (p.kind === 249) { checkDestructuringAssignment(p, type); } else { @@ -19811,8 +20053,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189) { - if (e.kind !== 187) { + if (e.kind !== 190) { + if (e.kind !== 188) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -19837,7 +20079,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 183 && restExpression.operatorToken.kind === 56) { + if (restExpression.kind === 184 && restExpression.operatorToken.kind === 56) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -19851,7 +20093,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 248) { + if (exprOrAssignment.kind === 249) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -19861,14 +20103,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 183 && target.operatorToken.kind === 56) { + if (target.kind === 184 && target.operatorToken.kind === 56) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 167) { + if (target.kind === 168) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 166) { + if (target.kind === 167) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -19885,7 +20127,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 && (left.kind === 167 || left.kind === 166)) { + if (operator === 56 && (left.kind === 168 || left.kind === 167)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -20109,14 +20351,14 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { checkGrammarMethod(node); - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -20139,7 +20381,7 @@ var ts; } function checkExpression(node, contextualMapper) { var type; - if (node.kind === 135) { + if (node.kind === 136) { type = checkQualifiedName(node); } else { @@ -20147,9 +20389,9 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 168 && node.parent.expression === node) || - (node.parent.kind === 169 && node.parent.expression === node) || - ((node.kind === 69 || node.kind === 135) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 169 && node.parent.expression === node) || + (node.parent.kind === 170 && node.parent.expression === node) || + ((node.kind === 69 || node.kind === 136) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } @@ -20175,7 +20417,7 @@ var ts; return booleanType; case 8: return checkNumericLiteral(node); - case 185: + case 186: return checkTemplateExpression(node); case 9: return checkStringLiteralExpression(node); @@ -20183,58 +20425,58 @@ var ts; return stringType; case 10: return globalRegExpType; - case 166: - return checkArrayLiteral(node, contextualMapper); case 167: - return checkObjectLiteral(node, contextualMapper); + return checkArrayLiteral(node, contextualMapper); case 168: - return checkPropertyAccessExpression(node); + return checkObjectLiteral(node, contextualMapper); case 169: - return checkIndexedAccess(node); + return checkPropertyAccessExpression(node); case 170: + return checkIndexedAccess(node); case 171: - return checkCallExpression(node); case 172: - return checkTaggedTemplateExpression(node); - case 174: - return checkExpression(node.expression, contextualMapper); - case 188: - return checkClassExpression(node); - case 175: - case 176: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 178: - return checkTypeOfExpression(node); + return checkCallExpression(node); case 173: - case 191: - return checkAssertion(node); - case 177: - return checkDeleteExpression(node); - case 179: - return checkVoidExpression(node); - case 180: - return checkAwaitExpression(node); - case 181: - return checkPrefixUnaryExpression(node); - case 182: - return checkPostfixUnaryExpression(node); - case 183: - return checkBinaryExpression(node, contextualMapper); - case 184: - return checkConditionalExpression(node, contextualMapper); - case 187: - return checkSpreadElementExpression(node, contextualMapper); + return checkTaggedTemplateExpression(node); + case 175: + return checkExpression(node.expression, contextualMapper); case 189: + return checkClassExpression(node); + case 176: + case 177: + return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); + case 179: + return checkTypeOfExpression(node); + case 174: + case 192: + return checkAssertion(node); + case 178: + return checkDeleteExpression(node); + case 180: + return checkVoidExpression(node); + case 181: + return checkAwaitExpression(node); + case 182: + return checkPrefixUnaryExpression(node); + case 183: + return checkPostfixUnaryExpression(node); + case 184: + return checkBinaryExpression(node, contextualMapper); + case 185: + return checkConditionalExpression(node, contextualMapper); + case 188: + return checkSpreadElementExpression(node, contextualMapper); + case 190: return undefinedType; - case 186: + case 187: return checkYieldExpression(node); - case 242: + case 243: return checkJsxExpression(node); - case 235: - return checkJsxElement(node); case 236: - return checkJsxSelfClosingElement(node); + return checkJsxElement(node); case 237: + return checkJsxSelfClosingElement(node); + case 238: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -20255,7 +20497,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 56) { func = ts.getContainingFunction(node); - if (!(func.kind === 144 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 145 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -20270,9 +20512,9 @@ var ts; if (!node.asteriskToken || !node.body) { return false; } - return node.kind === 143 || - node.kind === 215 || - node.kind === 175; + return node.kind === 144 || + node.kind === 216 || + node.kind === 176; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -20286,104 +20528,97 @@ var ts; } return -1; } - function isInLegalParameterTypePredicatePosition(node) { - switch (node.parent.kind) { - case 176: - case 147: - case 215: - case 175: - case 152: - case 143: - case 142: - return node === node.parent.type; + function checkTypePredicate(node) { + var parent = getTypePredicateParent(node); + if (!parent) { + return; + } + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(parent)); + if (!returnType || !(returnType.flags & 134217728)) { + return; + } + var parameterName = node.parameterName; + if (parameterName.kind === 162) { + getTypeFromThisTypeNode(parameterName); + } + else { + var typePredicate = returnType.predicate; + if (typePredicate.parameterIndex >= 0) { + if (parent.parameters[typePredicate.parameterIndex].dotDotDotToken) { + error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + } + else { + checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type); + } + } + else if (parameterName) { + var hasReportedError = false; + for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { + var name_14 = _a[_i].name; + if ((name_14.kind === 164 || + name_14.kind === 165) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_14, parameterName, typePredicate.parameterName)) { + hasReportedError = true; + break; + } + } + if (!hasReportedError) { + error(node.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + } + } } - return false; } - function isInLegalThisTypePredicatePosition(node) { - if (isInLegalParameterTypePredicatePosition(node)) { - return true; - } + function getTypePredicateParent(node) { switch (node.parent.kind) { - case 141: - case 140: - case 145: - return node === node.parent.type; + case 177: + case 148: + case 216: + case 176: + case 153: + case 144: + case 143: + var parent_6 = node.parent; + if (node === parent_6.type) { + return parent_6; + } + } + } + function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern, predicateVariableNode, predicateVariableName) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var name_15 = _a[_i].name; + if (name_15.kind === 69 && + name_15.text === predicateVariableName) { + error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); + return true; + } + else if (name_15.kind === 165 || + name_15.kind === 164) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_15, predicateVariableNode, predicateVariableName)) { + return true; + } + } } - return false; } function checkSignatureDeclaration(node) { - if (node.kind === 149) { + if (node.kind === 150) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 || node.kind === 215 || node.kind === 153 || - node.kind === 147 || node.kind === 144 || - node.kind === 148) { + else if (node.kind === 153 || node.kind === 216 || node.kind === 154 || + node.kind === 148 || node.kind === 145 || + node.kind === 149) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); - if (node.type) { - if (node.type.kind === 150) { - var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - if (!returnType || !(returnType.flags & 134217728)) { - return; - } - var typePredicate = returnType.predicate; - var typePredicateNode = node.type; - checkSourceElement(typePredicateNode); - if (ts.isIdentifierTypePredicate(typePredicate)) { - if (typePredicate.parameterIndex >= 0) { - if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); - } - else { - checkTypeAssignableTo(typePredicate.type, getTypeOfNode(node.parameters[typePredicate.parameterIndex]), typePredicateNode.type); - } - } - else if (typePredicateNode.parameterName) { - var hasReportedError = false; - for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { - var param = _a[_i]; - if (hasReportedError) { - break; - } - if (param.name.kind === 163 || - param.name.kind === 164) { - (function checkBindingPattern(pattern) { - for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (element.name.kind === 69 && - element.name.text === typePredicate.parameterName) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, typePredicate.parameterName); - hasReportedError = true; - break; - } - else if (element.name.kind === 164 || - element.name.kind === 163) { - checkBindingPattern(element.name); - } - } - })(param.name); - } - } - if (!hasReportedError) { - error(typePredicateNode.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); - } - } - } - } - else { - checkSourceElement(node.type); - } - } + checkSourceElement(node.type); if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 148: + case 149: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 147: + case 148: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -20405,7 +20640,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 217) { + if (node.kind === 218) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -20468,7 +20703,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 170 && n.expression.kind === 95; + return n.kind === 171 && n.expression.kind === 95; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -20489,12 +20724,12 @@ var ts; if (n.kind === 97) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 175 && n.kind !== 215) { + else if (n.kind !== 176 && n.kind !== 216) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 141 && + return n.kind === 142 && !(n.flags & 64) && !!n.initializer; } @@ -20514,7 +20749,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 197 && isSuperCallExpression(statement.expression)) { + if (statement.kind === 198 && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -20540,7 +20775,7 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 145) { + if (node.kind === 146) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288)) { if (node.flags & 1048576) { if (compilerOptions.noImplicitReturns) { @@ -20552,11 +20787,11 @@ var ts; } } } - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 145 ? 146 : 145; + var otherKind = node.kind === 146 ? 147 : 146; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 56) !== (otherAccessor.flags & 56))) { @@ -20573,7 +20808,7 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - if (node.parent.kind !== 167) { + if (node.parent.kind !== 168) { checkSourceElement(node.body); } else { @@ -20655,9 +20890,9 @@ var ts; return; } var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217) { - ts.Debug.assert(signatureDeclarationNode.kind === 147 || signatureDeclarationNode.kind === 148); - var signatureKind = signatureDeclarationNode.kind === 147 ? 0 : 1; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 218) { + ts.Debug.assert(signatureDeclarationNode.kind === 148 || signatureDeclarationNode.kind === 149); + var signatureKind = signatureDeclarationNode.kind === 148 ? 0 : 1; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -20675,9 +20910,9 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 217 && - n.parent.kind !== 216 && - n.parent.kind !== 188 && + if (n.parent.kind !== 218 && + n.parent.kind !== 217 && + n.parent.kind !== 189 && ts.isInAmbientContext(n)) { if (!(flags & 4)) { flags |= 2; @@ -20754,7 +20989,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 143 || node.kind === 142) && + var reportError = (node.kind === 144 || node.kind === 143) && (node.flags & 64) !== (subsequentNode.flags & 64); if (reportError) { var diagnostic = node.flags & 64 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -20788,11 +21023,11 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 217 || node.parent.kind === 155 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 218 || node.parent.kind === 156 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 215 || node.kind === 143 || node.kind === 142 || node.kind === 144) { + if (node.kind === 216 || node.kind === 144 || node.kind === 143 || node.kind === 145) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -20905,16 +21140,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 217: + case 218: return 2097152; - case 220: - return d.name.kind === 9 || ts.getModuleInstanceState(d) !== 0 + case 221: + return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; - case 216: - case 219: + case 217: + case 220: return 2097152 | 1048576; - case 223: + case 224: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -21045,22 +21280,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 216: + case 217: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 138: + case 139: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 141: + case 142: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 143: - case 145: + case 144: case 146: + case 147: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -21069,9 +21304,9 @@ var ts; checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo); } function checkTypeNodeAsExpression(node) { - if (node && node.kind === 151) { + if (node && node.kind === 152) { var root = getFirstIdentifier(node.typeName); - var meaning = root.parent.kind === 151 ? 793056 : 1536; + var meaning = root.parent.kind === 152 ? 793056 : 1536; var rootSymbol = resolveName(root, root.text, meaning | 8388608, undefined, undefined); if (rootSymbol && rootSymbol.flags & 8388608) { var aliasTarget = resolveAlias(rootSymbol); @@ -21105,28 +21340,24 @@ var ts; } if (compilerOptions.emitDecoratorMetadata) { switch (node.kind) { - case 216: + case 217: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 143: - case 145: + case 144: case 146: + case 147: checkParameterTypeAnnotationsAsExpressions(node); checkReturnTypeAnnotationAsExpression(node); break; - case 141: - case 138: + case 142: + case 139: checkTypeAnnotationAsExpression(node); break; } } - emitDecorate = true; - if (node.kind === 138) { - emitParam = true; - } ts.forEach(node.decorators, checkDecorator); } function checkFunctionDeclaration(node) { @@ -21141,16 +21372,13 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } - if (node.name && node.name.kind === 136) { + if (node.name && node.name.kind === 137) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.forEach(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + var firstDeclaration = ts.forEach(localSymbol.declarations, function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)) ? declaration : undefined; }); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -21176,7 +21404,7 @@ var ts; } } function checkBlock(node) { - if (node.kind === 194) { + if (node.kind === 195) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -21195,19 +21423,19 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 141 || - node.kind === 140 || + if (node.kind === 142 || + node.kind === 141 || + node.kind === 144 || node.kind === 143 || - node.kind === 142 || - node.kind === 145 || - node.kind === 146) { + node.kind === 146 || + node.kind === 147) { return false; } if (ts.isInAmbientContext(node)) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 138 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 139 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -21255,11 +21483,11 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 220 && ts.getModuleInstanceState(node) !== 1) { + if (node.kind === 221 && ts.getModuleInstanceState(node) !== 1) { return; } var parent = getDeclarationContainer(node); - if (parent.kind === 250 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 251 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -21267,7 +21495,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 24576) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 213 && !node.initializer) { + if (node.kind === 214 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -21277,25 +21505,25 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214); - var container = varDeclList.parent.kind === 195 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 215); + var container = varDeclList.parent.kind === 196 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 194 && ts.isFunctionLike(container.parent) || + (container.kind === 195 && ts.isFunctionLike(container.parent) || + container.kind === 222 || container.kind === 221 || - container.kind === 220 || - container.kind === 250); + container.kind === 251); if (!namesShareScope) { - var name_14 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_14, name_14); + var name_16 = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_16, name_16); } } } } } function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 138) { + if (ts.getRootDeclaration(node).kind !== 139) { return; } var func = ts.getContainingFunction(node); @@ -21304,7 +21532,7 @@ var ts; if (n.kind === 69) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 138) { + if (referencedSymbol.valueDeclaration.kind === 139) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -21324,26 +21552,26 @@ var ts; function checkVariableLikeDeclaration(node) { checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 136) { + if (node.name.kind === 137) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 165) { - if (node.propertyName && node.propertyName.kind === 136) { + if (node.kind === 166) { + if (node.propertyName && node.propertyName.kind === 137) { checkComputedPropertyName(node.propertyName); } } if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 138 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 139 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - if (node.initializer) { + if (node.initializer && node.parent.parent.kind !== 203) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); checkParameterInitializer(node); } @@ -21352,7 +21580,7 @@ var ts; var symbol = getSymbolOfNode(node); var type = getTypeOfVariableOrParameterOrProperty(symbol); if (node === symbol.valueDeclaration) { - if (node.initializer) { + if (node.initializer && node.parent.parent.kind !== 203) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } @@ -21366,9 +21594,9 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 141 && node.kind !== 140) { + if (node.kind !== 142 && node.kind !== 141) { checkExportsOnMergedDeclarations(node); - if (node.kind === 213 || node.kind === 165) { + if (node.kind === 214 || node.kind === 166) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -21389,7 +21617,7 @@ var ts; ts.forEach(node.declarationList.declarations, checkSourceElement); } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 167) { + if (node.modifiers && node.parent.kind === 168) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -21408,7 +21636,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 196) { + if (node.thenStatement.kind === 197) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -21425,12 +21653,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 214) { + if (node.initializer && node.initializer.kind === 215) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -21445,13 +21673,13 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 166 || varExpr.kind === 167) { + if (varExpr.kind === 167 || varExpr.kind === 168) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -21466,7 +21694,7 @@ var ts; } function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -21476,7 +21704,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 166 || varExpr.kind === 167) { + if (varExpr.kind === 167 || varExpr.kind === 168) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258)) { @@ -21644,7 +21872,7 @@ var ts; checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 145 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 146))); + return !!(node.kind === 146 && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 147))); } function checkReturnStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { @@ -21662,10 +21890,10 @@ var ts; if (func.asteriskToken) { return; } - if (func.kind === 146) { + if (func.kind === 147) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } - else if (func.kind === 144) { + else if (func.kind === 145) { if (!checkTypeAssignableTo(exprType, returnType, node.expression)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -21701,7 +21929,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 244 && !hasDuplicateDefaultClause) { + if (clause.kind === 245 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -21713,7 +21941,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 243) { + if (produceDiagnostics && clause.kind === 244) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); var expressionTypeIsAssignableToCaseType = (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, 258)) || @@ -21732,7 +21960,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 209 && current.label.text === node.label.text) { + if (current.kind === 210 && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -21826,7 +22054,7 @@ var ts; return; } var errorNode; - if (prop.valueDeclaration.name.kind === 136 || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 137 || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -21901,7 +22129,6 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitExtends = emitExtends || !ts.isInAmbientContext(node); var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType = baseTypes[0]; @@ -21975,7 +22202,7 @@ var ts; if (derived === base) { var derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !(derivedClassDecl.flags & 128))) { - if (derivedClassDecl.kind === 188) { + if (derivedClassDecl.kind === 189) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -22019,7 +22246,7 @@ var ts; } } function isAccessor(kind) { - return kind === 145 || kind === 146; + return kind === 146 || kind === 147; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -22085,7 +22312,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 218); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -22183,7 +22410,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 181: + case 182: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -22194,7 +22421,7 @@ var ts; case 50: return ~value_1; } return undefined; - case 183: + case 184: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -22219,11 +22446,11 @@ var ts; return undefined; case 8: return +e.text; - case 174: + case 175: return evalConstant(e.expression); case 69: + case 170: case 169: - case 168: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -22234,7 +22461,7 @@ var ts; } else { var expression; - if (e.kind === 169) { + if (e.kind === 170) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9) { return undefined; @@ -22251,7 +22478,7 @@ var ts; if (current.kind === 69) { break; } - else if (current.kind === 168) { + else if (current.kind === 169) { current = current.expression; } else { @@ -22310,7 +22537,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 219) { + if (declaration.kind !== 220) { return false; } var enumDeclaration = declaration; @@ -22333,8 +22560,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 216 || - (declaration.kind === 215 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 217 || + (declaration.kind === 216 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -22356,7 +22583,12 @@ var ts; } function checkModuleDeclaration(node) { if (produceDiagnostics) { - var isAmbientExternalModule = node.name.kind === 9; + var isGlobalAugmentation = ts.isGlobalScopeAugmentation(node); + var inAmbientContext = ts.isInAmbientContext(node); + if (isGlobalAugmentation && !inAmbientContext) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + } + var isAmbientExternalModule = ts.isAmbientModule(node); var contextErrorMessage = isAmbientExternalModule ? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : ts.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module; @@ -22364,7 +22596,7 @@ var ts; return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!ts.isInAmbientContext(node) && node.name.kind === 9) { + if (!inAmbientContext && node.name.kind === 9) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } } @@ -22374,7 +22606,7 @@ var ts; var symbol = getSymbolOfNode(node); if (symbol.flags & 512 && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) + && !inAmbientContext && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) { var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { @@ -22385,29 +22617,102 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 216); + var mergedClass = ts.getDeclarationOfKind(symbol, 217); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; } } if (isAmbientExternalModule) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + if (ts.isExternalModuleAugmentation(node)) { + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432); + if (checkBody) { + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + checkModuleAugmentationElement(statement, isGlobalAugmentation); + } + } } - if (ts.isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + else if (isGlobalSourceFile(node.parent)) { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else if (ts.isExternalModuleNameRelative(node.name.text)) { + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + } + } + else { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else { + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + } } } } checkSourceElement(node.body); } + function checkModuleAugmentationElement(node, isGlobalAugmentation) { + switch (node.kind) { + case 196: + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + checkModuleAugmentationElement(decl, isGlobalAugmentation); + } + break; + case 230: + case 231: + grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); + break; + case 224: + if (node.moduleReference.kind !== 9) { + error(node.name, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + break; + } + case 225: + grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); + break; + case 166: + case 214: + var name_17 = node.name; + if (ts.isBindingPattern(name_17)) { + for (var _b = 0, _c = name_17.elements; _b < _c.length; _b++) { + var el = _c[_b]; + checkModuleAugmentationElement(el, isGlobalAugmentation); + } + break; + } + case 217: + case 220: + case 216: + case 218: + case 221: + case 219: + var symbol = getSymbolOfNode(node); + if (symbol) { + var reportError = !(symbol.flags & 33554432); + if (!reportError) { + if (isGlobalAugmentation) { + reportError = symbol.parent !== undefined; + } + else { + reportError = ts.isExternalModuleAugmentation(symbol.parent.valueDeclaration); + } + } + if (reportError) { + error(node, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + } + } + break; + } + } function getFirstIdentifier(node) { while (true) { - if (node.kind === 135) { + if (node.kind === 136) { node = node.left; } - else if (node.kind === 168) { + else if (node.kind === 169) { node = node.expression; } else { @@ -22423,16 +22728,18 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 250 && !inAmbientExternalModule) { - error(moduleName, node.kind === 230 ? + var inAmbientExternalModule = node.parent.kind === 222 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 && !inAmbientExternalModule) { + error(moduleName, node.kind === 231 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } if (inAmbientExternalModule && ts.isExternalModuleNameRelative(moduleName.text)) { - error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); - return false; + if (!isTopLevelInExternalModuleAugmentation(node)) { + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + return false; + } } return true; } @@ -22444,7 +22751,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 232 ? + var message = node.kind === 233 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -22470,7 +22777,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226) { + if (importClause.namedBindings.kind === 227) { checkImportBinding(importClause.namedBindings); } else { @@ -22521,8 +22828,8 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 221 && node.parent.parent.name.kind === 9; - if (node.parent.kind !== 250 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 222 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -22535,22 +22842,29 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 250 && node.parent.kind !== 221 && node.parent.kind !== 220) { + if (node.parent.kind !== 251 && node.parent.kind !== 222 && node.parent.kind !== 221) { return grammarErrorOnFirstToken(node, errorMessage); } } function checkExportSpecifier(node) { checkAliasSymbol(node); if (!node.parent.parent.moduleSpecifier) { - markExportAsReferenced(node); + var exportedName = node.propertyName || node.name; + var symbol = resolveName(exportedName, exportedName.text, 107455 | 793056 | 1536 | 8388608, undefined, undefined); + if (symbol && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0]))) { + error(exportedName, ts.Diagnostics.Cannot_re_export_name_that_is_not_defined_in_the_module); + } + else { + markExportAsReferenced(node); + } } } function checkExportAssignment(node) { if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 250 ? node.parent : node.parent.parent; - if (container.kind === 220 && container.name.kind === 69) { + var container = node.parent.kind === 251 ? node.parent : node.parent.parent; + if (container.kind === 221 && !ts.isAmbientModule(container)) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -22588,7 +22902,9 @@ var ts; var exportEqualsSymbol = moduleSymbol.exports["export="]; if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + if (!isTopLevelInExternalModuleAugmentation(declaration)) { + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } } var exports_2 = getExportsOfModule(moduleSymbol); for (var id in exports_2) { @@ -22609,21 +22925,7 @@ var ts; links.exportsChecked = true; } function isNotOverload(declaration) { - return declaration.kind !== 215 || !!declaration.body; - } - } - function checkTypePredicate(node) { - var parameterName = node.parameterName; - if (parameterName.kind === 69 && !isInLegalParameterTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } - else if (parameterName.kind === 161) { - if (!isInLegalThisTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); - } - else { - getTypeFromThisTypeNode(parameterName); - } + return declaration.kind !== 216 || !!declaration.body; } } function checkSourceElement(node) { @@ -22633,118 +22935,118 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 220: - case 216: + case 221: case 217: - case 215: + case 218: + case 216: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 137: - return checkTypeParameter(node); case 138: + return checkTypeParameter(node); + case 139: return checkParameter(node); + case 142: case 141: - case 140: return checkPropertyDeclaration(node); - case 152: case 153: - case 147: + case 154: case 148: - return checkSignatureDeclaration(node); case 149: return checkSignatureDeclaration(node); - case 143: - case 142: - return checkMethodDeclaration(node); - case 144: - return checkConstructorDeclaration(node); - case 145: - case 146: - return checkAccessorDeclaration(node); - case 151: - return checkTypeReferenceNode(node); case 150: + return checkSignatureDeclaration(node); + case 144: + case 143: + return checkMethodDeclaration(node); + case 145: + return checkConstructorDeclaration(node); + case 146: + case 147: + return checkAccessorDeclaration(node); + case 152: + return checkTypeReferenceNode(node); + case 151: return checkTypePredicate(node); - case 154: - return checkTypeQuery(node); case 155: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 156: - return checkArrayType(node); + return checkTypeLiteral(node); case 157: - return checkTupleType(node); + return checkArrayType(node); case 158: + return checkTupleType(node); case 159: - return checkUnionOrIntersectionType(node); case 160: + return checkUnionOrIntersectionType(node); + case 161: return checkSourceElement(node.type); - case 215: - return checkFunctionDeclaration(node); - case 194: - case 221: - return checkBlock(node); - case 195: - return checkVariableStatement(node); - case 197: - return checkExpressionStatement(node); - case 198: - return checkIfStatement(node); - case 199: - return checkDoStatement(node); - case 200: - return checkWhileStatement(node); - case 201: - return checkForStatement(node); - case 202: - return checkForInStatement(node); - case 203: - return checkForOfStatement(node); - case 204: - case 205: - return checkBreakOrContinueStatement(node); - case 206: - return checkReturnStatement(node); - case 207: - return checkWithStatement(node); - case 208: - return checkSwitchStatement(node); - case 209: - return checkLabeledStatement(node); - case 210: - return checkThrowStatement(node); - case 211: - return checkTryStatement(node); - case 213: - return checkVariableDeclaration(node); - case 165: - return checkBindingElement(node); case 216: - return checkClassDeclaration(node); - case 217: - return checkInterfaceDeclaration(node); - case 218: - return checkTypeAliasDeclaration(node); - case 219: - return checkEnumDeclaration(node); - case 220: - return checkModuleDeclaration(node); - case 224: - return checkImportDeclaration(node); - case 223: - return checkImportEqualsDeclaration(node); - case 230: - return checkExportDeclaration(node); - case 229: - return checkExportAssignment(node); + return checkFunctionDeclaration(node); + case 195: + case 222: + return checkBlock(node); case 196: - checkGrammarStatementInAmbientContext(node); - return; + return checkVariableStatement(node); + case 198: + return checkExpressionStatement(node); + case 199: + return checkIfStatement(node); + case 200: + return checkDoStatement(node); + case 201: + return checkWhileStatement(node); + case 202: + return checkForStatement(node); + case 203: + return checkForInStatement(node); + case 204: + return checkForOfStatement(node); + case 205: + case 206: + return checkBreakOrContinueStatement(node); + case 207: + return checkReturnStatement(node); + case 208: + return checkWithStatement(node); + case 209: + return checkSwitchStatement(node); + case 210: + return checkLabeledStatement(node); + case 211: + return checkThrowStatement(node); case 212: + return checkTryStatement(node); + case 214: + return checkVariableDeclaration(node); + case 166: + return checkBindingElement(node); + case 217: + return checkClassDeclaration(node); + case 218: + return checkInterfaceDeclaration(node); + case 219: + return checkTypeAliasDeclaration(node); + case 220: + return checkEnumDeclaration(node); + case 221: + return checkModuleDeclaration(node); + case 225: + return checkImportDeclaration(node); + case 224: + return checkImportEqualsDeclaration(node); + case 231: + return checkExportDeclaration(node); + case 230: + return checkExportAssignment(node); + case 197: checkGrammarStatementInAmbientContext(node); return; - case 233: + case 213: + checkGrammarStatementInAmbientContext(node); + return; + case 234: return checkMissingDeclaration(node); } } @@ -22757,17 +23059,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 175: case 176: + case 177: + case 144: case 143: - case 142: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 145: case 146: + case 147: checkAccessorDeferred(node); break; - case 188: + case 189: checkClassExpressionDeferred(node); break; } @@ -22787,10 +23089,6 @@ var ts; } } checkGrammarSourceFile(node); - emitExtends = false; - emitDecorate = false; - emitParam = false; - emitAwaiter = false; potentialThisCollisions.length = 0; deferredNodes = []; ts.forEach(node.statements, checkSourceElement); @@ -22803,21 +23101,6 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } - if (emitExtends) { - links.flags |= 8; - } - if (emitDecorate) { - links.flags |= 16; - } - if (emitParam) { - links.flags |= 32; - } - if (emitAwaiter) { - links.flags |= 64; - } - if (emitGenerator || (emitAwaiter && languageVersion < 2)) { - links.flags |= 128; - } links.flags |= 1; } } @@ -22851,7 +23134,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 207 && node.parent.statement === node) { + if (node.parent.kind === 208 && node.parent.statement === node) { return true; } node = node.parent; @@ -22873,28 +23156,28 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 250: + case 251: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 220: + case 221: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); break; - case 219: + case 220: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 188: + case 189: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 216: case 217: + case 218: if (!(memberFlags & 64)) { copySymbols(getSymbolOfNode(location).members, meaning & 793056); } break; - case 175: + case 176: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -22933,36 +23216,36 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 137: - case 216: + case 138: case 217: case 218: case 219: + case 220: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 135) { + while (node.parent && node.parent.kind === 136) { node = node.parent; } - return node.parent && node.parent.kind === 151; + return node.parent && node.parent.kind === 152; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 168) { + while (node.parent && node.parent.kind === 169) { node = node.parent; } - return node.parent && node.parent.kind === 190; + return node.parent && node.parent.kind === 191; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 135) { + while (nodeOnRightSide.parent.kind === 136) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 223) { + if (nodeOnRightSide.parent.kind === 224) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 229) { + if (nodeOnRightSide.parent.kind === 230) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -22974,10 +23257,10 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 229) { + if (entityName.parent.kind === 230) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } - if (entityName.kind !== 168) { + if (entityName.kind !== 169) { if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } @@ -22987,7 +23270,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 190) { + if (entityName.parent.kind === 191) { meaning = 793056; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -22999,9 +23282,9 @@ var ts; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 237) || - (entityName.parent.kind === 236) || - (entityName.parent.kind === 239)) { + else if ((entityName.parent.kind === 238) || + (entityName.parent.kind === 237) || + (entityName.parent.kind === 240)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -23012,14 +23295,14 @@ var ts; var meaning = 107455 | 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 168) { + else if (entityName.kind === 169) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 135) { + else if (entityName.kind === 136) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -23028,14 +23311,14 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 151 ? 793056 : 1536; + var meaning = entityName.parent.kind === 152 ? 793056 : 1536; meaning |= 8388608; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 240) { + else if (entityName.parent.kind === 241) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 150) { + if (entityName.parent.kind === 151) { return resolveEntityName(entityName, 1); } return undefined; @@ -23049,12 +23332,12 @@ var ts; } if (node.kind === 69) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 229 + return node.parent.kind === 230 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 165 && - node.parent.parent.kind === 163 && + else if (node.parent.kind === 166 && + node.parent.parent.kind === 164 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -23065,30 +23348,30 @@ var ts; } switch (node.kind) { case 69: - case 168: - case 135: + case 169: + case 136: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97: case 95: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 161: + case 162: return getTypeFromTypeNode(node).symbol; case 121: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 144) { + if (constructorDeclaration && constructorDeclaration.kind === 145) { return constructorDeclaration.parent.symbol; } return undefined; case 9: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 224 || node.parent.kind === 230) && + ((node.parent.kind === 225 || node.parent.kind === 231) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 8: - if (node.parent.kind === 169 && node.parent.argumentExpression === node) { + if (node.parent.kind === 170 && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -23102,11 +23385,16 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 248) { - return resolveEntityName(location.name, 107455); + if (location && location.kind === 249) { + return resolveEntityName(location.name, 107455 | 8388608); } return undefined; } + function getExportSpecifierLocalTargetSymbol(node) { + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536 | 8388608); + } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { return unknownType; @@ -23173,9 +23461,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var name_15 = symbol.name; + var name_18 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_15); + var symbol = getPropertyOfType(t, name_18); if (symbol) { symbols.push(symbol); } @@ -23224,11 +23512,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 250) { + if (parentSymbol.flags & 512 && parentSymbol.valueDeclaration.kind === 251) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 220 || n.kind === 219) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 221 || n.kind === 220) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -23241,11 +23529,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 194: - case 222: - case 201: + case 195: + case 223: case 202: case 203: + case 204: return true; } return false; @@ -23271,22 +23559,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 223: - case 225: + case 224: case 226: - case 228: - case 232: + case 227: + case 229: + case 233: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 230: + case 231: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 229: + case 230: return node.expression && node.expression.kind === 69 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 250 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 251 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -23334,7 +23622,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 249) { + if (node.kind === 250) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -23450,21 +23738,34 @@ var ts; } function getExternalModuleFileFromDeclaration(declaration) { var specifier = ts.getExternalModuleName(declaration); - var moduleSymbol = getSymbolAtLocation(specifier); + var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined); if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 250); + return ts.getDeclarationOfKind(moduleSymbol, 251); } function initializeTypeChecker() { ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file, compilerOptions); }); + var augmentations; ts.forEach(host.getSourceFiles(), function (file) { if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } + if (file.moduleAugmentations) { + (augmentations || (augmentations = [])).push(file.moduleAugmentations); + } }); + if (augmentations) { + for (var _i = 0, augmentations_1 = augmentations; _i < augmentations_1.length; _i++) { + var list = augmentations_1[_i]; + for (var _a = 0, list_2 = list; _a < list_2.length; _a++) { + var augmentation = list_2[_a]; + mergeModuleAugmentation(augmentation); + } + } + } addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); @@ -23529,14 +23830,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 143 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 144 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 145 || node.kind === 146) { + else if (node.kind === 146 || node.kind === 147) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -23546,38 +23847,38 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 145: case 146: - case 144: - case 141: - case 140: - case 143: + case 147: + case 145: case 142: - case 149: - case 220: + case 141: + case 144: + case 143: + case 150: + case 221: + case 225: case 224: - case 223: + case 231: case 230: - case 229: - case 138: - break; - case 215: - if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && - node.parent.kind !== 221 && node.parent.kind !== 250) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } + case 139: break; case 216: - case 217: - case 195: - case 218: - if (node.modifiers && node.parent.kind !== 221 && node.parent.kind !== 250) { + if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118) && + node.parent.kind !== 222 && node.parent.kind !== 251) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; + case 217: + case 218: + case 196: case 219: + if (node.modifiers && node.parent.kind !== 222 && node.parent.kind !== 251) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + break; + case 220: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74) && - node.parent.kind !== 221 && node.parent.kind !== 250) { + node.parent.kind !== 222 && node.parent.kind !== 251) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -23593,7 +23894,7 @@ var ts; var modifier = _a[_i]; switch (modifier.kind) { case 74: - if (node.kind !== 219 && node.parent.kind === 216) { + if (node.kind !== 220 && node.parent.kind === 217) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74)); } break; @@ -23621,7 +23922,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 221 || node.parent.kind === 250) { + else if (node.parent.kind === 222 || node.parent.kind === 251) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128) { @@ -23641,10 +23942,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 221 || node.parent.kind === 250) { + else if (node.parent.kind === 222 || node.parent.kind === 251) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -23666,10 +23967,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 2; @@ -23681,13 +23982,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 222) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4; @@ -23697,11 +23998,11 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 216) { - if (node.kind !== 143) { + if (node.kind !== 217) { + if (node.kind !== 144) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 216 && node.parent.flags & 128)) { + if (!(node.parent.kind === 217 && node.parent.flags & 128)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64) { @@ -23720,7 +24021,7 @@ var ts; else if (flags & 4 || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 138) { + else if (node.kind === 139) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -23728,7 +24029,7 @@ var ts; break; } } - if (node.kind === 144) { + if (node.kind === 145) { if (flags & 64) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -23746,10 +24047,10 @@ var ts; } return; } - else if ((node.kind === 224 || node.kind === 223) && flags & 4) { + else if ((node.kind === 225 || node.kind === 224) && flags & 4) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 138 && (flags & 56) && ts.isBindingPattern(node.name)) { + else if (node.kind === 139 && (flags & 56) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } if (flags & 256) { @@ -23761,10 +24062,10 @@ var ts; return grammarErrorOnNode(asyncModifier, ts.Diagnostics.Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher); } switch (node.kind) { - case 143: - case 215: - case 175: + case 144: + case 216: case 176: + case 177: if (!node.asteriskToken) { return false; } @@ -23829,7 +24130,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 176) { + if (node.kind === 177) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -23896,7 +24197,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 189) { + if (arg.kind === 190) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -23967,19 +24268,19 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 136) { + if (node.kind !== 137) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 183 && computedPropertyName.expression.operatorToken.kind === 24) { + if (computedPropertyName.expression.kind === 184 && computedPropertyName.expression.operatorToken.kind === 24) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 215 || - node.kind === 175 || - node.kind === 143); + ts.Debug.assert(node.kind === 216 || + node.kind === 176 || + node.kind === 144); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -24003,58 +24304,58 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var _loop_1 = function(prop) { - var name_16 = prop.name; - if (prop.kind === 189 || - name_16.kind === 136) { - checkGrammarComputedPropertyName(name_16); + var name_19 = prop.name; + if (prop.kind === 190 || + name_19.kind === 137) { + checkGrammarComputedPropertyName(name_19); return "continue"; } - if (prop.kind === 248 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 249 && !inDestructuring && prop.objectAssignmentInitializer) { return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } ts.forEach(prop.modifiers, function (mod) { - if (mod.kind !== 118 || prop.kind !== 143) { + if (mod.kind !== 118 || prop.kind !== 144) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } }); var currentKind = void 0; - if (prop.kind === 247 || prop.kind === 248) { + if (prop.kind === 248 || prop.kind === 249) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_16.kind === 8) { - checkGrammarNumericLiteral(name_16); + if (name_19.kind === 8) { + checkGrammarNumericLiteral(name_19); } currentKind = Property; } - else if (prop.kind === 143) { + else if (prop.kind === 144) { currentKind = Property; } - else if (prop.kind === 145) { + else if (prop.kind === 146) { currentKind = GetAccessor; } - else if (prop.kind === 146) { + else if (prop.kind === 147) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_16.text)) { - seen[name_16.text] = currentKind; + if (!ts.hasProperty(seen, name_19.text)) { + seen[name_19.text] = currentKind; } else { - var existingKind = seen[name_16.text]; + var existingKind = seen[name_19.text]; if (currentKind === Property && existingKind === Property) { return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name_16.text] = currentKind | existingKind; + seen[name_19.text] = currentKind | existingKind; } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } }; @@ -24069,19 +24370,19 @@ var ts; var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 241) { + if (attr.kind === 242) { continue; } var jsxAttr = attr; - var name_17 = jsxAttr.name; - if (!ts.hasProperty(seen, name_17.text)) { - seen[name_17.text] = true; + var name_20 = jsxAttr.name; + if (!ts.hasProperty(seen, name_20.text)) { + seen[name_20.text] = true; } else { - return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name_20, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 242 && !initializer.expression) { + if (initializer && initializer.kind === 243 && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -24090,7 +24391,7 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 214) { + if (forInOrOfStatement.initializer.kind === 215) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -24098,20 +24399,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 202 + var diagnostic = forInOrOfStatement.kind === 203 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 202 + var diagnostic = forInOrOfStatement.kind === 203 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 202 + var diagnostic = forInOrOfStatement.kind === 203 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -24134,10 +24435,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 145 && accessor.parameters.length) { + else if (kind === 146 && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 146) { + else if (kind === 147) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -24172,12 +24473,12 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 167) { + if (node.parent.kind === 168) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } else if (node.body === undefined) { - return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -24191,10 +24492,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 218) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 155) { + else if (node.parent.kind === 156) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -24205,9 +24506,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 209: + case 210: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 204 + var isMisplacedContinueLabel = node.kind === 205 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -24215,8 +24516,8 @@ var ts; return false; } break; - case 208: - if (node.kind === 205 && !node.label) { + case 209: + if (node.kind === 206 && !node.label) { return false; } break; @@ -24229,13 +24530,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 205 + var message = node.kind === 206 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 205 + var message = node.kind === 206 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -24247,7 +24548,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 164 || node.name.kind === 163) { + if (node.name.kind === 165 || node.name.kind === 164) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -24256,7 +24557,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 202 && node.parent.parent.kind !== 203) { + if (node.parent.parent.kind !== 203 && node.parent.parent.kind !== 204) { if (ts.isInAmbientContext(node)) { if (node.initializer) { var equalsTokenLength = "=".length; @@ -24285,7 +24586,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 189) { + if (element.kind !== 190) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -24302,15 +24603,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 198: case 199: case 200: - case 207: case 201: + case 208: case 202: case 203: + case 204: return false; - case 209: + case 210: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -24366,7 +24667,7 @@ var ts; return true; } } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 218) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -24374,7 +24675,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 155) { + else if (node.parent.kind === 156) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -24387,12 +24688,12 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 217 || - node.kind === 218 || + if (node.kind === 218 || + node.kind === 219 || + node.kind === 225 || node.kind === 224 || - node.kind === 223 || + node.kind === 231 || node.kind === 230 || - node.kind === 229 || (node.flags & 4) || (node.flags & (2 | 512))) { return false; @@ -24402,7 +24703,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 195) { + if (ts.isDeclaration(decl) || decl.kind === 196) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -24421,7 +24722,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 194 || node.parent.kind === 221 || node.parent.kind === 250) { + if (node.parent.kind === 195 || node.parent.kind === 222 || node.parent.kind === 251) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -24457,8 +24758,9 @@ var ts; getSourceMapData: function () { return undefined; }, setSourceFile: function (sourceFile) { }, emitStart: function (range) { }, - emitEnd: function (range) { }, + emitEnd: function (range, stopOverridingSpan) { }, emitPos: function (pos) { }, + changeEmitSourcePos: function () { }, getText: function () { return undefined; }, getSourceMappingURL: function () { return undefined; }, initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, @@ -24472,6 +24774,8 @@ var ts; var compilerOptions = host.getCompilerOptions(); var currentSourceFile; var sourceMapDir; + var stopOverridingSpan = false; + var modifyLastSourcePos = false; var sourceMapSourceIndex; var lastRecordedSourceMapSpan; var lastEncodedSourceMapSpan; @@ -24483,6 +24787,7 @@ var ts; emitPos: emitPos, emitStart: emitStart, emitEnd: emitEnd, + changeEmitSourcePos: changeEmitSourcePos, getText: getText, getSourceMappingURL: getSourceMappingURL, initialize: initialize, @@ -24546,6 +24851,29 @@ var ts; lastEncodedNameIndex = undefined; sourceMapData = undefined; } + function updateLastEncodedAndRecordedSpans() { + if (modifyLastSourcePos) { + modifyLastSourcePos = false; + lastRecordedSourceMapSpan.emittedLine = lastEncodedSourceMapSpan.emittedLine; + lastRecordedSourceMapSpan.emittedColumn = lastEncodedSourceMapSpan.emittedColumn; + sourceMapData.sourceMapDecodedMappings.pop(); + lastEncodedSourceMapSpan = sourceMapData.sourceMapDecodedMappings.length ? + sourceMapData.sourceMapDecodedMappings[sourceMapData.sourceMapDecodedMappings.length - 1] : + undefined; + var sourceMapMappings = sourceMapData.sourceMapMappings; + var lenthToSet = sourceMapMappings.length - 1; + for (; lenthToSet >= 0; lenthToSet--) { + var currentChar = sourceMapMappings.charAt(lenthToSet); + if (currentChar === ",") { + break; + } + if (currentChar === ";" && lenthToSet !== 0 && sourceMapMappings.charAt(lenthToSet - 1) !== ";") { + break; + } + } + sourceMapData.sourceMapMappings = sourceMapMappings.substr(0, Math.max(0, lenthToSet)); + } + } function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { return; @@ -24567,6 +24895,7 @@ var ts; sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); if (lastRecordedSourceMapSpan.nameIndex >= 0) { + ts.Debug.assert(false, "We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this"); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; } @@ -24596,19 +24925,29 @@ var ts; sourceColumn: sourceLinePos.character, sourceIndex: sourceMapSourceIndex }; + stopOverridingSpan = false; } - else { + else if (!stopOverridingSpan) { lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } + updateLastEncodedAndRecordedSpans(); + } + function getStartPos(range) { + var rangeHasDecorators = !!range.decorators; + return range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1; } function emitStart(range) { - var rangeHasDecorators = !!range.decorators; - emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + emitPos(getStartPos(range)); } - function emitEnd(range) { + function emitEnd(range, stopOverridingEnd) { emitPos(range.end); + stopOverridingSpan = stopOverridingEnd; + } + function changeEmitSourcePos() { + ts.Debug.assert(!modifyLastSourcePos); + modifyLastSourcePos = true; } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -24695,6 +25034,7 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; + var resultHasExternalModuleIndicator; var currentText; var currentLineMap; var currentIdentifiers; @@ -24725,6 +25065,7 @@ var ts; } }); } + resultHasExternalModuleIndicator = false; if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { noDeclare = false; emitSourceFile(sourceFile); @@ -24743,7 +25084,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 224); + ts.Debug.assert(aliasEmitInfo.node.kind === 225); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -24760,6 +25101,10 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } + if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { + write("export {};"); + writeLine(); + } }); return { reportedDeclarationError: reportedDeclarationError, @@ -24806,10 +25151,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 213) { + if (declaration.kind === 214) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 227 || declaration.kind === 228 || declaration.kind === 225) { + else if (declaration.kind === 228 || declaration.kind === 229 || declaration.kind === 226) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -24820,7 +25165,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 224) { + if (moduleElementEmitInfo.node.kind === 225) { moduleElementEmitInfo.isVisible = true; } else { @@ -24828,12 +25173,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 220) { + if (nodeToCheck.kind === 221) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 220) { + if (nodeToCheck.kind === 221) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -24936,35 +25281,35 @@ var ts; case 120: case 131: case 103: - case 161: case 162: + case 163: return writeTextOfNode(currentText, type); - case 190: + case 191: return emitExpressionWithTypeArguments(type); - case 151: - return emitTypeReference(type); - case 154: - return emitTypeQuery(type); - case 156: - return emitArrayType(type); - case 157: - return emitTupleType(type); - case 158: - return emitUnionType(type); - case 159: - return emitIntersectionType(type); - case 160: - return emitParenType(type); case 152: - case 153: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 155: + return emitTypeQuery(type); + case 157: + return emitArrayType(type); + case 158: + return emitTupleType(type); + case 159: + return emitUnionType(type); + case 160: + return emitIntersectionType(type); + case 161: + return emitParenType(type); + case 153: + case 154: + return emitSignatureDeclarationWithJsDocComments(type); + case 156: return emitTypeLiteral(type); case 69: return emitEntityName(type); - case 135: + case 136: return emitEntityName(type); - case 150: + case 151: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -24972,21 +25317,21 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 135 ? entityName.left : entityName.expression; - var right = entityName.kind === 135 ? entityName.right : entityName.name; + var left = entityName.kind === 136 ? entityName.left : entityName.expression; + var right = entityName.kind === 136 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 223 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 224 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 168); + ts.Debug.assert(node.expression.kind === 69 || node.expression.kind === 169); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -25060,9 +25405,9 @@ var ts; var count = 0; while (true) { count++; - var name_18 = baseName + "_" + count; - if (!ts.hasProperty(currentIdentifiers, name_18)) { - return name_18; + var name_21 = baseName + "_" + count; + if (!ts.hasProperty(currentIdentifiers, name_21)) { + return name_21; } } } @@ -25103,10 +25448,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 223 || - (node.parent.kind === 250 && isCurrentFileExternalModule)) { + else if (node.kind === 224 || + (node.parent.kind === 251 && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 251) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -25115,7 +25460,7 @@ var ts; }); } else { - if (node.kind === 224) { + if (node.kind === 225) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -25133,37 +25478,37 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 215: - return writeFunctionDeclaration(node); - case 195: - return writeVariableStatement(node); - case 217: - return writeInterfaceDeclaration(node); case 216: - return writeClassDeclaration(node); + return writeFunctionDeclaration(node); + case 196: + return writeVariableStatement(node); case 218: - return writeTypeAliasDeclaration(node); + return writeInterfaceDeclaration(node); + case 217: + return writeClassDeclaration(node); case 219: - return writeEnumDeclaration(node); + return writeTypeAliasDeclaration(node); case 220: + return writeEnumDeclaration(node); + case 221: return writeModuleDeclaration(node); - case 223: - return writeImportEqualsDeclaration(node); case 224: + return writeImportEqualsDeclaration(node); + case 225: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 250) { + if (node.parent.kind === 251) { if (node.flags & 2) { write("export "); } if (node.flags & 512) { write("default "); } - else if (node.kind !== 217 && !noDeclare) { + else if (node.kind !== 218 && !noDeclare) { write("declare "); } } @@ -25210,7 +25555,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 226) { + if (namedBindings.kind === 227) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -25236,7 +25581,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 226) { + if (node.importClause.namedBindings.kind === 227) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -25253,11 +25598,15 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 221; var moduleSpecifier; - if (parent.kind === 223) { + if (parent.kind === 224) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } + else if (parent.kind === 221) { + moduleSpecifier = parent.name; + } else { var node = parent; moduleSpecifier = node.moduleSpecifier; @@ -25306,14 +25655,24 @@ var ts; function writeModuleDeclaration(node) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); - if (node.flags & 65536) { - write("namespace "); + if (ts.isGlobalScopeAugmentation(node)) { + write("global "); } else { - write("module "); + if (node.flags & 65536) { + write("namespace "); + } + else { + write("module "); + } + if (ts.isExternalModuleAugmentation(node)) { + emitExternalModuleSpecifier(node); + } + else { + writeTextOfNode(currentText, node.name); + } } - writeTextOfNode(currentText, node.name); - while (node.body.kind !== 221) { + while (node.body.kind !== 222) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -25378,7 +25737,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 143 && (node.parent.flags & 16); + return node.parent.kind === 144 && (node.parent.flags & 16); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -25388,15 +25747,15 @@ var ts; writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 152 || - node.parent.kind === 153 || - (node.parent.parent && node.parent.parent.kind === 155)) { - ts.Debug.assert(node.parent.kind === 143 || - node.parent.kind === 142 || - node.parent.kind === 152 || + if (node.parent.kind === 153 || + node.parent.kind === 154 || + (node.parent.parent && node.parent.parent.kind === 156)) { + ts.Debug.assert(node.parent.kind === 144 || + node.parent.kind === 143 || node.parent.kind === 153 || - node.parent.kind === 147 || - node.parent.kind === 148); + node.parent.kind === 154 || + node.parent.kind === 148 || + node.parent.kind === 149); emitType(node.constraint); } else { @@ -25406,31 +25765,31 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 216: + case 217: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 217: + case 218: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 148: + case 149: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 147: + case 148: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 144: case 143: - case 142: if (node.parent.flags & 64) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216) { + else if (node.parent.parent.kind === 217) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 215: + case 216: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -25463,7 +25822,7 @@ var ts; } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 216) { + if (node.parent.parent.kind === 217) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; @@ -25543,16 +25902,16 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 213 || resolver.isDeclarationVisible(node)) { + if (node.kind !== 214 || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeTextOfNode(currentText, node.name); - if ((node.kind === 141 || node.kind === 140) && ts.hasQuestionToken(node)) { + if ((node.kind === 142 || node.kind === 141) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 141 || node.kind === 140) && node.parent.kind === 155) { + if ((node.kind === 142 || node.kind === 141) && node.parent.kind === 156) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 16)) { @@ -25561,14 +25920,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 213) { + if (node.kind === 214) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 141 || node.kind === 140) { + else if (node.kind === 142 || node.kind === 141) { if (node.flags & 64) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -25576,7 +25935,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25602,7 +25961,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189) { + if (element.kind !== 190) { elements.push(element); } } @@ -25668,7 +26027,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 145 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 146 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -25681,7 +26040,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 145 + return accessor.kind === 146 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -25690,7 +26049,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 146) { + if (accessorWithTypeAnnotation.kind === 147) { if (accessorWithTypeAnnotation.parent.flags & 64) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -25736,17 +26095,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 215) { + if (node.kind === 216) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 143) { + else if (node.kind === 144) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 215) { + if (node.kind === 216) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 144) { + else if (node.kind === 145) { write("constructor"); } else { @@ -25765,31 +26124,31 @@ var ts; function emitSignatureDeclaration(node) { var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; - if (node.kind === 148 || node.kind === 153) { + if (node.kind === 149 || node.kind === 154) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 149) { + if (node.kind === 150) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 149) { + if (node.kind === 150) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 152 || node.kind === 153; - if (isFunctionTypeOrConstructorType || node.parent.kind === 155) { + var isFunctionTypeOrConstructorType = node.kind === 153 || node.kind === 154; + if (isFunctionTypeOrConstructorType || node.parent.kind === 156) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 144 && !(node.flags & 16)) { + else if (node.kind !== 145 && !(node.flags & 16)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -25800,23 +26159,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 148: + case 149: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 147: + case 148: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 149: + case 150: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 144: case 143: - case 142: if (node.flags & 64) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -25824,7 +26183,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 216) { + else if (node.parent.kind === 217) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -25837,7 +26196,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 215: + case 216: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -25869,9 +26228,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 152 || - node.parent.kind === 153 || - node.parent.parent.kind === 155) { + if (node.parent.kind === 153 || + node.parent.kind === 154 || + node.parent.parent.kind === 156) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 16)) { @@ -25887,22 +26246,22 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 144: + case 145: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 148: + case 149: return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 147: + case 148: return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + case 144: case 143: - case 142: if (node.parent.flags & 64) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? @@ -25910,7 +26269,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216) { + else if (node.parent.parent.kind === 217) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25922,7 +26281,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 215: + case 216: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -25933,12 +26292,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 163) { + if (bindingPattern.kind === 164) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 164) { + else if (bindingPattern.kind === 165) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -25949,10 +26308,10 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 189) { + if (bindingElement.kind === 190) { write(" "); } - else if (bindingElement.kind === 165) { + else if (bindingElement.kind === 166) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -25974,39 +26333,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 215: - case 220: - case 223: - case 217: case 216: - case 218: - case 219: - return emitModuleElement(node, isModuleElementVisible(node)); - case 195: - return emitModuleElement(node, isVariableStatementVisible(node)); + case 221: case 224: + case 218: + case 217: + case 219: + case 220: + return emitModuleElement(node, isModuleElementVisible(node)); + case 196: + return emitModuleElement(node, isVariableStatementVisible(node)); + case 225: return emitModuleElement(node, !node.importClause); - case 230: + case 231: return emitExportDeclaration(node); + case 145: case 144: case 143: - case 142: return writeFunctionDeclaration(node); - case 148: - case 147: case 149: + case 148: + case 150: return emitSignatureDeclarationWithJsDocComments(node); - case 145: case 146: + case 147: return emitAccessorDeclaration(node); + case 142: case 141: - case 140: return emitPropertyDeclaration(node); - case 249: - return emitEnumMemberDeclaration(node); - case 229: - return emitExportAssignment(node); case 250: + return emitEnumMemberDeclaration(node); + case 230: + return emitExportAssignment(node); + case 251: return emitSourceFile(node); } } @@ -26333,7 +26692,7 @@ var ts; var decorateHelper = "\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};"; var metadataHelper = "\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; - var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; + var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new P(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.call(thisArg, _arguments)).next());\n });\n};"; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); @@ -26421,6 +26780,7 @@ var ts; var sourceMapData; var isOwnFileEmit; var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; + var setSourceMapWriterEmit = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? changeSourceMapEmit : function (writer) { }; var moduleEmitDelegates = (_a = {}, _a[5] = emitES6Module, _a[2] = emitAMDModule, @@ -26499,19 +26859,19 @@ var ts; } function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_19 = flags === 268435456 ? "_i" : "_n"; - if (isUniqueName(name_19)) { + var name_22 = flags === 268435456 ? "_i" : "_n"; + if (isUniqueName(name_22)) { tempFlags |= flags; - return name_19; + return name_22; } } while (true) { var count = tempFlags & 268435455; tempFlags++; if (count !== 8 && count !== 13) { - var name_20 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_20)) { - return name_20; + var name_23 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_23)) { + return name_23; } } } @@ -26549,17 +26909,17 @@ var ts; switch (node.kind) { case 69: return makeUniqueName(node.text); + case 221: case 220: - case 219: return generateNameForModuleOrEnum(node); - case 224: - case 230: + case 225: + case 231: return generateNameForImportOrExportDeclaration(node); - case 215: case 216: - case 229: + case 217: + case 230: return generateNameForExportDefault(); - case 188: + case 189: return generateNameForClassExpression(); } } @@ -26799,10 +27159,10 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 185) { + if (node.template.kind === 186) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 183 + var needsParens = templateSpan.expression.kind === 184 && templateSpan.expression.operatorToken.kind === 24; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -26826,7 +27186,7 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 174 + var needsParens = templateSpan.expression.kind !== 175 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); @@ -26846,11 +27206,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 170: case 171: - return parent.expression === template; case 172: - case 174: + return parent.expression === template; + case 173: + case 175: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1; @@ -26858,7 +27218,7 @@ var ts; } function comparePrecedenceToBinaryPlus(expression) { switch (expression.kind) { - case 183: + case 184: switch (expression.operatorToken.kind) { case 37: case 39: @@ -26870,8 +27230,8 @@ var ts; default: return -1; } - case 186: - case 184: + case 187: + case 185: return -1; default: return 1; @@ -26927,37 +27287,37 @@ var ts; } else { var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 241; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 242; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; - for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 241) { - if (i_1 === 0) { + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].kind === 242) { + if (i === 0) { write("{}, "); } if (haveOpenedObjectLiteral) { write("}"); haveOpenedObjectLiteral = false; } - if (i_1 > 0) { + if (i > 0) { write(", "); } - emit(attrs[i_1].expression); + emit(attrs[i].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 240); + ts.Debug.assert(attrs[i].kind === 241); if (haveOpenedObjectLiteral) { write(", "); } else { haveOpenedObjectLiteral = true; - if (i_1 > 0) { + if (i > 0) { write(", "); } write("{"); } - emitJsxAttribute(attrs[i_1]); + emitJsxAttribute(attrs[i]); } } if (haveOpenedObjectLiteral) @@ -26966,7 +27326,7 @@ var ts; } else { write("{"); - for (var i = 0; i < attrs.length; i++) { + for (var i = 0, n = attrs.length; i < n; i++) { if (i > 0) { write(", "); } @@ -26977,10 +27337,10 @@ var ts; } if (children) { for (var i = 0; i < children.length; i++) { - if (children[i].kind === 242 && !(children[i].expression)) { + if (children[i].kind === 243 && !(children[i].expression)) { continue; } - if (children[i].kind === 238) { + if (children[i].kind === 239) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -26997,11 +27357,11 @@ var ts; write(")"); emitTrailingComments(openingNode); } - if (node.kind === 235) { + if (node.kind === 236) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 236); + ts.Debug.assert(node.kind === 237); emitJsxElement(node); } } @@ -27023,11 +27383,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 241) { + if (attribs[i].kind === 242) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 240); + ts.Debug.assert(attribs[i].kind === 241); emitJsxAttribute(attribs[i]); } } @@ -27035,11 +27395,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 236)) { + if (node.attributes.length > 0 || (node.kind === 237)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 236) { + if (node.kind === 237) { write("/>"); } else { @@ -27058,20 +27418,20 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 235) { + if (node.kind === 236) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 236); + ts.Debug.assert(node.kind === 237); emitJsxOpeningOrSelfClosingElement(node); } } function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 165); + ts.Debug.assert(node.kind !== 166); if (node.kind === 9) { emitLiteral(node); } - else if (node.kind === 136) { + else if (node.kind === 137) { if (ts.nodeIsDecorated(node.parent)) { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; @@ -27102,62 +27462,62 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 166: - case 191: - case 183: - case 170: - case 243: - case 136: + case 167: + case 192: case 184: - case 139: - case 177: - case 199: - case 169: - case 229: - case 197: - case 190: - case 201: + case 171: + case 244: + case 137: + case 185: + case 140: + case 178: + case 200: + case 170: + case 230: + case 198: + case 191: case 202: case 203: - case 198: - case 239: - case 236: + case 204: + case 199: + case 240: case 237: - case 241: + case 238: case 242: - case 171: - case 174: - case 182: - case 181: - case 206: - case 248: - case 187: - case 208: + case 243: case 172: - case 192: - case 210: - case 173: - case 178: - case 179: - case 200: - case 207: - case 186: - return true; - case 165: - case 249: - case 138: - case 247: - case 141: - case 213: - return parent.initializer === node; - case 168: - return parent.expression === node; - case 176: case 175: + case 183: + case 182: + case 207: + case 249: + case 188: + case 209: + case 173: + case 193: + case 211: + case 174: + case 179: + case 180: + case 201: + case 208: + case 187: + return true; + case 166: + case 250: + case 139: + case 248: + case 142: + case 214: + return parent.initializer === node; + case 169: + return parent.expression === node; + case 177: + case 176: return parent.body === node; - case 223: + case 224: return parent.moduleReference === node; - case 135: + case 136: return parent.left === node; } return false; @@ -27169,7 +27529,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 250) { + if (container.kind === 251) { if (modulekind !== 5 && modulekind !== 4) { write("exports."); } @@ -27183,15 +27543,15 @@ var ts; if (modulekind !== 5) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 225) { + if (declaration.kind === 226) { write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 228) { + else if (declaration.kind === 229) { write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_21 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); + var name_24 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_24); if (languageVersion === 0 && identifier === "default") { write("[\"default\"]"); } @@ -27220,13 +27580,13 @@ var ts; } function isNameOfNestedRedeclaration(node) { if (languageVersion < 2) { - var parent_6 = node.parent; - switch (parent_6.kind) { - case 165: - case 216: - case 219: - case 213: - return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); + var parent_7 = node.parent; + switch (parent_7.kind) { + case 166: + case 217: + case 220: + case 214: + return parent_7.name === node && resolver.isNestedRedeclaration(parent_7); } } return false; @@ -27234,8 +27594,8 @@ var ts; function emitIdentifier(node) { if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { - var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_22); + var name_25 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_25); return; } } @@ -27335,10 +27695,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 183 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 184 && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 184 && node.parent.condition === node) { + else if (node.parent.kind === 185 && node.parent.condition === node) { return true; } return false; @@ -27346,11 +27706,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69: - case 166: - case 168: + case 167: case 169: case 170: - case 174: + case 171: + case 175: return false; } return true; @@ -27367,17 +27727,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 187) { + if (e.kind === 188) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 167) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 187) { + while (i < length && elements[i].kind !== 188) { i++; } write("["); @@ -27400,7 +27760,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 187; + return node.kind === 188; } function emitArrayLiteral(node) { var elements = node.elements; @@ -27461,7 +27821,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 145 || property.kind === 146) { + if (property.kind === 146 || property.kind === 147) { var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { continue; @@ -27512,13 +27872,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 247) { + if (property.kind === 248) { emit(property.initializer); } - else if (property.kind === 248) { + else if (property.kind === 249) { emitExpressionIdentifier(property.name); } - else if (property.kind === 143) { + else if (property.kind === 144) { emitFunctionDeclaration(property); } else { @@ -27550,7 +27910,7 @@ var ts; var numProperties = properties.length; var numInitialNonComputedProperties = numProperties; for (var i = 0, n = properties.length; i < n; i++) { - if (properties[i].name.kind === 136) { + if (properties[i].name.kind === 137) { numInitialNonComputedProperties = i; break; } @@ -27564,35 +27924,35 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(183, startsOnNewLine); + var result = ts.createSynthesizedNode(184, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(168); + var result = ts.createSynthesizedNode(169); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(169); + var result = ts.createSynthesizedNode(170); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; } function parenthesizeForAccess(expr) { - while (expr.kind === 173 || expr.kind === 191) { + while (expr.kind === 174 || expr.kind === 192) { expr = expr.expression; } if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 171 && + expr.kind !== 172 && expr.kind !== 8) { return expr; } - var node = ts.createSynthesizedNode(174); + var node = ts.createSynthesizedNode(175); node.expression = expr; return node; } @@ -27619,7 +27979,7 @@ var ts; } function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 250; + return container && container.kind !== 251; } function emitShorthandPropertyAssignment(node) { writeTextOfNode(currentText, node.name); @@ -27637,7 +27997,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 168 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 169 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -27648,7 +28008,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 168 || node.kind === 169 + return node.kind === 169 || node.kind === 170 ? resolver.getConstantValue(node) : undefined; } @@ -27728,7 +28088,7 @@ var ts; } emitExpressionIdentifier(node); break; - case 135: + case 136: emitQualifiedNameAsExpression(node, useFallback); break; default: @@ -27746,10 +28106,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 187; }); + return ts.forEach(elements, function (e) { return e.kind === 188; }); } function skipParentheses(node) { - while (node.kind === 174 || node.kind === 173 || node.kind === 191) { + while (node.kind === 175 || node.kind === 174 || node.kind === 192) { node = node.expression; } return node; @@ -27770,12 +28130,12 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 168) { + if (expr.kind === 169) { target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 169) { + else if (expr.kind === 170) { target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); @@ -27816,7 +28176,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 168 && node.expression.expression.kind === 95; + superCall = node.expression.kind === 169 && node.expression.expression.kind === 95; } if (superCall && languageVersion < 2) { write(".call("); @@ -27867,21 +28227,21 @@ var ts; } } function emitParenExpression(node) { - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176) { - if (node.expression.kind === 173 || node.expression.kind === 191) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 177) { + if (node.expression.kind === 174 || node.expression.kind === 192) { var operand = node.expression.expression; - while (operand.kind === 173 || operand.kind === 191) { + while (operand.kind === 174 || operand.kind === 192) { operand = operand.expression; } - if (operand.kind !== 181 && + if (operand.kind !== 182 && + operand.kind !== 180 && operand.kind !== 179 && operand.kind !== 178 && - operand.kind !== 177 && - operand.kind !== 182 && - operand.kind !== 171 && - !(operand.kind === 170 && node.parent.kind === 171) && - !(operand.kind === 175 && node.parent.kind === 170) && - !(operand.kind === 8 && node.parent.kind === 168)) { + operand.kind !== 183 && + operand.kind !== 172 && + !(operand.kind === 171 && node.parent.kind === 172) && + !(operand.kind === 176 && node.parent.kind === 171) && + !(operand.kind === 8 && node.parent.kind === 169)) { emit(operand); return; } @@ -27910,7 +28270,7 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 || node.parent.kind === 165); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 214 || node.parent.kind === 166); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); @@ -27925,7 +28285,7 @@ var ts; write("\", "); } write(ts.tokenToString(node.operator)); - if (node.operand.kind === 181) { + if (node.operand.kind === 182) { var operand = node.operand; if (node.operator === 35 && (operand.operator === 35 || operand.operator === 41)) { write(" "); @@ -27968,10 +28328,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 250) { + if (current.kind === 251) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 221) { + else if (ts.isFunctionLike(current) || current.kind === 222) { return false; } else { @@ -27987,14 +28347,14 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(169, false); + synthesizedLHS = ts.createSynthesizedNode(170, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 && leftHandSideExpression.argumentExpression.kind !== 9) { var tempArgumentExpression = createAndRecordTempVariable(268435456); synthesizedLHS.argumentExpression = tempArgumentExpression; - emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, true); + emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, true, leftHandSideExpression.expression); } else { synthesizedLHS.argumentExpression = leftHandSideExpression.argumentExpression; @@ -28004,7 +28364,7 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(168, false); + synthesizedLHS = ts.createSynthesizedNode(169, false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, false, false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; @@ -28032,8 +28392,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 && node.operatorToken.kind === 56 && - (node.left.kind === 167 || node.left.kind === 166)) { - emitDestructuring(node, node.parent.kind === 197); + (node.left.kind === 168 || node.left.kind === 167)) { + emitDestructuring(node, node.parent.kind === 198); } else { var exportChanged = node.operatorToken.kind >= 56 && @@ -28085,7 +28445,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 194) { + if (node && node.kind === 195) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -28099,12 +28459,12 @@ var ts; } emitToken(15, node.pos); increaseIndent(); - if (node.kind === 221) { - ts.Debug.assert(node.parent.kind === 220); + if (node.kind === 222) { + ts.Debug.assert(node.parent.kind === 221); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 221) { + if (node.kind === 222) { emitTempDeclarations(true); } decreaseIndent(); @@ -28112,7 +28472,7 @@ var ts; emitToken(16, node.statements.end); } function emitEmbeddedStatement(node) { - if (node.kind === 194) { + if (node.kind === 195) { write(" "); emit(node); } @@ -28124,7 +28484,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 176); + emitParenthesizedIf(node.expression, node.expression.kind === 177); write(";"); } function emitIfStatement(node) { @@ -28137,7 +28497,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80, node.thenStatement.end); - if (node.elseStatement.kind === 198) { + if (node.elseStatement.kind === 199) { write(" "); emit(node.elseStatement); } @@ -28157,7 +28517,7 @@ var ts; else { emitNormalLoopBody(node, true); } - if (node.statement.kind === 194) { + if (node.statement.kind === 195) { write(" "); } else { @@ -28181,7 +28541,7 @@ var ts; emitNormalLoopBody(node, true); } } - function tryEmitStartOfVariableDeclarationList(decl, startPos) { + function tryEmitStartOfVariableDeclarationList(decl) { if (shouldHoistVariable(decl, true)) { return false; } @@ -28192,31 +28552,20 @@ var ts; } return false; } - var tokenKind = 102; + emitStart(decl); if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 108; + write("let "); } else if (ts.isConst(decl)) { - tokenKind = 74; + write("const "); + } + else { + write("var "); } - } - if (startPos !== undefined) { - emitToken(tokenKind, startPos); - write(" "); } else { - switch (tokenKind) { - case 102: - write("var "); - break; - case 108: - write("let "); - break; - case 74: - write("const "); - break; - } + write("var "); } return true; } @@ -28248,7 +28597,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 209) { + if (node.parent.kind === 210) { emitLabelAndColon(node.parent); } loopEmitter(node, loop); @@ -28258,10 +28607,11 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 201: case 202: case 203: - if (node.initializer.kind === 214) { + case 204: + var initializer = node.initializer; + if (initializer && initializer.kind === 215) { loopInitializer = node.initializer; } break; @@ -28274,7 +28624,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 194; + var bodyIsBlock = node.statement.kind === 195; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -28371,7 +28721,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 194) { + else if (node.statement.kind === 195) { emitLines(node.statement.statements); } else { @@ -28467,9 +28817,9 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer && node.initializer.kind === 214) { + if (node.initializer && node.initializer.kind === 215) { var variableDeclarationList = node.initializer; - var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList); if (startIsEmitted) { emitCommaList(variableDeclarationList.declarations); } @@ -28493,7 +28843,7 @@ var ts; } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 203) { + if (languageVersion < 2 && node.kind === 204) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -28504,17 +28854,17 @@ var ts; var endPos = emitToken(86, node.pos); write(" "); endPos = emitToken(17, endPos); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + tryEmitStartOfVariableDeclarationList(variableDeclarationList); emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 202) { + if (node.kind === 203) { write(" in "); } else { @@ -28550,24 +28900,24 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); write("; "); - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write(" < "); emitNodeWithCommentsAndWithoutSourcemap(rhsReference); write(".length"); - emitEnd(node.initializer); + emitEnd(node.expression); write("; "); - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write("++"); - emitEnd(node.initializer); + emitEnd(node.expression); emitToken(18, node.expression.end); write(" {"); writeLine(); increaseIndent(); var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 214) { + if (node.initializer.kind === 215) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -28589,7 +28939,7 @@ var ts; } else { var assignmentExpression = createBinaryExpression(node.initializer, 56, rhsIterationValue, false); - if (node.initializer.kind === 166 || node.initializer.kind === 167) { + if (node.initializer.kind === 167 || node.initializer.kind === 168) { emitDestructuring(assignmentExpression, true, undefined); } else { @@ -28611,12 +28961,12 @@ var ts; } function emitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 205 ? 2 : 4; + var jump = node.kind === 206 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 205) { + if (node.kind === 206) { convertedLoopState.nonLocalJumps |= 2; write("return \"break\";"); } @@ -28627,7 +28977,7 @@ var ts; } else { var labelMarker; - if (node.kind === 205) { + if (node.kind === 206) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, true, node.label.text, labelMarker); } @@ -28640,7 +28990,7 @@ var ts; return; } } - emitToken(node.kind === 205 ? 70 : 75, node.pos); + emitToken(node.kind === 206 ? 70 : 75, node.pos); emitOptional(" ", node.label); write(";"); } @@ -28705,7 +29055,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 243) { + if (node.kind === 244) { write("case "); emit(node.expression); write(":"); @@ -28774,7 +29124,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 220); + } while (node && node.kind !== 221); return node; } function emitContainingModuleName(node) { @@ -28799,13 +29149,13 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8); zero.text = "0"; - var result = ts.createSynthesizedNode(179); + var result = ts.createSynthesizedNode(180); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 250) { - ts.Debug.assert(!!(node.flags & 512) || node.kind === 229); + if (node.parent.kind === 251) { + ts.Debug.assert(!!(node.flags & 512) || node.kind === 230); if (modulekind === 1 || modulekind === 2 || modulekind === 3) { if (!isEs6Module) { if (languageVersion !== 0) { @@ -28890,7 +29240,7 @@ var ts; emitEnd(specifier.name); write(";"); } - function emitAssignment(name, value, shouldEmitCommaBeforeAssignment) { + function emitAssignment(name, value, shouldEmitCommaBeforeAssignment, nodeForSourceMap) { if (shouldEmitCommaBeforeAssignment) { write(", "); } @@ -28900,63 +29250,75 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 || name.parent.kind === 165); - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } - write(" = "); - emit(value); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 214 || name.parent.kind === 166); + emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap); + withTemporaryNoSourceMap(function () { + if (isVariableDeclarationOrBindingElement) { + emitModuleMemberName(name.parent); + } + else { + emit(name); + } + write(" = "); + emit(value); + }); + emitEnd(nodeForSourceMap, true); if (exportChanged) { write(")"); } } - function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment) { + function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment, sourceMapNode) { var identifier = createTempVariable(0); if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); + emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment, sourceMapNode || expression.parent); return identifier; } + function isFirstVariableDeclaration(root) { + return root.kind === 214 && + root.parent.kind === 215 && + root.parent.declarations[0] === root; + } function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; var canDefineTempVariablesInPlace = false; - if (root.kind === 213) { + if (root.kind === 214) { var isExported = ts.getCombinedNodeFlags(root) & 2; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; } - else if (root.kind === 138) { + else if (root.kind === 139) { canDefineTempVariablesInPlace = true; } - if (root.kind === 183) { + if (root.kind === 184) { emitAssignmentExpression(root); } else { ts.Debug.assert(!isAssignmentExpressionStatement); + if (isFirstVariableDeclaration(root)) { + sourceMap.changeEmitSourcePos(); + } emitBindingElement(root, value); } - function ensureIdentifier(expr, reuseIdentifierExpressions) { + function ensureIdentifier(expr, reuseIdentifierExpressions, sourceMapNode) { if (expr.kind === 69 && reuseIdentifierExpressions) { return expr; } - var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0); + var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0, sourceMapNode); emitCount++; return identifier; } - function createDefaultValueCheck(value, defaultValue) { - value = ensureIdentifier(value, true); - var equals = ts.createSynthesizedNode(183); + function createDefaultValueCheck(value, defaultValue, sourceMapNode) { + value = ensureIdentifier(value, true, sourceMapNode); + var equals = ts.createSynthesizedNode(184); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(184); + var cond = ts.createSynthesizedNode(185); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53); cond.whenTrue = whenTrue; @@ -28971,9 +29333,9 @@ var ts; } function createPropertyAccessForDestructuringProperty(object, propName) { var index; - var nameIsComputed = propName.kind === 136; + var nameIsComputed = propName.kind === 137; if (nameIsComputed) { - index = ensureIdentifier(propName.expression, false); + index = ensureIdentifier(propName.expression, false, propName); } else { index = ts.createSynthesizedNode(propName.kind); @@ -28984,7 +29346,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(170); + var call = ts.createSynthesizedNode(171); var sliceIdentifier = ts.createSynthesizedNode(69); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -28992,56 +29354,56 @@ var ts; call.arguments[0] = createNumericLiteral(sliceIndex); return call; } - function emitObjectLiteralAssignment(target, value) { + function emitObjectLiteralAssignment(target, value, sourceMapNode) { var properties = target.properties; if (properties.length !== 1) { - value = ensureIdentifier(value, true); + value = ensureIdentifier(value, true, sourceMapNode); } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 247 || p.kind === 248) { + if (p.kind === 248 || p.kind === 249) { var propName = p.name; - var target_1 = p.kind === 248 ? p : p.initializer || propName; - emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); + var target_1 = p.kind === 249 ? p : p.initializer || propName; + emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName), p); } } } - function emitArrayLiteralAssignment(target, value) { + function emitArrayLiteralAssignment(target, value, sourceMapNode) { var elements = target.elements; if (elements.length !== 1) { - value = ensureIdentifier(value, true); + value = ensureIdentifier(value, true, sourceMapNode); } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189) { - if (e.kind !== 187) { - emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); + if (e.kind !== 190) { + if (e.kind !== 188) { + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)), e); } else if (i === elements.length - 1) { - emitDestructuringAssignment(e.expression, createSliceCall(value, i)); + emitDestructuringAssignment(e.expression, createSliceCall(value, i), e); } } } } - function emitDestructuringAssignment(target, value) { - if (target.kind === 248) { + function emitDestructuringAssignment(target, value, sourceMapNode) { + if (target.kind === 249) { if (target.objectAssignmentInitializer) { - value = createDefaultValueCheck(value, target.objectAssignmentInitializer); + value = createDefaultValueCheck(value, target.objectAssignmentInitializer, sourceMapNode); } target = target.name; } - else if (target.kind === 183 && target.operatorToken.kind === 56) { - value = createDefaultValueCheck(value, target.right); + else if (target.kind === 184 && target.operatorToken.kind === 56) { + value = createDefaultValueCheck(value, target.right, sourceMapNode); target = target.left; } - if (target.kind === 167) { - emitObjectLiteralAssignment(target, value); + if (target.kind === 168) { + emitObjectLiteralAssignment(target, value, sourceMapNode); } - else if (target.kind === 166) { - emitArrayLiteralAssignment(target, value); + else if (target.kind === 167) { + emitArrayLiteralAssignment(target, value, sourceMapNode); } else { - emitAssignment(target, value, emitCount > 0); + emitAssignment(target, value, emitCount > 0, sourceMapNode); emitCount++; } } @@ -29052,24 +29414,24 @@ var ts; emit(value); } else if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + emitDestructuringAssignment(target, value, ts.nodeIsSynthesized(root) ? target : root); } else { - if (root.parent.kind !== 174) { + if (root.parent.kind !== 175) { write("("); } - value = ensureIdentifier(value, true); - emitDestructuringAssignment(target, value); + value = ensureIdentifier(value, true, root); + emitDestructuringAssignment(target, value, root); write(", "); emit(value); - if (root.parent.kind !== 174) { + if (root.parent.kind !== 175) { write(")"); } } } function emitBindingElement(target, value) { if (target.initializer) { - value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; + value = value ? createDefaultValueCheck(value, target.initializer, target) : target.initializer; } else if (!value) { value = createVoidZero(); @@ -29079,15 +29441,15 @@ var ts; var elements = pattern.elements; var numElements = elements.length; if (numElements !== 1) { - value = ensureIdentifier(value, numElements !== 0); + value = ensureIdentifier(value, numElements !== 0, target); } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 163) { + if (pattern.kind === 164) { var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 189) { + else if (element.kind !== 190) { if (!element.dotDotDotToken) { emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } @@ -29098,7 +29460,7 @@ var ts; } } else { - emitAssignment(target.name, value, emitCount > 0); + emitAssignment(target.name, value, emitCount > 0, target); emitCount++; } } @@ -29119,8 +29481,8 @@ var ts; var isLetDefinedInLoop = (resolver.getNodeCheckFlags(node) & 16384) && (getCombinedFlagsForIdentifier(node.name) & 8192); if (isLetDefinedInLoop && - node.parent.parent.kind !== 202 && - node.parent.parent.kind !== 203) { + node.parent.parent.kind !== 203 && + node.parent.parent.kind !== 204) { initializer = createVoidZero(); } } @@ -29138,7 +29500,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 189) { + if (node.kind === 190) { return; } var name = node.name; @@ -29150,7 +29512,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 213 && node.parent.kind !== 165)) { + if (!node.parent || (node.parent.kind !== 214 && node.parent.kind !== 166)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -29158,7 +29520,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2) && modulekind === 5 && - node.parent.kind === 250; + node.parent.kind === 251; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -29203,12 +29565,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name_23 = createTempVariable(0); + var name_26 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_23); - emit(name_23); + tempParameters.push(name_26); + emit(name_26); } else { emit(node.name); @@ -29307,12 +29669,12 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 145 ? "get " : "set "); + write(node.kind === 146 ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 176 && languageVersion >= 2; + return node.kind === 177 && languageVersion >= 2; } function emitDeclarationName(node) { if (node.name) { @@ -29323,10 +29685,10 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 175) { + if (node.kind === 176) { return !!node.name; } - if (node.kind === 215) { + if (node.kind === 216) { return !!node.name || modulekind !== 5; } } @@ -29335,12 +29697,12 @@ var ts; return emitCommentsOnNotEmittedNode(node); } var kind = node.kind, parent = node.parent; - if (kind !== 143 && - kind !== 142 && + if (kind !== 144 && + kind !== 143 && parent && - parent.kind !== 247 && - parent.kind !== 170 && - parent.kind !== 166) { + parent.kind !== 248 && + parent.kind !== 171 && + parent.kind !== 167) { emitLeadingComments(node); } emitStart(node); @@ -29361,11 +29723,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 && kind === 215 && parent === currentSourceFile && node.name) { + if (modulekind !== 5 && kind === 216 && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (kind !== 143 && kind !== 142) { + if (kind !== 144 && kind !== 143) { emitTrailingComments(node); } } @@ -29397,7 +29759,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 176; + var isArrowFunction = node.kind === 177; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096) !== 0; if (!isArrowFunction) { write(" {"); @@ -29438,7 +29800,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 194) { + if (node.body.kind === 195) { emitBlockFunctionBody(node, node.body); } else { @@ -29490,10 +29852,10 @@ var ts; } write(" "); var current = body; - while (current.kind === 173) { + while (current.kind === 174) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 167); + emitParenthesizedIf(body, current.kind === 168); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -29563,9 +29925,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 197) { + if (statement && statement.kind === 198) { var expr = statement.expression; - if (expr && expr.kind === 170) { + if (expr && expr.kind === 171) { var func = expr.expression; if (func && func.kind === 95) { return statement; @@ -29596,7 +29958,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(memberName); write("]"); } - else if (memberName.kind === 136) { + else if (memberName.kind === 137) { emitComputedPropertyName(memberName); } else { @@ -29608,7 +29970,7 @@ var ts; var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 141 && isStatic === ((member.flags & 64) !== 0) && member.initializer) { + if (member.kind === 142 && isStatic === ((member.flags & 64) !== 0) && member.initializer) { properties.push(member); } } @@ -29648,11 +30010,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 193) { + if (member.kind === 194) { writeLine(); write(";"); } - else if (member.kind === 143 || node.kind === 142) { + else if (member.kind === 144 || node.kind === 143) { if (!member.body) { return emitCommentsOnNotEmittedNode(member); } @@ -29669,7 +30031,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 145 || member.kind === 146) { + else if (member.kind === 146 || member.kind === 147) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -29719,22 +30081,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 143 || node.kind === 142) && !member.body) { + if ((member.kind === 144 || node.kind === 143) && !member.body) { emitCommentsOnNotEmittedNode(member); } - else if (member.kind === 143 || - member.kind === 145 || - member.kind === 146) { + else if (member.kind === 144 || + member.kind === 146 || + member.kind === 147) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 64) { write("static "); } - if (member.kind === 145) { + if (member.kind === 146) { write("get "); } - else if (member.kind === 146) { + else if (member.kind === 147) { write("set "); } if (member.asteriskToken) { @@ -29745,7 +30107,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 193) { + else if (member.kind === 194) { writeLine(); write(";"); } @@ -29770,10 +30132,10 @@ var ts; function emitConstructorWorker(node, baseTypeElement) { var hasInstancePropertyWithInitializer = false; ts.forEach(node.members, function (member) { - if (member.kind === 144 && !member.body) { + if (member.kind === 145 && !member.body) { emitCommentsOnNotEmittedNode(member); } - if (member.kind === 141 && member.initializer && (member.flags & 64) === 0) { + if (member.kind === 142 && member.initializer && (member.flags & 64) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -29877,7 +30239,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 216) { + if (node.kind === 217) { if (thisNodeIsDecorated) { if (isES6ExportedDeclaration(node) && !(node.flags & 512)) { write("export "); @@ -29894,7 +30256,7 @@ var ts; } } var staticProperties = getInitializedProperties(node, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 189; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0); @@ -29957,7 +30319,7 @@ var ts; write(";"); } } - else if (node.parent.kind !== 250) { + else if (node.parent.kind !== 251) { writeLine(); emitStart(node); emitModuleMemberName(node); @@ -29969,7 +30331,7 @@ var ts; } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 216) { + if (node.kind === 217) { if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); } @@ -30029,11 +30391,11 @@ var ts; emit(baseTypeNode.expression); } write("))"); - if (node.kind === 216) { + if (node.kind === 217) { write(";"); } emitEnd(node); - if (node.kind === 216) { + if (node.kind === 217) { emitExportMemberAssignment(node); } } @@ -30100,7 +30462,7 @@ var ts; } else { decorators = member.decorators; - if (member.kind === 143) { + if (member.kind === 144) { functionLikeMember = member; } } @@ -30126,7 +30488,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); if (languageVersion > 0) { - if (member.kind !== 141) { + if (member.kind !== 142) { write(", null"); } else { @@ -30161,45 +30523,45 @@ var ts; } function shouldEmitTypeMetadata(node) { switch (node.kind) { - case 143: - case 145: + case 144: case 146: - case 141: + case 147: + case 142: return true; } return false; } function shouldEmitReturnTypeMetadata(node) { switch (node.kind) { - case 143: + case 144: return true; } return false; } function shouldEmitParamTypesMetadata(node) { switch (node.kind) { - case 216: - case 143: - case 146: + case 217: + case 144: + case 147: return true; } return false; } function emitSerializedTypeOfNode(node) { switch (node.kind) { - case 216: + case 217: write("Function"); return; - case 141: + case 142: emitSerializedTypeNode(node.type); return; - case 138: - emitSerializedTypeNode(node.type); - return; - case 145: + case 139: emitSerializedTypeNode(node.type); return; case 146: + emitSerializedTypeNode(node.type); + return; + case 147: emitSerializedTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); return; } @@ -30215,23 +30577,23 @@ var ts; case 103: write("void 0"); return; - case 160: + case 161: emitSerializedTypeNode(node.type); return; - case 152: case 153: + case 154: write("Function"); return; - case 156: case 157: + case 158: write("Array"); return; - case 150: + case 151: case 120: write("Boolean"); return; case 130: - case 162: + case 163: write("String"); return; case 128: @@ -30240,15 +30602,15 @@ var ts; case 131: write("Symbol"); return; - case 151: + case 152: emitSerializedTypeReferenceNode(node); return; - case 154: case 155: - case 158: + case 156: case 159: + case 160: case 117: - case 161: + case 162: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -30312,7 +30674,7 @@ var ts; function emitSerializedParameterTypesOfNode(node) { if (node) { var valueDeclaration; - if (node.kind === 216) { + if (node.kind === 217) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -30328,10 +30690,10 @@ var ts; } if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 156) { + if (parameterType.kind === 157) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 151 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 152 && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -30403,7 +30765,7 @@ var ts; } if (!shouldHoistDeclarationInSystemJsModule(node)) { var isES6ExportedEnum = isES6ExportedDeclaration(node); - if (!(node.flags & 2) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219))) { + if (!(node.flags & 2) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220))) { emitStart(node); if (isES6ExportedEnum) { write("export "); @@ -30483,7 +30845,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 220) { + if (moduleDeclaration.body.kind === 221) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -30506,7 +30868,7 @@ var ts; var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { var isES6ExportedNamespace = isES6ExportedDeclaration(node); - if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220)) { + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 221)) { emitStart(node); if (isES6ExportedNamespace) { write("export "); @@ -30524,7 +30886,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 221) { + if (node.body.kind === 222) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -30595,16 +30957,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 223) { + if (node.kind === 224) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 227) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 224 && node.importClause && !!node.importClause.name; + return node.kind === 225 && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -30631,7 +30993,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 226) { + if (node.importClause.namedBindings.kind === 227) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -30657,7 +31019,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 223 && (node.flags & 2) !== 0; + var isExportedImport = node.kind === 224 && (node.flags & 2) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2) { emitLeadingComments(node); @@ -30669,7 +31031,7 @@ var ts; write(" = "); } else { - var isNakedImport = 224 && !node.importClause; + var isNakedImport = 225 && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -30836,8 +31198,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 215 && - expression.kind !== 216) { + if (expression.kind !== 216 && + expression.kind !== 217) { write(";"); } emitEnd(node); @@ -30874,18 +31236,18 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 224: + case 225: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { externalImports.push(node); } break; - case 223: - if (node.moduleReference.kind === 234 && resolver.isReferencedAliasDeclaration(node)) { + case 224: + if (node.moduleReference.kind === 235 && resolver.isReferencedAliasDeclaration(node)) { externalImports.push(node); } break; - case 230: + case 231: if (node.moduleSpecifier) { if (!node.exportClause) { if (resolver.moduleExportsSomeValue(node.moduleSpecifier)) { @@ -30900,12 +31262,12 @@ var ts; else { for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_24 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); + var name_27 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_27] || (exportSpecifiers[name_27] = [])).push(specifier); } } break; - case 229: + case 230: if (node.isExportEquals && !exportEquals) { exportEquals = node; } @@ -30930,18 +31292,18 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 224 && node.importClause) { + if (node.kind === 225 && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 230 && node.moduleSpecifier) { + if (node.kind === 231 && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { if (emitRelativePathAsModuleName) { - var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_25) { - return "\"" + name_25 + "\""; + var name_28 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_28) { + return "\"" + name_28 + "\""; } } var moduleName = ts.getExternalModuleName(importNode); @@ -30958,8 +31320,8 @@ var ts; var started = false; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; - var skipNode = importNode.kind === 230 || - (importNode.kind === 224 && !importNode.importClause); + var skipNode = importNode.kind === 231 || + (importNode.kind === 225 && !importNode.importClause); if (skipNode) { continue; } @@ -30984,7 +31346,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 230 && externalImport.exportClause) { + if (externalImport.kind === 231 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -31013,7 +31375,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 230) { + if (externalImport.kind !== 231) { continue; } var exportDecl = externalImport; @@ -31087,11 +31449,11 @@ var ts; var seen = {}; for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_26 = local.kind === 69 + var name_29 = local.kind === 69 ? local : local.name; - if (name_26) { - var text = ts.unescapeIdentifier(name_26.text); + if (name_29) { + var text = ts.unescapeIdentifier(name_29.text); if (ts.hasProperty(seen, text)) { continue; } @@ -31102,7 +31464,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 216 || local.kind === 220 || local.kind === 219) { + if (local.kind === 217 || local.kind === 221 || local.kind === 220) { emitDeclarationName(local); } else { @@ -31136,21 +31498,21 @@ var ts; if (node.flags & 4) { return; } - if (node.kind === 215) { + if (node.kind === 216) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 216) { + if (node.kind === 217) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 219) { + if (node.kind === 220) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -31159,7 +31521,7 @@ var ts; } return; } - if (node.kind === 220) { + if (node.kind === 221) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -31168,17 +31530,17 @@ var ts; } return; } - if (node.kind === 213 || node.kind === 165) { + if (node.kind === 214 || node.kind === 166) { if (shouldHoistVariable(node, false)) { - var name_27 = node.name; - if (name_27.kind === 69) { + var name_30 = node.name; + if (name_30.kind === 69) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_27); + hoistedVars.push(name_30); } else { - ts.forEachChild(name_27, visit); + ts.forEachChild(name_30, visit); } } return; @@ -31204,7 +31566,7 @@ var ts; return false; } return (ts.getCombinedNodeFlags(node) & 24576) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 250; + ts.getEnclosingBlockScopeContainer(node).kind === 251; } function isCurrentFileSystemExternalModule() { return modulekind === 4 && isCurrentFileExternalModule; @@ -31242,29 +31604,29 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 224: + case 225: if (!entry.importClause) { break; } - case 223: + case 224: ts.Debug.assert(importVariableName !== ""); writeLine(); write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 230: + case 231: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { writeLine(); write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { - if (i_2 !== 0) { + for (var i_1 = 0, len = entry.exportClause.elements.length; i_1 < len; i_1++) { + if (i_1 !== 0) { write(","); writeLine(); } - var e = entry.exportClause.elements[i_2]; + var e = entry.exportClause.elements[i_1]; write("\""); emitNodeWithCommentsAndWithoutSourcemap(e.name); write("\": " + parameterName + "[\""); @@ -31296,10 +31658,10 @@ var ts; for (var i = startIndex; i < node.statements.length; i++) { var statement = node.statements[i]; switch (statement.kind) { - case 215: - case 224: + case 216: + case 225: continue; - case 230: + case 231: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -31307,7 +31669,7 @@ var ts; } } continue; - case 223: + case 224: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { continue; } @@ -31623,22 +31985,22 @@ var ts; } function emitEmitHelpers(node) { if (!compilerOptions.noEmitHelpers) { - if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { + if ((languageVersion < 2) && (!extendsEmitted && node.flags & 4194304)) { writeLines(extendsHelper); extendsEmitted = true; } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 16) { + if (!decorateEmitted && node.flags & 8388608) { writeLines(decorateHelper); if (compilerOptions.emitDecoratorMetadata) { writeLines(metadataHelper); } decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 32) { + if (!paramEmitted && node.flags & 16777216) { writeLines(paramHelper); paramEmitted = true; } - if (!awaiterEmitted && resolver.getNodeCheckFlags(node) & 64) { + if (!awaiterEmitted && node.flags & 33554432) { writeLines(awaiterHelper); awaiterEmitted = true; } @@ -31706,30 +32068,43 @@ var ts; emitJavaScriptWorker(node); } } + function changeSourceMapEmit(writer) { + sourceMap = writer; + emitStart = writer.emitStart; + emitEnd = writer.emitEnd; + emitPos = writer.emitPos; + setSourceFile = writer.setSourceFile; + } + function withTemporaryNoSourceMap(callback) { + var prevSourceMap = sourceMap; + setSourceMapWriterEmit(ts.getNullSourceMapWriter()); + callback(); + setSourceMapWriterEmit(prevSourceMap); + } function isSpecializedCommentHandling(node) { switch (node.kind) { - case 217: - case 215: - case 224: - case 223: case 218: - case 229: + case 216: + case 225: + case 224: + case 219: + case 230: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 195: + case 196: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 220: + case 221: return shouldEmitModuleDeclaration(node); - case 219: + case 220: return shouldEmitEnumDeclaration(node); } ts.Debug.assert(!isSpecializedCommentHandling(node)); - if (node.kind !== 194 && + if (node.kind !== 195 && node.parent && - node.parent.kind === 176 && + node.parent.kind === 177 && node.parent.body === node && compilerOptions.target <= 1) { return false; @@ -31740,13 +32115,13 @@ var ts; switch (node.kind) { case 69: return emitIdentifier(node); - case 138: + case 139: return emitParameter(node); + case 144: case 143: - case 142: return emitMethod(node); - case 145: case 146: + case 147: return emitAccessor(node); case 97: return emitThis(node); @@ -31766,142 +32141,142 @@ var ts; case 13: case 14: return emitLiteral(node); - case 185: - return emitTemplateExpression(node); - case 192: - return emitTemplateSpan(node); - case 235: - case 236: - return emitJsxElement(node); - case 238: - return emitJsxText(node); - case 242: - return emitJsxExpression(node); - case 135: - return emitQualifiedName(node); - case 163: - return emitObjectBindingPattern(node); - case 164: - return emitArrayBindingPattern(node); - case 165: - return emitBindingElement(node); - case 166: - return emitArrayLiteral(node); - case 167: - return emitObjectLiteral(node); - case 247: - return emitPropertyAssignment(node); - case 248: - return emitShorthandPropertyAssignment(node); - case 136: - return emitComputedPropertyName(node); - case 168: - return emitPropertyAccess(node); - case 169: - return emitIndexedAccess(node); - case 170: - return emitCallExpression(node); - case 171: - return emitNewExpression(node); - case 172: - return emitTaggedTemplateExpression(node); - case 173: - return emit(node.expression); - case 191: - return emit(node.expression); - case 174: - return emitParenExpression(node); - case 215: - case 175: - case 176: - return emitFunctionDeclaration(node); - case 177: - return emitDeleteExpression(node); - case 178: - return emitTypeOfExpression(node); - case 179: - return emitVoidExpression(node); - case 180: - return emitAwaitExpression(node); - case 181: - return emitPrefixUnaryExpression(node); - case 182: - return emitPostfixUnaryExpression(node); - case 183: - return emitBinaryExpression(node); - case 184: - return emitConditionalExpression(node); - case 187: - return emitSpreadElementExpression(node); case 186: - return emitYieldExpression(node); - case 189: - return; - case 194: - case 221: - return emitBlock(node); - case 195: - return emitVariableStatement(node); - case 196: - return write(";"); - case 197: - return emitExpressionStatement(node); - case 198: - return emitIfStatement(node); - case 199: - return emitDoStatement(node); - case 200: - return emitWhileStatement(node); - case 201: - return emitForStatement(node); - case 203: - case 202: - return emitForInOrForOfStatement(node); - case 204: - case 205: - return emitBreakOrContinueStatement(node); - case 206: - return emitReturnStatement(node); - case 207: - return emitWithStatement(node); - case 208: - return emitSwitchStatement(node); + return emitTemplateExpression(node); + case 193: + return emitTemplateSpan(node); + case 236: + case 237: + return emitJsxElement(node); + case 239: + return emitJsxText(node); case 243: - case 244: - return emitCaseOrDefaultClause(node); - case 209: - return emitLabeledStatement(node); - case 210: - return emitThrowStatement(node); - case 211: - return emitTryStatement(node); - case 246: - return emitCatchClause(node); - case 212: - return emitDebuggerStatement(node); - case 213: - return emitVariableDeclaration(node); - case 188: - return emitClassExpression(node); - case 216: - return emitClassDeclaration(node); - case 217: - return emitInterfaceDeclaration(node); - case 219: - return emitEnumDeclaration(node); + return emitJsxExpression(node); + case 136: + return emitQualifiedName(node); + case 164: + return emitObjectBindingPattern(node); + case 165: + return emitArrayBindingPattern(node); + case 166: + return emitBindingElement(node); + case 167: + return emitArrayLiteral(node); + case 168: + return emitObjectLiteral(node); + case 248: + return emitPropertyAssignment(node); case 249: - return emitEnumMember(node); + return emitShorthandPropertyAssignment(node); + case 137: + return emitComputedPropertyName(node); + case 169: + return emitPropertyAccess(node); + case 170: + return emitIndexedAccess(node); + case 171: + return emitCallExpression(node); + case 172: + return emitNewExpression(node); + case 173: + return emitTaggedTemplateExpression(node); + case 174: + return emit(node.expression); + case 192: + return emit(node.expression); + case 175: + return emitParenExpression(node); + case 216: + case 176: + case 177: + return emitFunctionDeclaration(node); + case 178: + return emitDeleteExpression(node); + case 179: + return emitTypeOfExpression(node); + case 180: + return emitVoidExpression(node); + case 181: + return emitAwaitExpression(node); + case 182: + return emitPrefixUnaryExpression(node); + case 183: + return emitPostfixUnaryExpression(node); + case 184: + return emitBinaryExpression(node); + case 185: + return emitConditionalExpression(node); + case 188: + return emitSpreadElementExpression(node); + case 187: + return emitYieldExpression(node); + case 190: + return; + case 195: + case 222: + return emitBlock(node); + case 196: + return emitVariableStatement(node); + case 197: + return write(";"); + case 198: + return emitExpressionStatement(node); + case 199: + return emitIfStatement(node); + case 200: + return emitDoStatement(node); + case 201: + return emitWhileStatement(node); + case 202: + return emitForStatement(node); + case 204: + case 203: + return emitForInOrForOfStatement(node); + case 205: + case 206: + return emitBreakOrContinueStatement(node); + case 207: + return emitReturnStatement(node); + case 208: + return emitWithStatement(node); + case 209: + return emitSwitchStatement(node); + case 244: + case 245: + return emitCaseOrDefaultClause(node); + case 210: + return emitLabeledStatement(node); + case 211: + return emitThrowStatement(node); + case 212: + return emitTryStatement(node); + case 247: + return emitCatchClause(node); + case 213: + return emitDebuggerStatement(node); + case 214: + return emitVariableDeclaration(node); + case 189: + return emitClassExpression(node); + case 217: + return emitClassDeclaration(node); + case 218: + return emitInterfaceDeclaration(node); case 220: - return emitModuleDeclaration(node); - case 224: - return emitImportDeclaration(node); - case 223: - return emitImportEqualsDeclaration(node); - case 230: - return emitExportDeclaration(node); - case 229: - return emitExportAssignment(node); + return emitEnumDeclaration(node); case 250: + return emitEnumMember(node); + case 221: + return emitModuleDeclaration(node); + case 225: + return emitImportDeclaration(node); + case 224: + return emitImportEqualsDeclaration(node); + case 231: + return emitExportDeclaration(node); + case 230: + return emitExportAssignment(node); + case 251: return emitSourceFileNode(node); } } @@ -31931,7 +32306,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 250 || node.pos !== node.parent.pos) { + if (node.parent.kind === 251 || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { return getLeadingCommentsWithoutDetachedComments(); } @@ -31943,7 +32318,7 @@ var ts; } function getTrailingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 250 || node.end !== node.parent.end) { + if (node.parent.kind === 251 || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -32329,7 +32704,23 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) - : (function (moduleNames, containingFile) { return ts.map(moduleNames, function (moduleName) { return resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }); }); + : (function (moduleNames, containingFile) { + var resolvedModuleNames = []; + var lookup = {}; + for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { + var moduleName = moduleNames_1[_i]; + var resolvedName = void 0; + if (ts.hasProperty(lookup, moduleName)) { + resolvedName = lookup[moduleName]; + } + else { + resolvedName = resolveModuleName(moduleName, containingFile, options, host).resolvedModule; + lookup[moduleName] = resolvedName; + } + resolvedModuleNames.push(resolvedName); + } + return resolvedModuleNames; + }); var filesByName = ts.createFileMap(); var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createFileMap(function (fileName) { return fileName.toLowerCase(); }) : undefined; if (oldProgram) { @@ -32431,8 +32822,11 @@ var ts; if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { return false; } + if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { + return false; + } if (resolveModuleNamesWorker) { - var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); for (var i = 0; i < moduleNames.length; i++) { var newResolution = resolutions[i]; @@ -32569,44 +32963,44 @@ var ts; return false; } switch (node.kind) { - case 223: + case 224: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return true; - case 229: + case 230: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return true; - case 216: + case 217: var classDeclaration = node; if (checkModifiers(classDeclaration.modifiers) || checkTypeParameters(classDeclaration.typeParameters)) { return true; } break; - case 245: + case 246: var heritageClause = node; if (heritageClause.token === 106) { diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return true; } break; - case 217: + case 218: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return true; - case 220: + case 221: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return true; - case 218: + case 219: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return true; - case 143: - case 142: case 144: + case 143: case 145: case 146: - case 175: - case 215: + case 147: case 176: - case 215: + case 216: + case 177: + case 216: var functionDeclaration = node; if (checkModifiers(functionDeclaration.modifiers) || checkTypeParameters(functionDeclaration.typeParameters) || @@ -32614,20 +33008,20 @@ var ts; return true; } break; - case 195: + case 196: var variableStatement = node; if (checkModifiers(variableStatement.modifiers)) { return true; } break; - case 213: + case 214: var variableDeclaration = node; if (checkTypeAnnotation(variableDeclaration.type)) { return true; } break; - case 170: case 171: + case 172: var expression = node; if (expression.typeArguments && expression.typeArguments.length > 0) { var start_2 = expression.typeArguments.pos; @@ -32635,7 +33029,7 @@ var ts; return true; } break; - case 138: + case 139: var parameter = node; if (parameter.modifiers) { var start_3 = parameter.modifiers.pos; @@ -32651,17 +33045,17 @@ var ts; return true; } break; - case 141: + case 142: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); return true; - case 219: + case 220: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return true; - case 173: + case 174: var typeAssertionExpression = node; diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return true; - case 139: + case 140: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); return true; } @@ -32737,51 +33131,64 @@ var ts; function moduleNameIsEqualTo(a, b) { return a.text === b.text; } + function getTextOfLiteral(literal) { + return literal.text; + } function collectExternalModuleReferences(file) { if (file.imports) { return; } var isJavaScriptFile = ts.isSourceFileJavaScript(file); + var isExternalModuleFile = ts.isExternalModule(file); var imports; + var moduleAugmentations; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, true, false); + collectModuleReferences(node, false); + if (isJavaScriptFile) { + collectRequireCalls(node); + } } file.imports = imports || emptyArray; + file.moduleAugmentations = moduleAugmentations || emptyArray; return; - function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { - if (!collectOnlyRequireCalls) { - switch (node.kind) { - case 224: - case 223: - case 230: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9) { - break; - } - if (!moduleNameExpr.text) { - break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } + function collectModuleReferences(node, inAmbientModule) { + switch (node.kind) { + case 225: + case 224: + case 231: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9) { break; - case 220: - if (node.name.kind === 9 && (node.flags & 4 || ts.isDeclarationFile(file))) { - ts.forEachChild(node.body, function (node) { - collect(node, false, collectOnlyRequireCalls); - }); - } + } + if (!moduleNameExpr.text) { break; - } + } + if (!inAmbientModule || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } + break; + case 221: + if (ts.isAmbientModule(node) && (inAmbientModule || node.flags & 4 || ts.isDeclarationFile(file))) { + var moduleName = node.name; + if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) { + (moduleAugmentations || (moduleAugmentations = [])).push(moduleName); + } + else if (!inAmbientModule) { + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + collectModuleReferences(statement, true); + } + } + } } - if (isJavaScriptFile) { - if (ts.isRequireCall(node)) { - (imports || (imports = [])).push(node.arguments[0]); - } - else { - ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, true); }); - } + } + function collectRequireCalls(node) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, collectRequireCalls); } } } @@ -32887,14 +33294,17 @@ var ts; } function processImportedModules(file, basePath) { collectExternalModuleReferences(file); - if (file.imports.length) { + if (file.imports.length || file.moduleAugmentations.length) { file.resolvedModules = {}; - var moduleNames = ts.map(file.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(file.imports, file.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; i++) { + for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); - if (resolution && !options.noResolve) { + var shouldAddFile = resolution && + !options.noResolve && + i < file.imports.length; + if (shouldAddFile) { var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { if (!ts.isExternalModule(importedFile)) { @@ -33117,6 +33527,9 @@ var ts; startNode.getStart(sourceFile); return ts.createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } + function textSpanEndingAtNextToken(startNode, previousTokenToFindNextEndToken) { + return textSpan(startNode, ts.findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent)); + } function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); @@ -33134,104 +33547,90 @@ var ts; } function spanInNode(node) { if (node) { - if (ts.isExpression(node)) { - if (node.parent.kind === 199) { - return spanInPreviousNode(node); - } - if (node.parent.kind === 139) { - return spanInNode(node.parent); - } - if (node.parent.kind === 201) { - return textSpan(node); - } - if (node.parent.kind === 183 && node.parent.operatorToken.kind === 24) { - return textSpan(node); - } - if (node.parent.kind === 176 && node.parent.body === node) { - return textSpan(node); - } - } switch (node.kind) { - case 195: + case 196: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 213: - case 141: - case 140: - return spanInVariableDeclaration(node); - case 138: - return spanInParameterDeclaration(node); - case 215: - case 143: + case 214: case 142: - case 145: - case 146: + case 141: + return spanInVariableDeclaration(node); + case 139: + return spanInParameterDeclaration(node); + case 216: case 144: - case 175: + case 143: + case 146: + case 147: + case 145: case 176: + case 177: return spanInFunctionDeclaration(node); - case 194: + case 195: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 221: + case 222: return spanInBlock(node); - case 246: + case 247: return spanInBlock(node.block); - case 197: - return textSpan(node.expression); - case 206: - return textSpan(node.getChildAt(0), node.expression); - case 200: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 199: - return spanInNode(node.statement); - case 212: - return textSpan(node.getChildAt(0)); case 198: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 209: - return spanInNode(node.statement); - case 205: - case 204: - return textSpan(node.getChildAt(0), node.label); + return textSpan(node.expression); + case 207: + return textSpan(node.getChildAt(0), node.expression); case 201: - return spanInForStatement(node); - case 202: - case 203: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 208: - return textSpan(node, ts.findNextToken(node.expression, node)); - case 243: - case 244: - return spanInNode(node.statements[0]); - case 211: - return spanInBlock(node.tryBlock); + return textSpanEndingAtNextToken(node, node.expression); + case 200: + return spanInNode(node.statement); + case 213: + return textSpan(node.getChildAt(0)); + case 199: + return textSpanEndingAtNextToken(node, node.expression); case 210: + return spanInNode(node.statement); + case 206: + case 205: + return textSpan(node.getChildAt(0), node.label); + case 202: + return spanInForStatement(node); + case 203: + return textSpanEndingAtNextToken(node, node.expression); + case 204: + return spanInInitializerOfForLike(node); + case 209: + return textSpanEndingAtNextToken(node, node.expression); + case 244: + case 245: + return spanInNode(node.statements[0]); + case 212: + return spanInBlock(node.tryBlock); + case 211: return textSpan(node, node.expression); - case 229: - return textSpan(node, node.expression); - case 223: - return textSpan(node, node.moduleReference); - case 224: - return textSpan(node, node.moduleSpecifier); case 230: + return textSpan(node, node.expression); + case 224: + return textSpan(node, node.moduleReference); + case 225: return textSpan(node, node.moduleSpecifier); - case 220: + case 231: + return textSpan(node, node.moduleSpecifier); + case 221: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 216: - case 219: - case 249: - case 170: - case 171: - return textSpan(node); - case 207: - return spanInNode(node.statement); - case 139: - return spanInNodeArray(node.parent.decorators); case 217: + case 220: + case 250: + case 166: + return textSpan(node); + case 208: + return spanInNode(node.statement); + case 140: + return spanInNodeArray(node.parent.decorators); + case 164: + case 165: + return spanInBindingPattern(node); case 218: + case 219: return undefined; case 23: case 1: @@ -33242,6 +33641,8 @@ var ts; return spanInOpenBraceToken(node); case 16: return spanInCloseBraceToken(node); + case 20: + return spanInCloseBracketToken(node); case 17: return spanInOpenParenToken(node); case 18: @@ -33257,48 +33658,108 @@ var ts; case 72: case 85: return spanInNextNode(node); + case 135: + return spanInOfKeyword(node); default: - if (node.parent.kind === 247 && node.parent.name === node) { + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); + } + if ((node.kind === 69 || + node.kind == 188 || + node.kind === 248 || + node.kind === 249) && + ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + return textSpan(node); + } + if (node.kind === 184) { + var binaryExpression = node; + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); + } + if (binaryExpression.operatorToken.kind === 56 && + ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + return textSpan(node); + } + if (binaryExpression.operatorToken.kind === 24) { + return spanInNode(binaryExpression.left); + } + } + if (ts.isExpression(node)) { + switch (node.parent.kind) { + case 200: + return spanInPreviousNode(node); + case 140: + return spanInNode(node.parent); + case 202: + case 204: + return textSpan(node); + case 184: + if (node.parent.operatorToken.kind === 24) { + return textSpan(node); + } + break; + case 177: + if (node.parent.body === node) { + return textSpan(node); + } + break; + } + } + if (node.parent.kind === 248 && + node.parent.name === node && + !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 173 && node.parent.type === node) { - return spanInNode(node.parent.expression); + if (node.parent.kind === 174 && node.parent.type === node) { + return spanInNextNode(node.parent.type); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } + if ((node.parent.kind === 214 || + node.parent.kind === 139)) { + var paramOrVarDecl = node.parent; + if (paramOrVarDecl.initializer === node || + paramOrVarDecl.type === node || + ts.isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + } + if (node.parent.kind === 184) { + var binaryExpression = node.parent; + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && + (binaryExpression.right === node || + binaryExpression.operatorToken === node)) { + return spanInPreviousNode(node); + } + } return spanInNode(node.parent); } } + function textSpanFromVariableDeclaration(variableDeclaration) { + var declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] === variableDeclaration) { + return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + else { + return textSpan(variableDeclaration); + } + } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 202 || - variableDeclaration.parent.parent.kind === 203) { + if (variableDeclaration.parent.parent.kind === 203) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 195; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 201 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); - var declarations = isParentVariableStatement - ? variableDeclaration.parent.parent.declarationList.declarations - : isDeclarationOfForStatement - ? variableDeclaration.parent.parent.initializer.declarations - : undefined; - if (variableDeclaration.initializer || (variableDeclaration.flags & 2)) { - if (declarations && declarations[0] === variableDeclaration) { - if (isParentVariableStatement) { - return textSpan(variableDeclaration.parent, variableDeclaration); - } - else { - ts.Debug.assert(isDeclarationOfForStatement); - return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); - } - } - else { - return textSpan(variableDeclaration); - } + if (ts.isBindingPattern(variableDeclaration.name)) { + return spanInBindingPattern(variableDeclaration.name); } - else if (declarations && declarations[0] !== variableDeclaration) { - var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); - return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + if (variableDeclaration.initializer || + (variableDeclaration.flags & 2) || + variableDeclaration.parent.parent.kind === 204) { + return textSpanFromVariableDeclaration(variableDeclaration); + } + var declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] !== variableDeclaration) { + return spanInNode(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } } function canHaveSpanInParameterDeclaration(parameter) { @@ -33306,7 +33767,10 @@ var ts; !!(parameter.flags & 8) || !!(parameter.flags & 16); } function spanInParameterDeclaration(parameter) { - if (canHaveSpanInParameterDeclaration(parameter)) { + if (ts.isBindingPattern(parameter.name)) { + return spanInBindingPattern(parameter.name); + } + else if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); } else { @@ -33322,7 +33786,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 2) || - (functionDeclaration.parent.kind === 216 && functionDeclaration.kind !== 144); + (functionDeclaration.parent.kind === 217 && functionDeclaration.kind !== 145); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -33342,31 +33806,34 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 220: + case 221: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 200: - case 198: - case 202: + case 201: + case 199: case 203: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 201: + case 202: + case 204: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } + function spanInInitializerOfForLike(forLikeStaement) { + if (forLikeStaement.initializer.kind === 215) { + var variableDeclarationList = forLikeStaement.initializer; + if (variableDeclarationList.declarations.length > 0) { + return spanInNode(variableDeclarationList.declarations[0]); + } + } + else { + return spanInNode(forLikeStaement.initializer); + } + } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 214) { - var variableDeclarationList = forStatement.initializer; - if (variableDeclarationList.declarations.length > 0) { - return spanInNode(variableDeclarationList.declarations[0]); - } - } - else { - return spanInNode(forStatement.initializer); - } + return spanInInitializerOfForLike(forStatement); } if (forStatement.condition) { return textSpan(forStatement.condition); @@ -33375,84 +33842,142 @@ var ts; return textSpan(forStatement.incrementor); } } + function spanInBindingPattern(bindingPattern) { + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 190 ? element : undefined; }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + if (bindingPattern.parent.kind === 166) { + return textSpan(bindingPattern.parent); + } + return textSpanFromVariableDeclaration(bindingPattern.parent); + } + function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { + ts.Debug.assert(node.kind !== 165 && node.kind !== 164); + var elements = node.kind === 167 ? + node.elements : + node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 190 ? element : undefined; }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + return textSpan(node.parent.kind === 184 ? node.parent : node); + } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 219: + case 220: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 216: + case 217: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 222: + case 223: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 221: + case 222: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } - case 219: - case 216: + case 220: + case 217: return textSpan(node); - case 194: + case 195: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 246: + case 247: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 222: + case 223: var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; + case 164: + var bindingPattern = node.parent; + return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); default: + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + var objectLiteral = node.parent; + return textSpan(ts.lastOrUndefined(objectLiteral.properties) || objectLiteral); + } + return spanInNode(node.parent); + } + } + function spanInCloseBracketToken(node) { + switch (node.parent.kind) { + case 165: + var bindingPattern = node.parent; + return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); + default: + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + var arrayLiteral = node.parent; + return textSpan(ts.lastOrUndefined(arrayLiteral.elements) || arrayLiteral); + } return spanInNode(node.parent); } } function spanInOpenParenToken(node) { - if (node.parent.kind === 199) { + if (node.parent.kind === 200 || + node.parent.kind === 171 || + node.parent.kind === 172) { return spanInPreviousNode(node); } + if (node.parent.kind === 175) { + return spanInNextNode(node); + } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 175: - case 215: case 176: - case 143: - case 142: - case 145: - case 146: + case 216: + case 177: case 144: - case 200: - case 199: + case 143: + case 146: + case 147: + case 145: case 201: + case 200: + case 202: + case 204: + case 171: + case 172: + case 175: return spanInPreviousNode(node); default: return spanInNode(node.parent); } } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 247) { + if (ts.isFunctionLike(node.parent) || + node.parent.kind === 248 || + node.parent.kind === 139) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 173) { - return spanInNode(node.parent.expression); + if (node.parent.kind === 174) { + return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 199) { - return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); + if (node.parent.kind === 200) { + return textSpanEndingAtNextToken(node, node.parent.expression); + } + return spanInNode(node.parent); + } + function spanInOfKeyword(node) { + if (node.parent.kind === 204) { + return spanInNextNode(node); } return spanInNode(node.parent); } @@ -33529,7 +34054,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 176; + return ts.isFunctionBlock(node) && node.parent.kind !== 177; } var depth = 0; var maxDepth = 20; @@ -33541,26 +34066,26 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 194: + case 195: if (!ts.isFunctionBlock(n)) { - var parent_7 = n.parent; + var parent_8 = n.parent; var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); - if (parent_7.kind === 199 || - parent_7.kind === 202 || - parent_7.kind === 203 || - parent_7.kind === 201 || - parent_7.kind === 198 || - parent_7.kind === 200 || - parent_7.kind === 207 || - parent_7.kind === 246) { - addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); + if (parent_8.kind === 200 || + parent_8.kind === 203 || + parent_8.kind === 204 || + parent_8.kind === 202 || + parent_8.kind === 199 || + parent_8.kind === 201 || + parent_8.kind === 208 || + parent_8.kind === 247) { + addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_7.kind === 211) { - var tryStatement = parent_7; + if (parent_8.kind === 212) { + var tryStatement = parent_8; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -33580,23 +34105,23 @@ var ts; }); break; } - case 221: { + case 222: { var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 216: case 217: - case 219: - case 167: - case 222: { + case 218: + case 220: + case 168: + case 223: { var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 166: + case 167: var openBracket = ts.findChildOfKind(n, 19, sourceFile); var closeBracket = ts.findChildOfKind(n, 20, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -33623,10 +34148,10 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_28 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_28); + for (var name_31 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_31); if (declarations) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_28); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_31); if (!matches) { continue; } @@ -33637,14 +34162,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_28); + matches = patternMatcher.getMatches(containers, name_31); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_28, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_31, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -33681,7 +34206,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 136) { + else if (declaration.name.kind === 137) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { @@ -33698,7 +34223,7 @@ var ts; } return true; } - if (expression.kind === 168) { + if (expression.kind === 169) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -33709,7 +34234,7 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 136) { + if (declaration.name.kind === 137) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } @@ -33771,14 +34296,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 220: + case 221: do { current = current.parent; - } while (current.kind === 220); - case 216: - case 219: + } while (current.kind === 221); case 217: - case 215: + case 220: + case 218: + case 216: indent++; } current = current.parent; @@ -33789,26 +34314,26 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 195: + case 196: ts.forEach(node.declarationList.declarations, visit); break; - case 163: case 164: + case 165: ts.forEach(node.elements, visit); break; - case 230: + case 231: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 224: + case 225: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226) { + if (importClause.namedBindings.kind === 227) { childNodes.push(importClause.namedBindings); } else { @@ -33817,20 +34342,20 @@ var ts; } } break; - case 165: - case 213: + case 166: + case 214: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 216: - case 219: case 217: case 220: - case 215: - case 223: - case 228: - case 232: + case 218: + case 221: + case 216: + case 224: + case 229: + case 233: childNodes.push(node); break; } @@ -33865,17 +34390,17 @@ var ts; for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { var node = nodes_4[_i]; switch (node.kind) { - case 216: - case 219: case 217: + case 220: + case 218: topLevelNodes.push(node); break; - case 220: + case 221: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 215: + case 216: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -33886,9 +34411,9 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 215) { - if (functionDeclaration.body && functionDeclaration.body.kind === 194) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 215 && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 216) { + if (functionDeclaration.body && functionDeclaration.body.kind === 195) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 216 && !isEmpty(s.name.text); })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -33941,7 +34466,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 138: + case 139: if (ts.isBindingPattern(node.name)) { break; } @@ -33949,34 +34474,34 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + case 144: case 143: - case 142: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 145: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); case 146: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 149: - return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 249: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); case 147: - return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 148: - return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 141: - case 140: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); + case 150: + return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); + case 250: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 215: + case 148: + return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); + case 149: + return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); + case 142: + case 141: + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); + case 216: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 213: - case 165: + case 214: + case 166: var variableDeclarationNode; - var name_29; - if (node.kind === 165) { - name_29 = node.name; + var name_32; + if (node.kind === 166) { + name_32 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 213) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 214) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -33984,24 +34509,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_29 = node.name; + name_32 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.variableElement); } - case 144: + case 145: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 232: - case 228: - case 223: - case 225: + case 233: + case 229: + case 224: case 226: + case 227: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -34031,27 +34556,27 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 250: + case 251: return createSourceFileItem(node); - case 216: - return createClassItem(node); - case 219: - return createEnumItem(node); case 217: - return createIterfaceItem(node); + return createClassItem(node); case 220: + return createEnumItem(node); + case 218: + return createIterfaceItem(node); + case 221: return createModuleItem(node); - case 215: + case 216: return createFunctionItem(node); } return undefined; function getModuleName(moduleDeclaration) { - if (moduleDeclaration.name.kind === 9) { + if (ts.isAmbientModule(moduleDeclaration)) { return getTextOfNode(moduleDeclaration.name); } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 220) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 221) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -34063,7 +34588,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.body && node.body.kind === 194) { + if (node.body && node.body.kind === 195) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -34084,7 +34609,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 144 && member; + return member.kind === 145 && member; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { @@ -34105,19 +34630,19 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 136; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 137; }); } function removeDynamicallyNamedProperties(node) { return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 220) { + while (node.body.kind === 221) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 250 + return node.kind === 251 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -34572,14 +35097,14 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 170) { + if (argumentInfo.invocation.kind !== 171) { return undefined; } var callExpression = argumentInfo.invocation; var expression = callExpression.expression; var name = expression.kind === 69 ? expression - : expression.kind === 168 + : expression.kind === 169 ? expression.name : undefined; if (!name || !name.text) { @@ -34608,7 +35133,7 @@ var ts; } } function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 170 || node.parent.kind === 171) { + if (node.parent.kind === 171 || node.parent.kind === 172) { var callExpression = node.parent; if (node.kind === 25 || node.kind === 17) { @@ -34639,23 +35164,23 @@ var ts; }; } } - else if (node.kind === 11 && node.parent.kind === 172) { + else if (node.kind === 11 && node.parent.kind === 173) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 12 && node.parent.parent.kind === 172) { + else if (node.kind === 12 && node.parent.parent.kind === 173) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 185); + ts.Debug.assert(templateExpression.kind === 186); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 192 && node.parent.parent.parent.kind === 172) { + else if (node.parent.kind === 193 && node.parent.parent.parent.kind === 173) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 185); + ts.Debug.assert(templateExpression.kind === 186); if (node.kind === 14 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } @@ -34719,7 +35244,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 185) { + if (template.kind === 186) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -34728,7 +35253,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 250; n = n.parent) { + for (var n = node; n.kind !== 251; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -34908,39 +35433,39 @@ var ts; return false; } switch (n.kind) { - case 216: case 217: - case 219: - case 167: - case 163: - case 155: - case 194: - case 221: + case 218: + case 220: + case 168: + case 164: + case 156: + case 195: case 222: + case 223: return nodeEndsWith(n, 16, sourceFile); - case 246: + case 247: return isCompletedNode(n.block, sourceFile); - case 171: + case 172: if (!n.arguments) { return true; } - case 170: - case 174: - case 160: + case 171: + case 175: + case 161: return nodeEndsWith(n, 18, sourceFile); - case 152: case 153: + case 154: return isCompletedNode(n.type, sourceFile); - case 144: case 145: case 146: - case 215: - case 175: - case 143: - case 142: - case 148: case 147: + case 216: case 176: + case 144: + case 143: + case 149: + case 148: + case 177: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -34948,62 +35473,62 @@ var ts; return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 18, sourceFile); - case 220: + case 221: return n.body && isCompletedNode(n.body, sourceFile); - case 198: + case 199: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 197: + case 198: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 23); - case 166: - case 164: - case 169: - case 136: - case 157: + case 167: + case 165: + case 170: + case 137: + case 158: return nodeEndsWith(n, 20, sourceFile); - case 149: + case 150: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 20, sourceFile); - case 243: case 244: + case 245: return false; - case 201: case 202: case 203: - case 200: + case 204: + case 201: return isCompletedNode(n.statement, sourceFile); - case 199: + case 200: var hasWhileKeyword = findChildOfKind(n, 104, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 18, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 154: + case 155: return isCompletedNode(n.exprName, sourceFile); - case 178: - case 177: case 179: - case 186: + case 178: + case 180: case 187: + case 188: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 172: + case 173: return isCompletedNode(n.template, sourceFile); - case 185: + case 186: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 192: + case 193: return ts.nodeIsPresent(n.literal); - case 181: + case 182: return isCompletedNode(n.operand, sourceFile); - case 183: - return isCompletedNode(n.right, sourceFile); case 184: + return isCompletedNode(n.right, sourceFile); + case 185: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -35046,7 +35571,7 @@ var ts; ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 273 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 274 && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -35126,7 +35651,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n) || n.kind === 238) { + if (isToken(n) || n.kind === 239) { return n; } var children = n.getChildren(); @@ -35134,16 +35659,16 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n) || n.kind === 238) { + if (isToken(n) || n.kind === 239) { return n; } var children = n.getChildren(); for (var i = 0, len = children.length; i < len; i++) { var child = children[i]; - if (position < child.end && (nodeHasTokens(child) || child.kind === 238)) { + if (position < child.end && (nodeHasTokens(child) || child.kind === 239)) { var start = child.getStart(sourceFile); var lookInPreviousChild = (start >= position) || - (child.kind === 238 && start === child.end); + (child.kind === 239 && start === child.end); if (lookInPreviousChild) { var candidate = findRightmostChildNodeWithTokens(children, i); return candidate && findRightmostToken(candidate); @@ -35153,7 +35678,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 250); + ts.Debug.assert(startNode !== undefined || n.kind === 251); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -35170,7 +35695,7 @@ var ts; ts.findPrecedingToken = findPrecedingToken; function isInString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); - return token && (token.kind === 9 || token.kind === 162) && position > token.getStart(); + return token && (token.kind === 9 || token.kind === 163) && position > token.getStart(); } ts.isInString = isInString; function isInComment(sourceFile, position) { @@ -35253,17 +35778,17 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 151 || node.kind === 170) { + if (node.kind === 152 || node.kind === 171) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 216 || node.kind === 217) { + if (ts.isFunctionLike(node) || node.kind === 217 || node.kind === 218) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 && n.kind <= 134; + return n.kind >= 0 && n.kind <= 135; } ts.isToken = isToken; function isWord(kind) { @@ -35279,7 +35804,7 @@ var ts; ts.isComment = isComment; function isStringOrRegularExpressionOrTemplateLiteral(kind) { if (kind === 9 - || kind === 162 + || kind === 163 || kind === 10 || ts.isTemplateLiteralKind(kind)) { return true; @@ -35322,11 +35847,30 @@ var ts; return true; } ts.compareDataObjects = compareDataObjects; + function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { + if (node.kind === 167 || + node.kind === 168) { + if (node.parent.kind === 184 && + node.parent.left === node && + node.parent.operatorToken.kind === 56) { + return true; + } + if (node.parent.kind === 204 && + node.parent.initializer === node) { + return true; + } + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 248 ? node.parent.parent : node.parent)) { + return true; + } + } + return false; + } + ts.isArrayLiteralOrObjectLiteralDestructuringPattern = isArrayLiteralOrObjectLiteralDestructuringPattern; })(ts || (ts = {})); var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 138; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 139; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -35507,7 +36051,7 @@ var ts; ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 228 || location.parent.kind === 232) && + (location.parent.kind === 229 || location.parent.kind === 233) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -35609,10 +36153,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { + case 241: + case 238: case 240: case 237: - case 239: - case 236: return node.kind === 69; } } @@ -36084,41 +36628,41 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_30 in o) { - if (o[name_30] === rule) { - return name_30; + for (var name_33 in o) { + if (o[name_33] === rule) { + return name_33; } } throw new Error("Unknown rule"); }; Rules.IsForContext = function (context) { - return context.contextNode.kind === 201; + return context.contextNode.kind === 202; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 183: case 184: - case 191: - case 150: - case 158: + case 185: + case 192: + case 151: case 159: + case 160: return true; - case 165: - case 218: - case 223: - case 213: - case 138: - case 249: + case 166: + case 219: + case 224: + case 214: + case 139: + case 250: + case 142: case 141: - case 140: return context.currentTokenSpan.kind === 56 || context.nextTokenSpan.kind === 56; - case 202: - return context.currentTokenSpan.kind === 90 || context.nextTokenSpan.kind === 90; case 203: - return context.currentTokenSpan.kind === 134 || context.nextTokenSpan.kind === 134; + return context.currentTokenSpan.kind === 90 || context.nextTokenSpan.kind === 90; + case 204: + return context.currentTokenSpan.kind === 135 || context.nextTokenSpan.kind === 135; } return false; }; @@ -36126,7 +36670,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 184; + return context.contextNode.kind === 185; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); @@ -36151,86 +36695,86 @@ var ts; return true; } switch (node.kind) { - case 194: + case 195: + case 223: + case 168: case 222: - case 167: - case 221: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 215: + case 216: + case 144: case 143: - case 142: - case 145: case 146: case 147: - case 175: - case 144: + case 148: case 176: - case 217: + case 145: + case 177: + case 218: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 215 || context.contextNode.kind === 175; + return context.contextNode.kind === 216 || context.contextNode.kind === 176; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 216: - case 188: case 217: - case 219: - case 155: + case 189: + case 218: case 220: + case 156: + case 221: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 216: - case 220: - case 219: - case 194: - case 246: + case 217: case 221: - case 208: + case 220: + case 195: + case 247: + case 222: + case 209: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 198: - case 208: - case 201: + case 199: + case 209: case 202: case 203: + case 204: + case 201: + case 212: case 200: - case 211: - case 199: - case 207: - case 246: + case 208: + case 247: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 167; + return context.contextNode.kind === 168; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 170; + return context.contextNode.kind === 171; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 171; + return context.contextNode.kind === 172; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -36242,7 +36786,7 @@ var ts; return context.nextTokenSpan.kind !== 20; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 176; + return context.contextNode.kind === 177; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); @@ -36260,41 +36804,41 @@ var ts; while (ts.isExpression(node)) { node = node.parent; } - return node.kind === 139; + return node.kind === 140; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 214 && + return context.currentTokenParent.kind === 215 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 220; + return context.contextNode.kind === 221; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 155; + return context.contextNode.kind === 156; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { if (token.kind !== 25 && token.kind !== 27) { return false; } switch (parent.kind) { - case 151: - case 173: - case 216: - case 188: + case 152: + case 174: case 217: - case 215: - case 175: + case 189: + case 218: + case 216: case 176: + case 177: + case 144: case 143: - case 142: - case 147: case 148: - case 170: + case 149: case 171: - case 190: + case 172: + case 191: return true; default: return false; @@ -36305,13 +36849,13 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 173; + return context.contextNode.kind === 174; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 103 && context.currentTokenParent.kind === 179; + return context.currentTokenSpan.kind === 103 && context.currentTokenParent.kind === 180; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 186 && context.contextNode.expression !== undefined; + return context.contextNode.kind === 187 && context.contextNode.expression !== undefined; }; return Rules; }()); @@ -36333,7 +36877,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 134 + 1; + this.mapRowLength = 135 + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); var rulesBucketConstructionStateList = new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); @@ -36509,7 +37053,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 134; token++) { + for (var token = 0; token <= 135; token++) { result.push(token); } return result; @@ -36551,9 +37095,9 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - TokenRange.Keywords = TokenRange.FromRange(70, 134); + TokenRange.Keywords = TokenRange.FromRange(70, 135); TokenRange.BinaryOperators = TokenRange.FromRange(25, 68); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90, 91, 134, 116, 124]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90, 91, 135, 116, 124]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([41, 42, 50, 49]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8, 69, 17, 19, 15, 97, 92]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([69, 17, 97, 92]); @@ -36740,17 +37284,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 216: case 217: + case 218: return ts.rangeContainsRange(parent.members, node); - case 220: - var body = parent.body; - return body && body.kind === 194 && ts.rangeContainsRange(body.statements, node); - case 250: - case 194: case 221: + var body = parent.body; + return body && body.kind === 195 && ts.rangeContainsRange(body.statements, node); + case 251: + case 195: + case 222: return ts.rangeContainsRange(parent.statements, node); - case 246: + case 247: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -36905,18 +37449,18 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 216: return 73; - case 217: return 107; - case 215: return 87; - case 219: return 219; - case 145: return 123; - case 146: return 129; - case 143: + case 217: return 73; + case 218: return 107; + case 216: return 87; + case 220: return 220; + case 146: return 123; + case 147: return 129; + case 144: if (node.asteriskToken) { return 37; } - case 141: - case 138: + case 142: + case 139: return node.name.kind; } } @@ -37029,7 +37573,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 139 ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 140 ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -37332,20 +37876,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 194: - case 221: + case 195: + case 222: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 144: - case 215: - case 175: - case 143: - case 142: + case 145: + case 216: case 176: + case 144: + case 143: + case 177: if (node.typeParameters === list) { return 25; } @@ -37353,8 +37897,8 @@ var ts; return 17; } break; - case 170: case 171: + case 172: if (node.typeArguments === list) { return 25; } @@ -37362,7 +37906,7 @@ var ts; return 17; } break; - case 151: + case 152: if (node.typeArguments === list) { return 25; } @@ -37463,7 +38007,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 24 && precedingToken.parent.kind !== 183) { + if (precedingToken.kind === 24 && precedingToken.parent.kind !== 184) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -37561,7 +38105,7 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 250 || !parentAndChildShareLine); + (parent.kind === 251 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -37585,7 +38129,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 198 && parent.elseStatement === child) { + if (parent.kind === 199 && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 80, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -37597,23 +38141,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 151: + case 152: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 167: + case 168: return node.parent.properties; - case 166: + case 167: return node.parent.elements; - case 215: - case 175: + case 216: case 176: + case 177: + case 144: case 143: - case 142: - case 147: - case 148: { + case 148: + case 149: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -37624,8 +38168,8 @@ var ts; } break; } - case 171: - case 170: { + case 172: + case 171: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -37653,8 +38197,8 @@ var ts; if (node.kind === 18) { return -1; } - if (node.parent && (node.parent.kind === 170 || - node.parent.kind === 171) && + if (node.parent && (node.parent.kind === 171 || + node.parent.kind === 172) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -37672,10 +38216,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 170: case 171: - case 168: + case 172: case 169: + case 170: node = node.expression; break; default: @@ -37729,45 +38273,45 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 197: - case 216: - case 188: + case 198: case 217: - case 219: + case 189: case 218: - case 166: - case 194: - case 221: + case 220: + case 219: case 167: - case 155: - case 157: - case 222: - case 244: - case 243: - case 174: - case 168: - case 170: - case 171: case 195: - case 213: - case 229: - case 206: - case 184: - case 164: - case 163: - case 237: - case 236: - case 242: - case 142: - case 147: - case 148: - case 138: - case 152: - case 153: - case 160: + case 222: + case 168: + case 156: + case 158: + case 223: + case 245: + case 244: + case 175: + case 169: + case 171: case 172: - case 180: - case 227: + case 196: + case 214: + case 230: + case 207: + case 185: + case 165: + case 164: + case 238: + case 237: + case 243: + case 143: + case 148: + case 149: + case 139: + case 153: + case 154: + case 161: + case 173: + case 181: + case 228: return true; } return false; @@ -37775,22 +38319,22 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0; switch (parent.kind) { - case 199: case 200: - case 202: - case 203: case 201: - case 198: - case 215: - case 175: - case 143: + case 203: + case 204: + case 202: + case 199: + case 216: case 176: case 144: + case 177: case 145: case 146: - return childKind !== 194; - case 235: - return childKind !== 239; + case 147: + return childKind !== 195; + case 236: + return childKind !== 240; } return indentByDefault; } @@ -37925,7 +38469,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(273, nodes.pos, nodes.end, 2048, this); + var list = createNode(274, nodes.pos, nodes.end, 2048, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { @@ -37944,7 +38488,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 135) { + if (this.kind >= 136) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -37991,7 +38535,7 @@ var ts; return undefined; } var child = children[0]; - return child.kind < 135 ? child : child.getFirstToken(sourceFile); + return child.kind < 136 ? child : child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -37999,7 +38543,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 135 ? child : child.getLastToken(sourceFile); + return child.kind < 136 ? child : child.getLastToken(sourceFile); }; return NodeObject; }()); @@ -38041,7 +38585,7 @@ var ts; ts.forEach(declarations, function (declaration, indexOfDeclaration) { if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 138) { + if (canUseParsedParamTagComments && declaration.kind === 139) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -38049,13 +38593,13 @@ var ts; } }); } - if (declaration.kind === 220 && declaration.body.kind === 220) { + if (declaration.kind === 221 && declaration.body.kind === 221) { return; } - while (declaration.kind === 220 && declaration.parent.kind === 220) { + while (declaration.kind === 221 && declaration.parent.kind === 221) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 213 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 214 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { ts.addRange(jsDocCommentParts, cleanedJsDocComment); @@ -38366,9 +38910,9 @@ var ts; if (result_2 !== undefined) { return result_2; } - if (declaration.name.kind === 136) { + if (declaration.name.kind === 137) { var expr = declaration.name.expression; - if (expr.kind === 168) { + if (expr.kind === 169) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -38388,9 +38932,9 @@ var ts; } function visit(node) { switch (node.kind) { - case 215: + case 216: + case 144: case 143: - case 142: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -38407,62 +38951,62 @@ var ts; ts.forEachChild(node, visit); } break; - case 216: case 217: case 218: case 219: case 220: - case 223: - case 232: - case 228: - case 223: - case 225: - case 226: - case 145: - case 146: - case 155: - addDeclaration(node); - case 144: - case 195: - case 214: - case 163: - case 164: case 221: + case 224: + case 233: + case 229: + case 224: + case 226: + case 227: + case 146: + case 147: + case 156: + addDeclaration(node); + case 145: + case 196: + case 215: + case 164: + case 165: + case 222: ts.forEachChild(node, visit); break; - case 194: + case 195: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 138: + case 139: if (!(node.flags & 56)) { break; } - case 213: - case 165: + case 214: + case 166: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 249: + case 250: + case 142: case 141: - case 140: addDeclaration(node); break; - case 230: + case 231: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 224: + case 225: var importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226) { + if (importClause.namedBindings.kind === 227) { addDeclaration(importClause.namedBindings); } else { @@ -38598,6 +39142,9 @@ var ts; ClassificationTypeNames.jsxOpenTagName = "jsx open tag name"; ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; + ClassificationTypeNames.jsxAttribute = "jsx attribute"; + ClassificationTypeNames.jsxText = "jsx text"; + ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value"; return ClassificationTypeNames; }()); ts.ClassificationTypeNames = ClassificationTypeNames; @@ -38613,14 +39160,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 175) { + if (declaration.kind === 176) { return true; } - if (declaration.kind !== 213 && declaration.kind !== 215) { + if (declaration.kind !== 214 && declaration.kind !== 216) { return false; } - for (var parent_8 = declaration.parent; !ts.isFunctionBlock(parent_8); parent_8 = parent_8.parent) { - if (parent_8.kind === 250 || parent_8.kind === 221) { + for (var parent_9 = declaration.parent; !ts.isFunctionBlock(parent_9); parent_9 = parent_9.parent) { + if (parent_9.kind === 251 || parent_9.kind === 222) { return false; } } @@ -38829,16 +39376,10 @@ var ts; return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, true); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; - function createGetCanonicalFileName(useCaseSensitivefileNames) { - return useCaseSensitivefileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); - } - ts.createGetCanonicalFileName = createGetCanonicalFileName; function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) { if (currentDirectory === void 0) { currentDirectory = ""; } var buckets = {}; - var getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); + var getCanonicalFileName = ts.createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings) { return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs; } @@ -39151,7 +39692,7 @@ var ts; ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 209 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 210 && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -39160,16 +39701,16 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 69 && - (node.parent.kind === 205 || node.parent.kind === 204) && + (node.parent.kind === 206 || node.parent.kind === 205) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 69 && - node.parent.kind === 209 && + node.parent.kind === 210 && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 209; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 210; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -39180,25 +39721,25 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 135 && node.parent.right === node; + return node.parent.kind === 136 && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 168 && node.parent.name === node; + return node && node.parent && node.parent.kind === 169 && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 170 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 171 && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 171 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 172 && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 220 && node.parent.name === node; + return node.parent.kind === 221 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 69 && @@ -39206,22 +39747,22 @@ var ts; } function isNameOfPropertyAssignment(node) { return (node.kind === 69 || node.kind === 9 || node.kind === 8) && - (node.parent.kind === 247 || node.parent.kind === 248) && node.parent.name === node; + (node.parent.kind === 248 || node.parent.kind === 249) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 || node.kind === 8) { switch (node.parent.kind) { - case 141: - case 140: - case 247: - case 249: - case 143: case 142: - case 145: + case 141: + case 248: + case 250: + case 144: + case 143: case 146: - case 220: + case 147: + case 221: return node.parent.name === node; - case 169: + case 170: return node.parent.argumentExpression === node; } } @@ -39259,7 +39800,7 @@ var ts; } } var keywordCompletions = []; - for (var i = 70; i <= 134; i++) { + for (var i = 70; i <= 135; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -39274,17 +39815,17 @@ var ts; return undefined; } switch (node.kind) { - case 250: + case 251: + case 144: case 143: - case 142: - case 215: - case 175: - case 145: - case 146: case 216: + case 176: + case 146: + case 147: case 217: - case 219: + case 218: case 220: + case 221: return node; } } @@ -39292,38 +39833,38 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 220: return ScriptElementKind.moduleElement; - case 216: return ScriptElementKind.classElement; - case 217: return ScriptElementKind.interfaceElement; - case 218: return ScriptElementKind.typeElement; - case 219: return ScriptElementKind.enumElement; - case 213: + case 221: return ScriptElementKind.moduleElement; + case 217: return ScriptElementKind.classElement; + case 218: return ScriptElementKind.interfaceElement; + case 219: return ScriptElementKind.typeElement; + case 220: return ScriptElementKind.enumElement; + case 214: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 215: return ScriptElementKind.functionElement; - case 145: return ScriptElementKind.memberGetAccessorElement; - case 146: return ScriptElementKind.memberSetAccessorElement; + case 216: return ScriptElementKind.functionElement; + case 146: return ScriptElementKind.memberGetAccessorElement; + case 147: return ScriptElementKind.memberSetAccessorElement; + case 144: case 143: - case 142: return ScriptElementKind.memberFunctionElement; + case 142: case 141: - case 140: return ScriptElementKind.memberVariableElement; - case 149: return ScriptElementKind.indexSignatureElement; - case 148: return ScriptElementKind.constructSignatureElement; - case 147: return ScriptElementKind.callSignatureElement; - case 144: return ScriptElementKind.constructorImplementationElement; - case 137: return ScriptElementKind.typeParameterElement; - case 249: return ScriptElementKind.variableElement; - case 138: return (node.flags & 56) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 223: - case 228: - case 225: - case 232: + case 150: return ScriptElementKind.indexSignatureElement; + case 149: return ScriptElementKind.constructSignatureElement; + case 148: return ScriptElementKind.callSignatureElement; + case 145: return ScriptElementKind.constructorImplementationElement; + case 138: return ScriptElementKind.typeParameterElement; + case 250: return ScriptElementKind.variableElement; + case 139: return (node.flags & 56) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 224: + case 229: case 226: + case 233: + case 227: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -39360,7 +39901,7 @@ var ts; host.log(message); } } - var getCanonicalFileName = createGetCanonicalFileName(useCaseSensitivefileNames); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitivefileNames); function getValidSourceFile(fileName) { var sourceFile = program.getSourceFile(fileName); if (!sourceFile) { @@ -39552,9 +40093,9 @@ var ts; isJsDocTagName = true; } switch (tag.kind) { - case 271: - case 269: + case 272: case 270: + case 271: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -39589,13 +40130,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_9 = contextToken.parent, kind = contextToken.kind; + var parent_10 = contextToken.parent, kind = contextToken.kind; if (kind === 21) { - if (parent_9.kind === 168) { + if (parent_10.kind === 169) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_9.kind === 135) { + else if (parent_10.kind === 136) { node = contextToken.parent.left; isRightOfDot = true; } @@ -39608,8 +40149,9 @@ var ts; isRightOfOpenTag = true; location = contextToken; } - else if (kind === 39 && contextToken.parent.kind === 239) { + else if (kind === 39 && contextToken.parent.kind === 240) { isStartingCloseTag = true; + location = contextToken; } } } @@ -39633,7 +40175,10 @@ var ts; } else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; - symbols = [typeChecker.getSymbolAtLocation(tagName)]; + var tagSymbol = typeChecker.getSymbolAtLocation(tagName); + if (!typeChecker.isUnknownSymbol(tagSymbol)) { + symbols = [tagSymbol]; + } isMemberCompletion = true; isNewIdentifierLocation = false; } @@ -39647,7 +40192,7 @@ var ts; function getTypeScriptMemberSymbols() { isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 69 || node.kind === 135 || node.kind === 168) { + if (node.kind === 69 || node.kind === 136 || node.kind === 169) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { symbol = typeChecker.getAliasedSymbol(symbol); @@ -39693,7 +40238,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType; - if ((jsxContainer.kind === 236) || (jsxContainer.kind === 237)) { + if ((jsxContainer.kind === 237) || (jsxContainer.kind === 238)) { attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); if (attrsType) { symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes); @@ -39733,15 +40278,15 @@ var ts; return result; } function isInJsxText(contextToken) { - if (contextToken.kind === 238) { + if (contextToken.kind === 239) { return true; } if (contextToken.kind === 27 && contextToken.parent) { - if (contextToken.parent.kind === 237) { + if (contextToken.parent.kind === 238) { return true; } - if (contextToken.parent.kind === 239 || contextToken.parent.kind === 236) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 235; + if (contextToken.parent.kind === 240 || contextToken.parent.kind === 237) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 236; } } return false; @@ -39751,40 +40296,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 24: - return containingNodeKind === 170 - || containingNodeKind === 144 - || containingNodeKind === 171 - || containingNodeKind === 166 - || containingNodeKind === 183 - || containingNodeKind === 152; + return containingNodeKind === 171 + || containingNodeKind === 145 + || containingNodeKind === 172 + || containingNodeKind === 167 + || containingNodeKind === 184 + || containingNodeKind === 153; case 17: - return containingNodeKind === 170 - || containingNodeKind === 144 - || containingNodeKind === 171 - || containingNodeKind === 174 - || containingNodeKind === 160; + return containingNodeKind === 171 + || containingNodeKind === 145 + || containingNodeKind === 172 + || containingNodeKind === 175 + || containingNodeKind === 161; case 19: - return containingNodeKind === 166 - || containingNodeKind === 149 - || containingNodeKind === 136; + return containingNodeKind === 167 + || containingNodeKind === 150 + || containingNodeKind === 137; case 125: case 126: return true; case 21: - return containingNodeKind === 220; + return containingNodeKind === 221; case 15: - return containingNodeKind === 216; + return containingNodeKind === 217; case 56: - return containingNodeKind === 213 - || containingNodeKind === 183; + return containingNodeKind === 214 + || containingNodeKind === 184; case 12: - return containingNodeKind === 185; + return containingNodeKind === 186; case 13: - return containingNodeKind === 192; + return containingNodeKind === 193; case 112: case 110: case 111: - return containingNodeKind === 141; + return containingNodeKind === 142; } switch (previousToken.getText()) { case "public": @@ -39797,7 +40342,7 @@ var ts; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) { if (contextToken.kind === 9 - || contextToken.kind === 162 + || contextToken.kind === 163 || contextToken.kind === 10 || ts.isTemplateLiteralKind(contextToken.kind)) { var start_7 = contextToken.getStart(); @@ -39816,12 +40361,12 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 167) { + if (objectLikeContainer.kind === 168) { isNewIdentifierLocation = true; typeForObject = typeChecker.getContextualType(objectLikeContainer); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 163) { + else if (objectLikeContainer.kind === 164) { isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); if (ts.isVariableLike(rootDeclaration)) { @@ -39847,9 +40392,9 @@ var ts; return true; } function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 227 ? - 224 : - 230; + var declarationKind = namedImportsOrExports.kind === 228 ? + 225 : + 231; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -39870,9 +40415,9 @@ var ts; switch (contextToken.kind) { case 15: case 24: - var parent_10 = contextToken.parent; - if (parent_10 && (parent_10.kind === 167 || parent_10.kind === 163)) { - return parent_10; + var parent_11 = contextToken.parent; + if (parent_11 && (parent_11.kind === 168 || parent_11.kind === 164)) { + return parent_11; } break; } @@ -39885,8 +40430,8 @@ var ts; case 15: case 24: switch (contextToken.parent.kind) { - case 227: - case 231: + case 228: + case 232: return contextToken.parent; } } @@ -39895,34 +40440,34 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_11 = contextToken.parent; + var parent_12 = contextToken.parent; switch (contextToken.kind) { case 26: case 39: case 69: - case 240: case 241: - if (parent_11 && (parent_11.kind === 236 || parent_11.kind === 237)) { - return parent_11; + case 242: + if (parent_12 && (parent_12.kind === 237 || parent_12.kind === 238)) { + return parent_12; } - else if (parent_11.kind === 240) { - return parent_11.parent; + else if (parent_12.kind === 241) { + return parent_12.parent; } break; case 9: - if (parent_11 && ((parent_11.kind === 240) || (parent_11.kind === 241))) { - return parent_11.parent; + if (parent_12 && ((parent_12.kind === 241) || (parent_12.kind === 242))) { + return parent_12.parent; } break; case 16: - if (parent_11 && - parent_11.kind === 242 && - parent_11.parent && - (parent_11.parent.kind === 240)) { - return parent_11.parent.parent; + if (parent_12 && + parent_12.kind === 243 && + parent_12.parent && + (parent_12.parent.kind === 241)) { + return parent_12.parent.parent; } - if (parent_11 && parent_11.kind === 241) { - return parent_11.parent; + if (parent_12 && parent_12.kind === 242) { + return parent_12.parent; } break; } @@ -39931,16 +40476,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 175: case 176: - case 215: + case 177: + case 216: + case 144: case 143: - case 142: - case 145: case 146: case 147: case 148: case 149: + case 150: return true; } return false; @@ -39949,54 +40494,54 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 24: - return containingNodeKind === 213 || - containingNodeKind === 214 || - containingNodeKind === 195 || - containingNodeKind === 219 || + return containingNodeKind === 214 || + containingNodeKind === 215 || + containingNodeKind === 196 || + containingNodeKind === 220 || isFunction(containingNodeKind) || - containingNodeKind === 216 || - containingNodeKind === 188 || containingNodeKind === 217 || - containingNodeKind === 164 || - containingNodeKind === 218; + containingNodeKind === 189 || + containingNodeKind === 218 || + containingNodeKind === 165 || + containingNodeKind === 219; case 21: - return containingNodeKind === 164; - case 54: return containingNodeKind === 165; + case 54: + return containingNodeKind === 166; case 19: - return containingNodeKind === 164; + return containingNodeKind === 165; case 17: - return containingNodeKind === 246 || + return containingNodeKind === 247 || isFunction(containingNodeKind); case 15: - return containingNodeKind === 219 || - containingNodeKind === 217 || - containingNodeKind === 155; - case 23: - return containingNodeKind === 140 && - contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 217 || - contextToken.parent.parent.kind === 155); - case 25: - return containingNodeKind === 216 || - containingNodeKind === 188 || - containingNodeKind === 217 || + return containingNodeKind === 220 || containingNodeKind === 218 || + containingNodeKind === 156; + case 23: + return containingNodeKind === 141 && + contextToken.parent && contextToken.parent.parent && + (contextToken.parent.parent.kind === 218 || + contextToken.parent.parent.kind === 156); + case 25: + return containingNodeKind === 217 || + containingNodeKind === 189 || + containingNodeKind === 218 || + containingNodeKind === 219 || isFunction(containingNodeKind); case 113: - return containingNodeKind === 141; + return containingNodeKind === 142; case 22: - return containingNodeKind === 138 || + return containingNodeKind === 139 || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 164); + contextToken.parent.parent.kind === 165); case 112: case 110: case 111: - return containingNodeKind === 138; + return containingNodeKind === 139; case 116: - return containingNodeKind === 228 || - containingNodeKind === 232 || - containingNodeKind === 226; + return containingNodeKind === 229 || + containingNodeKind === 233 || + containingNodeKind === 227; case 73: case 81: case 107: @@ -40045,8 +40590,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_31 = element.propertyName || element.name; - exisingImportsOrExports[name_31.text] = true; + var name_34 = element.propertyName || element.name; + exisingImportsOrExports[name_34.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -40060,17 +40605,17 @@ var ts; var existingMemberNames = {}; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; - if (m.kind !== 247 && - m.kind !== 248 && - m.kind !== 165 && - m.kind !== 143) { + if (m.kind !== 248 && + m.kind !== 249 && + m.kind !== 166 && + m.kind !== 144) { continue; } if (m.getStart() <= position && position <= m.getEnd()) { continue; } var existingName = void 0; - if (m.kind === 165 && m.propertyName) { + if (m.kind === 166 && m.propertyName) { if (m.propertyName.kind === 69) { existingName = m.propertyName.text; } @@ -40089,7 +40634,7 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 240) { + if (attr.kind === 241) { seenNames[attr.name.text] = true; } } @@ -40114,7 +40659,19 @@ var ts; } else { if (!symbols || symbols.length === 0) { - return undefined; + if (sourceFile.languageVariant === 1 && + location.parent && location.parent.kind === 240) { + var tagName = location.parent.parent.openingElement.tagName; + entries.push({ + name: tagName.text, + kind: undefined, + kindModifiers: undefined, + sortText: "0" + }); + } + else { + return undefined; + } } getCompletionEntriesFromSymbols(symbols, entries); } @@ -40126,10 +40683,10 @@ var ts; var entries = []; var target = program.getCompilerOptions().target; var nameTable = getNameTable(sourceFile); - for (var name_32 in nameTable) { - if (!uniqueNames[name_32]) { - uniqueNames[name_32] = name_32; - var displayName = getCompletionEntryDisplayName(name_32, target, true); + for (var name_35 in nameTable) { + if (!uniqueNames[name_35]) { + uniqueNames[name_35] = name_35; + var displayName = getCompletionEntryDisplayName(name_35, target, true); if (displayName) { var entry = { name: displayName, @@ -40218,7 +40775,7 @@ var ts; function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); if (flags & 32) - return ts.getDeclarationOfKind(symbol, 188) ? + return ts.getDeclarationOfKind(symbol, 189) ? ScriptElementKind.localClassElement : ScriptElementKind.classElement; if (flags & 384) return ScriptElementKind.enumElement; @@ -40314,14 +40871,14 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 168) { + if (location.parent && location.parent.kind === 169) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } var callExpression; - if (location.kind === 170 || location.kind === 171) { + if (location.kind === 171 || location.kind === 172) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -40333,7 +40890,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 171 || callExpression.expression.kind === 95; + var useConstructSignatures = callExpression.kind === 172 || callExpression.expression.kind === 95; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -40381,21 +40938,21 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 121 && location.parent.kind === 144)) { + (location.kind === 121 && location.parent.kind === 145)) { var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 144 ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 145 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 144) { + if (functionDeclaration.kind === 145) { symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 147 && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 148 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -40404,7 +40961,7 @@ var ts; } } if (symbolFlags & 32 && !hasAddedSymbolInfo) { - if (ts.getDeclarationOfKind(symbol, 188)) { + if (ts.getDeclarationOfKind(symbol, 189)) { pushTypePart(ScriptElementKind.localClassElement); } else { @@ -40444,7 +41001,7 @@ var ts; } if (symbolFlags & 1536) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 220); + var declaration = ts.getDeclarationOfKind(symbol, 221); var isNamespace = declaration && declaration.name && declaration.name.kind === 69; displayParts.push(ts.keywordPart(isNamespace ? 126 : 125)); displayParts.push(ts.spacePart()); @@ -40465,17 +41022,17 @@ var ts; writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var declaration = ts.getDeclarationOfKind(symbol, 137); + var declaration = ts.getDeclarationOfKind(symbol, 138); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 148) { + if (declaration.kind === 149) { displayParts.push(ts.keywordPart(92)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 147 && declaration.name) { + else if (declaration.kind !== 148 && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32)); @@ -40492,7 +41049,7 @@ var ts; if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 249) { + if (declaration.kind === 250) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -40508,7 +41065,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 223) { + if (declaration.kind === 224) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -40635,13 +41192,13 @@ var ts; } var typeChecker = program.getTypeChecker(); var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { + if (!symbol || typeChecker.isUnknownSymbol(symbol)) { switch (node.kind) { case 69: - case 168: - case 135: + case 169: + case 136: case 97: - case 161: + case 162: case 95: var type = typeChecker.getTypeAtLocation(node); if (type) { @@ -40714,8 +41271,8 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 144) || - (!selectConstructors && (d.kind === 215 || d.kind === 143 || d.kind === 142))) { + if ((selectConstructors && d.kind === 145) || + (!selectConstructors && (d.kind === 216 || d.kind === 144 || d.kind === 143))) { declarations.push(d); if (d.body) definition = d; @@ -40770,7 +41327,7 @@ var ts; symbol = typeChecker.getAliasedSymbol(symbol); } } - if (node.parent.kind === 248) { + if (node.parent.kind === 249) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -40843,7 +41400,7 @@ var ts; function getSemanticDocumentHighlights(node) { if (node.kind === 69 || node.kind === 97 || - node.kind === 161 || + node.kind === 162 || node.kind === 95 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { @@ -40895,75 +41452,75 @@ var ts; switch (node.kind) { case 88: case 80: - if (hasKind(node.parent, 198)) { + if (hasKind(node.parent, 199)) { return getIfElseOccurrences(node.parent); } break; case 94: - if (hasKind(node.parent, 206)) { + if (hasKind(node.parent, 207)) { return getReturnOccurrences(node.parent); } break; case 98: - if (hasKind(node.parent, 210)) { + if (hasKind(node.parent, 211)) { return getThrowOccurrences(node.parent); } break; case 72: - if (hasKind(parent(parent(node)), 211)) { + if (hasKind(parent(parent(node)), 212)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 100: case 85: - if (hasKind(parent(node), 211)) { + if (hasKind(parent(node), 212)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 96: - if (hasKind(node.parent, 208)) { + if (hasKind(node.parent, 209)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 71: case 77: - if (hasKind(parent(parent(parent(node))), 208)) { + if (hasKind(parent(parent(parent(node))), 209)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 70: case 75: - if (hasKind(node.parent, 205) || hasKind(node.parent, 204)) { + if (hasKind(node.parent, 206) || hasKind(node.parent, 205)) { return getBreakOrContinueStatementOccurrences(node.parent); } break; case 86: - if (hasKind(node.parent, 201) || - hasKind(node.parent, 202) || - hasKind(node.parent, 203)) { + if (hasKind(node.parent, 202) || + hasKind(node.parent, 203) || + hasKind(node.parent, 204)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 104: case 79: - if (hasKind(node.parent, 200) || hasKind(node.parent, 199)) { + if (hasKind(node.parent, 201) || hasKind(node.parent, 200)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 121: - if (hasKind(node.parent, 144)) { + if (hasKind(node.parent, 145)) { return getConstructorOccurrences(node.parent); } break; case 123: case 129: - if (hasKind(node.parent, 145) || hasKind(node.parent, 146)) { + if (hasKind(node.parent, 146) || hasKind(node.parent, 147)) { return getGetAndSetOccurrences(node.parent); } break; default: if (ts.isModifierKind(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 195)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 196)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -40975,10 +41532,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 210) { + if (node.kind === 211) { statementAccumulator.push(node); } - else if (node.kind === 211) { + else if (node.kind === 212) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -40998,17 +41555,17 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_12 = child.parent; - if (ts.isFunctionBlock(parent_12) || parent_12.kind === 250) { - return parent_12; + var parent_13 = child.parent; + if (ts.isFunctionBlock(parent_13) || parent_13.kind === 251) { + return parent_13; } - if (parent_12.kind === 211) { - var tryStatement = parent_12; + if (parent_13.kind === 212) { + var tryStatement = parent_13; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_12; + child = parent_13; } return undefined; } @@ -41017,7 +41574,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 205 || node.kind === 204) { + if (node.kind === 206 || node.kind === 205) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -41032,15 +41589,15 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) { switch (node_2.kind) { - case 208: - if (statement.kind === 204) { + case 209: + if (statement.kind === 205) { continue; } - case 201: case 202: case 203: + case 204: + case 201: case 200: - case 199: if (!statement.label || isLabeledBy(node_2, statement.label.text)) { return node_2; } @@ -41057,24 +41614,24 @@ var ts; function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 216 || - container.kind === 188 || - (declaration.kind === 138 && hasKind(container, 144)))) { + if (!(container.kind === 217 || + container.kind === 189 || + (declaration.kind === 139 && hasKind(container, 145)))) { return undefined; } } else if (modifier === 113) { - if (!(container.kind === 216 || container.kind === 188)) { + if (!(container.kind === 217 || container.kind === 189)) { return undefined; } } else if (modifier === 82 || modifier === 122) { - if (!(container.kind === 221 || container.kind === 250)) { + if (!(container.kind === 222 || container.kind === 251)) { return undefined; } } else if (modifier === 115) { - if (!(container.kind === 216 || declaration.kind === 216)) { + if (!(container.kind === 217 || declaration.kind === 217)) { return undefined; } } @@ -41085,8 +41642,8 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 221: - case 250: + case 222: + case 251: if (modifierFlag & 128) { nodes = declaration.members.concat(declaration); } @@ -41094,15 +41651,15 @@ var ts; nodes = container.statements; } break; - case 144: + case 145: nodes = container.parameters.concat(container.parent.members); break; - case 216: - case 188: + case 217: + case 189: nodes = container.members; if (modifierFlag & 56) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 144 && member; + return member.kind === 145 && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -41155,8 +41712,8 @@ var ts; } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 145); tryPushAccessorKeyword(accessorDeclaration.symbol, 146); + tryPushAccessorKeyword(accessorDeclaration.symbol, 147); return ts.map(keywords, getHighlightSpanForNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); @@ -41178,7 +41735,7 @@ var ts; function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86, 104, 79)) { - if (loopNode.kind === 199) { + if (loopNode.kind === 200) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 104)) { @@ -41199,13 +41756,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 201: case 202: case 203: - case 199: + case 204: case 200: + case 201: return getLoopBreakContinueOccurrences(owner); - case 208: + case 209: return getSwitchCaseDefaultOccurrences(owner); } } @@ -41255,7 +41812,7 @@ var ts; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 194))) { + if (!(func && hasKind(func.body, 195))) { return undefined; } var keywords = []; @@ -41269,7 +41826,7 @@ var ts; } function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 198) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 199) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { @@ -41280,7 +41837,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 198)) { + if (!hasKind(ifStatement.elseStatement, 199)) { break; } ifStatement = ifStatement.elseStatement; @@ -41384,7 +41941,7 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 97 || node.kind === 161) { + if (node.kind === 97 || node.kind === 162) { return getReferencesForThisKeyword(node, sourceFiles); } if (node.kind === 95) { @@ -41436,10 +41993,8 @@ var ts; textSpan: ts.createTextSpan(declarations[0].getStart(), 0) }; } - function isImportOrExportSpecifierImportSymbol(symbol) { - return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 228 || declaration.kind === 232; - }); + function isImportSpecifierSymbol(symbol) { + return (symbol.flags & 8388608) && !!ts.getDeclarationOfKind(symbol, 229); } function getInternedName(symbol, location, declarations) { if (ts.isImportOrExportSpecifierName(location)) { @@ -41451,13 +42006,13 @@ var ts; } function getSymbolScope(symbol) { var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 175 || valueDeclaration.kind === 188)) { + if (valueDeclaration && (valueDeclaration.kind === 176 || valueDeclaration.kind === 189)) { return valueDeclaration; } if (symbol.flags & (4 | 8192)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 16) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 216); + return ts.getAncestor(privateDeclaration, 217); } } if (symbol.flags & 8388608) { @@ -41478,7 +42033,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 250 && !ts.isExternalModule(container)) { + if (container.kind === 251 && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -41625,13 +42180,13 @@ var ts; } var staticFlag = 64; switch (searchSpaceNode.kind) { - case 141: - case 140: - case 143: case 142: + case 141: case 144: + case 143: case 145: case 146: + case 147: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; @@ -41659,32 +42214,32 @@ var ts; var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 64; switch (searchSpaceNode.kind) { + case 144: case 143: - case 142: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } + case 142: case 141: - case 140: - case 144: case 145: case 146: + case 147: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 250: + case 251: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 215: - case 175: + case 216: + case 176: break; default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 250) { + if (searchSpaceNode.kind === 251) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -41710,31 +42265,31 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || (node.kind !== 97 && node.kind !== 161)) { + if (!node || (node.kind !== 97 && node.kind !== 162)) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 175: - case 215: + case 176: + case 216: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; + case 144: case 143: - case 142: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 188: - case 216: + case 189: + case 217: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 64) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 250: - if (container.kind === 250 && !ts.isExternalModule(container)) { + case 251: + if (container.kind === 251 && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -41744,9 +42299,12 @@ var ts; } function populateSearchSymbolSet(symbol, location) { var result = [symbol]; - if (isImportOrExportSpecifierImportSymbol(symbol)) { + if (isImportSpecifierSymbol(symbol)) { result.push(typeChecker.getAliasedSymbol(symbol)); } + if (location.parent.kind === 233) { + result.push(typeChecker.getExportSpecifierLocalTargetSymbol(location.parent)); + } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { ts.addRange(result, typeChecker.getRootSymbols(contextualSymbol)); @@ -41756,7 +42314,7 @@ var ts; result.push(shorthandValueSymbol); } } - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 138 && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 139 && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } @@ -41765,19 +42323,25 @@ var ts; result.push(rootSymbol); } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, {}); } }); return result; } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (32 | 64)) { + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + if (!symbol) { + return; + } + if (ts.hasProperty(previousIterationSymbolsCache, symbol.name)) { + return; + } + if (symbol.flags & (32 | 64)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 216) { + if (declaration.kind === 217) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 217) { + else if (declaration.kind === 218) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -41791,7 +42355,8 @@ var ts; if (propertySymbol) { result.push(propertySymbol); } - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); + previousIterationSymbolsCache[symbol.name] = symbol; + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); } } } @@ -41800,12 +42365,18 @@ var ts; if (searchSymbols.indexOf(referenceSymbol) >= 0) { return referenceSymbol; } - if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { + if (isImportSpecifierSymbol(referenceSymbol)) { var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); if (searchSymbols.indexOf(aliasedSymbol) >= 0) { return aliasedSymbol; } } + if (referenceLocation.parent.kind === 233) { + var aliasedSymbol = typeChecker.getExportSpecifierLocalTargetSymbol(referenceLocation.parent); + if (searchSymbols.indexOf(aliasedSymbol) >= 0) { + return aliasedSymbol; + } + } if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); @@ -41817,7 +42388,7 @@ var ts; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { var result_3 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3, {}); return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } return undefined; @@ -41827,17 +42398,17 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_33 = node.text; + var name_36 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name_33); + var unionProperty = contextualType.getProperty(name_36); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_33); + var symbol = t.getProperty(name_36); if (symbol) { result_4.push(symbol); } @@ -41846,7 +42417,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_33); + var symbol_1 = contextualType.getProperty(name_36); if (symbol_1) { return [symbol_1]; } @@ -41891,10 +42462,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 182 || parent.kind === 181) { + if (parent.kind === 183 || parent.kind === 182) { return true; } - else if (parent.kind === 183 && parent.left === node) { + else if (parent.kind === 184 && parent.left === node) { var operator = parent.operatorToken.kind; return 56 <= operator && operator <= 68; } @@ -41924,34 +42495,34 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 138: - case 213: - case 165: + case 139: + case 214: + case 166: + case 142: case 141: - case 140: - case 247: case 248: case 249: - case 143: - case 142: + case 250: case 144: + case 143: case 145: case 146: - case 215: - case 175: - case 176: - case 246: - return 1; - case 137: - case 217: - case 218: - case 155: - return 2; + case 147: case 216: + case 176: + case 177: + case 247: + return 1; + case 138: + case 218: case 219: - return 1 | 2; + case 156: + return 2; + case 217: case 220: - if (node.name.kind === 9) { + return 1 | 2; + case 221: + if (ts.isAmbientModule(node)) { return 4 | 1; } else if (ts.getModuleInstanceState(node) === 1) { @@ -41960,14 +42531,14 @@ var ts; else { return 4; } - case 227: case 228: - case 223: - case 224: case 229: + case 224: + case 225: case 230: + case 231: return 1 | 2 | 4; - case 250: + case 251: return 4 | 1; } return 1 | 2 | 4; @@ -41976,10 +42547,10 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 151 || - (node.parent.kind === 190 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + return node.parent.kind === 152 || + (node.parent.kind === 191 && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || (node.kind === 97 && !ts.isExpression(node)) || - node.kind === 161; + node.kind === 162; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -41987,47 +42558,47 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 168) { - while (root.parent && root.parent.kind === 168) { + if (root.parent.kind === 169) { + while (root.parent && root.parent.kind === 169) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 190 && root.parent.parent.kind === 245) { + if (!isLastClause && root.parent.kind === 191 && root.parent.parent.kind === 246) { var decl = root.parent.parent.parent; - return (decl.kind === 216 && root.parent.parent.token === 106) || - (decl.kind === 217 && root.parent.parent.token === 83); + return (decl.kind === 217 && root.parent.parent.token === 106) || + (decl.kind === 218 && root.parent.parent.token === 83); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 135) { - while (root.parent && root.parent.kind === 135) { + if (root.parent.kind === 136) { + while (root.parent && root.parent.kind === 136) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 151 && !isLastClause; + return root.parent.kind === 152 && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 135) { + while (node.parent.kind === 136) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 69); - if (node.parent.kind === 135 && + if (node.parent.kind === 136 && node.parent.right === node && - node.parent.parent.kind === 223) { + node.parent.parent.kind === 224) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 229) { + if (node.parent.kind === 230) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -42061,16 +42632,16 @@ var ts; return; } switch (node.kind) { - case 168: - case 135: + case 169: + case 136: case 9: - case 162: + case 163: case 84: case 99: case 93: case 95: case 97: - case 161: + case 162: case 69: break; default: @@ -42082,7 +42653,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 220 && + if (nodeForStartPos.parent.parent.kind === 221 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -42109,10 +42680,10 @@ var ts; } function checkForClassificationCancellation(kind) { switch (kind) { - case 220: - case 216: + case 221: case 217: - case 215: + case 218: + case 216: cancellationToken.throwIfCancellationRequested(); } } @@ -42160,7 +42731,7 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 220 && + return declaration.kind === 221 && ts.getModuleInstanceState(declaration) === 1; }); } @@ -42207,6 +42778,9 @@ var ts; case 19: return ClassificationTypeNames.jsxOpenTagName; case 20: return ClassificationTypeNames.jsxCloseTagName; case 21: return ClassificationTypeNames.jsxSelfClosingTagName; + case 22: return ClassificationTypeNames.jsxAttribute; + case 23: return ClassificationTypeNames.jsxText; + case 24: return ClassificationTypeNames.jsxAttributeStringLiteralValue; } } function convertClassifications(classifications) { @@ -42296,16 +42870,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18); pos = tag.tagName.end; switch (tag.kind) { - case 269: + case 270: processJSDocParameterTag(tag); break; - case 272: + case 273: processJSDocTemplateTag(tag); break; - case 271: + case 272: processElement(tag.typeExpression); break; - case 270: + case 271: processElement(tag.typeExpression); break; } @@ -42340,7 +42914,8 @@ var ts; } } function classifyDisabledMergeCode(text, start, end) { - for (var i = start; i < end; i++) { + var i; + for (i = start; i < end; i++) { if (ts.isLineBreak(text.charCodeAt(i))) { break; } @@ -42360,11 +42935,11 @@ var ts; pushClassification(start, end - start, type); } } - function classifyToken(token) { + function classifyTokenOrJsxText(token) { if (ts.nodeIsMissing(token)) { return; } - var tokenStart = classifyLeadingTriviaAndGetTokenStart(token); + var tokenStart = token.kind === 239 ? token.pos : classifyLeadingTriviaAndGetTokenStart(token); var tokenWidth = token.end - tokenStart; ts.Debug.assert(tokenWidth >= 0); if (tokenWidth > 0) { @@ -42386,16 +42961,17 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 56) { - if (token.parent.kind === 213 || - token.parent.kind === 141 || - token.parent.kind === 138) { + if (token.parent.kind === 214 || + token.parent.kind === 142 || + token.parent.kind === 139 || + token.parent.kind === 241) { return 5; } } - if (token.parent.kind === 183 || - token.parent.kind === 181 || + if (token.parent.kind === 184 || token.parent.kind === 182 || - token.parent.kind === 184) { + token.parent.kind === 183 || + token.parent.kind === 185) { return 5; } } @@ -42404,8 +42980,8 @@ var ts; else if (tokenKind === 8) { return 4; } - else if (tokenKind === 9 || tokenKind === 162) { - return 6; + else if (tokenKind === 9 || tokenKind === 163) { + return token.parent.kind === 241 ? 24 : 6; } else if (tokenKind === 10) { return 6; @@ -42413,54 +42989,61 @@ var ts; else if (ts.isTemplateLiteralKind(tokenKind)) { return 6; } + else if (tokenKind === 239) { + return 23; + } else if (tokenKind === 69) { if (token) { switch (token.parent.kind) { - case 216: + case 217: if (token.parent.name === token) { return 11; } return; - case 137: + case 138: if (token.parent.name === token) { return 15; } return; - case 217: + case 218: if (token.parent.name === token) { return 13; } return; - case 219: + case 220: if (token.parent.name === token) { return 12; } return; - case 220: + case 221: if (token.parent.name === token) { return 14; } return; - case 138: + case 139: if (token.parent.name === token) { return 17; } return; - case 237: + case 238: if (token.parent.tagName === token) { return 19; } return; - case 239: + case 240: if (token.parent.tagName === token) { return 20; } return; - case 236: + case 237: if (token.parent.tagName === token) { return 21; } return; + case 241: + if (token.parent.name === token) { + return 22; + } } } return 2; @@ -42475,8 +43058,8 @@ var ts; var children = element.getChildren(sourceFile); for (var i = 0, n = children.length; i < n; i++) { var child = children[i]; - if (ts.isToken(child)) { - classifyToken(child); + if (ts.isToken(child) || child.kind === 239) { + classifyTokenOrJsxText(child); } else { processElement(child); @@ -42572,16 +43155,16 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 215: - case 143: - case 144: case 216: - case 195: + case 144: + case 145: + case 217: + case 196: break findOwner; - case 250: + case 251: return undefined; - case 220: - if (commentOwner.parent.kind === 220) { + case 221: + if (commentOwner.parent.kind === 221) { return undefined; } break findOwner; @@ -42615,7 +43198,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 195) { + if (commentOwner.kind === 196) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -42625,17 +43208,17 @@ var ts; return emptyArray; } function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 174) { + while (rightHandSide.kind === 175) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 175: case 176: + case 177: return rightHandSide.parameters; - case 188: + case 189: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 144) { + if (member.kind === 145) { return member.parameters; } } @@ -42815,7 +43398,7 @@ var ts; case 9: case 8: if (ts.isDeclarationName(node) || - node.parent.kind === 234 || + node.parent.kind === 235 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -42828,7 +43411,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 169 && + node.parent.kind === 170 && node.parent.argumentExpression === node; } function createClassifier() { @@ -43010,7 +43593,7 @@ var ts; var end = scanner.getTextPos(); addResult(start, end, classFromKind(token)); if (end >= text.length) { - if (token === 9 || token === 162) { + if (token === 9 || token === 163) { var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; @@ -43124,7 +43707,7 @@ var ts; } } function isKeyword(token) { - return token >= 70 && token <= 134; + return token >= 70 && token <= 135; } function classFromKind(token) { if (isKeyword(token)) { @@ -43140,7 +43723,7 @@ var ts; case 8: return 4; case 9: - case 162: + case 163: return 6; case 10: return 7; @@ -44241,8 +44824,8 @@ var ts; var newResolutions = {}; var resolvedModules = []; var compilerOptions = this.getCompilationSettings(); - for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { - var moduleName = moduleNames_1[_i]; + for (var _i = 0, moduleNames_2 = moduleNames; _i < moduleNames_2.length; _i++) { + var moduleName = moduleNames_2[_i]; var resolution = ts.lookUp(newResolutions, moduleName); if (!resolution) { var existingResolution = currentResolutionsInFile && ts.lookUp(currentResolutionsInFile, moduleName); @@ -44913,7 +45496,7 @@ var ts; info.setFormatOptions(this.getFormatCodeOptions()); this.filenameToScriptInfo[fileName] = info; if (!info.isOpen) { - info.fileWatcher = this.host.watchFile(fileName, function (_) { _this.watchedFileChanged(fileName); }); + info.fileWatcher = this.host.watchFile(ts.toPath(fileName, fileName, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), function (_) { _this.watchedFileChanged(fileName); }); } } } @@ -45095,7 +45678,7 @@ var ts; } } project.finishGraph(); - project.projectFileWatcher = this.host.watchFile(configFilename, function (_) { return _this.watchedProjectConfigFileChanged(project); }); + project.projectFileWatcher = this.host.watchFile(ts.toPath(configFilename, configFilename, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), function (_) { return _this.watchedProjectConfigFileChanged(project); }); this.log("Add recursive watcher for: " + ts.getDirectoryPath(configFilename)); project.directoryWatcher = this.host.watchDirectory(ts.getDirectoryPath(configFilename), function (path) { return _this.directoryWatchedForSourceFilesChanged(project, path); }, true); return { success: true, project: project }; diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 3196ae2199f..412f4e793b0 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -167,161 +167,162 @@ declare namespace ts { SymbolKeyword = 131, TypeKeyword = 132, FromKeyword = 133, - OfKeyword = 134, - QualifiedName = 135, - ComputedPropertyName = 136, - TypeParameter = 137, - Parameter = 138, - Decorator = 139, - PropertySignature = 140, - PropertyDeclaration = 141, - MethodSignature = 142, - MethodDeclaration = 143, - Constructor = 144, - GetAccessor = 145, - SetAccessor = 146, - CallSignature = 147, - ConstructSignature = 148, - IndexSignature = 149, - TypePredicate = 150, - TypeReference = 151, - FunctionType = 152, - ConstructorType = 153, - TypeQuery = 154, - TypeLiteral = 155, - ArrayType = 156, - TupleType = 157, - UnionType = 158, - IntersectionType = 159, - ParenthesizedType = 160, - ThisType = 161, - StringLiteralType = 162, - ObjectBindingPattern = 163, - ArrayBindingPattern = 164, - BindingElement = 165, - ArrayLiteralExpression = 166, - ObjectLiteralExpression = 167, - PropertyAccessExpression = 168, - ElementAccessExpression = 169, - CallExpression = 170, - NewExpression = 171, - TaggedTemplateExpression = 172, - TypeAssertionExpression = 173, - ParenthesizedExpression = 174, - FunctionExpression = 175, - ArrowFunction = 176, - DeleteExpression = 177, - TypeOfExpression = 178, - VoidExpression = 179, - AwaitExpression = 180, - PrefixUnaryExpression = 181, - PostfixUnaryExpression = 182, - BinaryExpression = 183, - ConditionalExpression = 184, - TemplateExpression = 185, - YieldExpression = 186, - SpreadElementExpression = 187, - ClassExpression = 188, - OmittedExpression = 189, - ExpressionWithTypeArguments = 190, - AsExpression = 191, - TemplateSpan = 192, - SemicolonClassElement = 193, - Block = 194, - VariableStatement = 195, - EmptyStatement = 196, - ExpressionStatement = 197, - IfStatement = 198, - DoStatement = 199, - WhileStatement = 200, - ForStatement = 201, - ForInStatement = 202, - ForOfStatement = 203, - ContinueStatement = 204, - BreakStatement = 205, - ReturnStatement = 206, - WithStatement = 207, - SwitchStatement = 208, - LabeledStatement = 209, - ThrowStatement = 210, - TryStatement = 211, - DebuggerStatement = 212, - VariableDeclaration = 213, - VariableDeclarationList = 214, - FunctionDeclaration = 215, - ClassDeclaration = 216, - InterfaceDeclaration = 217, - TypeAliasDeclaration = 218, - EnumDeclaration = 219, - ModuleDeclaration = 220, - ModuleBlock = 221, - CaseBlock = 222, - ImportEqualsDeclaration = 223, - ImportDeclaration = 224, - ImportClause = 225, - NamespaceImport = 226, - NamedImports = 227, - ImportSpecifier = 228, - ExportAssignment = 229, - ExportDeclaration = 230, - NamedExports = 231, - ExportSpecifier = 232, - MissingDeclaration = 233, - ExternalModuleReference = 234, - JsxElement = 235, - JsxSelfClosingElement = 236, - JsxOpeningElement = 237, - JsxText = 238, - JsxClosingElement = 239, - JsxAttribute = 240, - JsxSpreadAttribute = 241, - JsxExpression = 242, - CaseClause = 243, - DefaultClause = 244, - HeritageClause = 245, - CatchClause = 246, - PropertyAssignment = 247, - ShorthandPropertyAssignment = 248, - EnumMember = 249, - SourceFile = 250, - JSDocTypeExpression = 251, - JSDocAllType = 252, - JSDocUnknownType = 253, - JSDocArrayType = 254, - JSDocUnionType = 255, - JSDocTupleType = 256, - JSDocNullableType = 257, - JSDocNonNullableType = 258, - JSDocRecordType = 259, - JSDocRecordMember = 260, - JSDocTypeReference = 261, - JSDocOptionalType = 262, - JSDocFunctionType = 263, - JSDocVariadicType = 264, - JSDocConstructorType = 265, - JSDocThisType = 266, - JSDocComment = 267, - JSDocTag = 268, - JSDocParameterTag = 269, - JSDocReturnTag = 270, - JSDocTypeTag = 271, - JSDocTemplateTag = 272, - SyntaxList = 273, - Count = 274, + GlobalKeyword = 134, + OfKeyword = 135, + QualifiedName = 136, + ComputedPropertyName = 137, + TypeParameter = 138, + Parameter = 139, + Decorator = 140, + PropertySignature = 141, + PropertyDeclaration = 142, + MethodSignature = 143, + MethodDeclaration = 144, + Constructor = 145, + GetAccessor = 146, + SetAccessor = 147, + CallSignature = 148, + ConstructSignature = 149, + IndexSignature = 150, + TypePredicate = 151, + TypeReference = 152, + FunctionType = 153, + ConstructorType = 154, + TypeQuery = 155, + TypeLiteral = 156, + ArrayType = 157, + TupleType = 158, + UnionType = 159, + IntersectionType = 160, + ParenthesizedType = 161, + ThisType = 162, + StringLiteralType = 163, + ObjectBindingPattern = 164, + ArrayBindingPattern = 165, + BindingElement = 166, + ArrayLiteralExpression = 167, + ObjectLiteralExpression = 168, + PropertyAccessExpression = 169, + ElementAccessExpression = 170, + CallExpression = 171, + NewExpression = 172, + TaggedTemplateExpression = 173, + TypeAssertionExpression = 174, + ParenthesizedExpression = 175, + FunctionExpression = 176, + ArrowFunction = 177, + DeleteExpression = 178, + TypeOfExpression = 179, + VoidExpression = 180, + AwaitExpression = 181, + PrefixUnaryExpression = 182, + PostfixUnaryExpression = 183, + BinaryExpression = 184, + ConditionalExpression = 185, + TemplateExpression = 186, + YieldExpression = 187, + SpreadElementExpression = 188, + ClassExpression = 189, + OmittedExpression = 190, + ExpressionWithTypeArguments = 191, + AsExpression = 192, + TemplateSpan = 193, + SemicolonClassElement = 194, + Block = 195, + VariableStatement = 196, + EmptyStatement = 197, + ExpressionStatement = 198, + IfStatement = 199, + DoStatement = 200, + WhileStatement = 201, + ForStatement = 202, + ForInStatement = 203, + ForOfStatement = 204, + ContinueStatement = 205, + BreakStatement = 206, + ReturnStatement = 207, + WithStatement = 208, + SwitchStatement = 209, + LabeledStatement = 210, + ThrowStatement = 211, + TryStatement = 212, + DebuggerStatement = 213, + VariableDeclaration = 214, + VariableDeclarationList = 215, + FunctionDeclaration = 216, + ClassDeclaration = 217, + InterfaceDeclaration = 218, + TypeAliasDeclaration = 219, + EnumDeclaration = 220, + ModuleDeclaration = 221, + ModuleBlock = 222, + CaseBlock = 223, + ImportEqualsDeclaration = 224, + ImportDeclaration = 225, + ImportClause = 226, + NamespaceImport = 227, + NamedImports = 228, + ImportSpecifier = 229, + ExportAssignment = 230, + ExportDeclaration = 231, + NamedExports = 232, + ExportSpecifier = 233, + MissingDeclaration = 234, + ExternalModuleReference = 235, + JsxElement = 236, + JsxSelfClosingElement = 237, + JsxOpeningElement = 238, + JsxText = 239, + JsxClosingElement = 240, + JsxAttribute = 241, + JsxSpreadAttribute = 242, + JsxExpression = 243, + CaseClause = 244, + DefaultClause = 245, + HeritageClause = 246, + CatchClause = 247, + PropertyAssignment = 248, + ShorthandPropertyAssignment = 249, + EnumMember = 250, + SourceFile = 251, + JSDocTypeExpression = 252, + JSDocAllType = 253, + JSDocUnknownType = 254, + JSDocArrayType = 255, + JSDocUnionType = 256, + JSDocTupleType = 257, + JSDocNullableType = 258, + JSDocNonNullableType = 259, + JSDocRecordType = 260, + JSDocRecordMember = 261, + JSDocTypeReference = 262, + JSDocOptionalType = 263, + JSDocFunctionType = 264, + JSDocVariadicType = 265, + JSDocConstructorType = 266, + JSDocThisType = 267, + JSDocComment = 268, + JSDocTag = 269, + JSDocParameterTag = 270, + JSDocReturnTag = 271, + JSDocTypeTag = 272, + JSDocTemplateTag = 273, + SyntaxList = 274, + Count = 275, FirstAssignment = 56, LastAssignment = 68, FirstReservedWord = 70, LastReservedWord = 105, FirstKeyword = 70, - LastKeyword = 134, + LastKeyword = 135, FirstFutureReservedWord = 106, LastFutureReservedWord = 114, - FirstTypeNode = 150, - LastTypeNode = 162, + FirstTypeNode = 151, + LastTypeNode = 163, FirstPunctuation = 15, LastPunctuation = 68, FirstToken = 0, - LastToken = 134, + LastToken = 135, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -330,7 +331,7 @@ declare namespace ts { LastTemplateToken = 14, FirstBinaryOperator = 25, LastBinaryOperator = 68, - FirstNode = 135, + FirstNode = 136, } enum NodeFlags { None = 0, @@ -354,10 +355,16 @@ declare namespace ts { ContainsThis = 262144, HasImplicitReturn = 524288, HasExplicitReturn = 1048576, + GlobalAugmentation = 2097152, + HasClassExtends = 4194304, + HasDecorators = 8388608, + HasParamDecorators = 16777216, + HasAsyncFunctions = 33554432, Modifier = 1022, AccessibilityModifier = 56, BlockScoped = 24576, ReachabilityCheckFlags = 1572864, + EmitHelperFlags = 62914560, } enum JsxFlags { None = 0, @@ -1141,6 +1148,7 @@ declare namespace ts { getSymbolAtLocation(node: Node): Symbol; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol; + getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getTypeAtLocation(node: Node): Type; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; @@ -1154,6 +1162,7 @@ declare namespace ts { isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; + isUnknownSymbol(symbol: Symbol): boolean; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; getAliasedSymbol(symbol: Symbol): Symbol; @@ -1543,6 +1552,8 @@ declare namespace ts { } } declare namespace ts { + type FileWatcherCallback = (path: string, removed?: boolean) => void; + type DirectoryWatcherCallback = (path: string) => void; interface System { args: string[]; newLine: string; @@ -1550,8 +1561,8 @@ declare namespace ts { write(s: string): void; readFile(path: string, encoding?: string): string; writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; - watchFile?(path: string, callback: (path: string, removed?: boolean) => void): FileWatcher; - watchDirectory?(path: string, callback: (path: string) => void, recursive?: boolean): FileWatcher; + watchFile?(path: Path, callback: FileWatcherCallback): FileWatcher; + watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; resolvePath(path: string): string; fileExists(path: string): boolean; directoryExists(path: string): boolean; @@ -1565,6 +1576,10 @@ declare namespace ts { interface FileWatcher { close(): void; } + interface DirectoryWatcher extends FileWatcher { + directoryPath: Path; + referenceCount: number; + } var sys: System; } declare namespace ts { @@ -2237,6 +2252,9 @@ declare namespace ts { static jsxOpenTagName: string; static jsxCloseTagName: string; static jsxSelfClosingTagName: string; + static jsxAttribute: string; + static jsxText: string; + static jsxAttributeStringLiteralValue: string; } enum ClassificationType { comment = 1, @@ -2260,6 +2278,9 @@ declare namespace ts { jsxOpenTagName = 19, jsxCloseTagName = 20, jsxSelfClosingTagName = 21, + jsxAttribute = 22, + jsxText = 23, + jsxAttributeStringLiteralValue = 24, } interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; @@ -2283,7 +2304,6 @@ declare namespace ts { function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string; function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry; function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; diff --git a/lib/typescript.js b/lib/typescript.js index 1e2f51f5aae..bbe9a4b07e3 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -163,182 +163,183 @@ var ts; SyntaxKind[SyntaxKind["SymbolKeyword"] = 131] = "SymbolKeyword"; SyntaxKind[SyntaxKind["TypeKeyword"] = 132] = "TypeKeyword"; SyntaxKind[SyntaxKind["FromKeyword"] = 133] = "FromKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 134] = "OfKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 134] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 135] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 135] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 136] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 136] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 137] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 137] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 138] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 139] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 138] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 139] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 140] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 140] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 141] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 142] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 143] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 144] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 145] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 146] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 147] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 148] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 149] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 141] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 142] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 143] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 144] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 145] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 146] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 147] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 148] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 149] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 150] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 150] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 151] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 152] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 153] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 154] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 155] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 156] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 157] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 158] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 159] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 160] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 161] = "ThisType"; - SyntaxKind[SyntaxKind["StringLiteralType"] = 162] = "StringLiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 151] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 152] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 153] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 154] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 155] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 156] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 157] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 158] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 159] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 160] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 161] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 162] = "ThisType"; + SyntaxKind[SyntaxKind["StringLiteralType"] = 163] = "StringLiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 163] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 164] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 165] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 164] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 165] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 166] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 166] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 167] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 168] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 169] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 170] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 171] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 172] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 173] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 174] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 175] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 176] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 177] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 178] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 179] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 180] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 181] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 182] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 183] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 184] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 185] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 186] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 187] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["ClassExpression"] = 188] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 189] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 190] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 191] = "AsExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 167] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 168] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 169] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 170] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 171] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 172] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 173] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 174] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 175] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 176] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 177] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 178] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 179] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 180] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 181] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 182] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 183] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 184] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 185] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 186] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 187] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElementExpression"] = 188] = "SpreadElementExpression"; + SyntaxKind[SyntaxKind["ClassExpression"] = 189] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 190] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 191] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 192] = "AsExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 192] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 193] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 193] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 194] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 194] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 195] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 196] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 197] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 198] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 199] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 200] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 201] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 202] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 203] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 204] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 205] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 206] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 207] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 208] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 209] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 210] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 211] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 212] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 213] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 214] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 215] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 216] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 217] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 218] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 219] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 220] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 221] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 222] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 223] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 224] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 225] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 226] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 227] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 228] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 229] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 230] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 231] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 232] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 233] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 195] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 196] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 197] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 198] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 199] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 200] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 201] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 202] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 203] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 204] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 205] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 206] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 207] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 208] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 209] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 210] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 211] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 212] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 213] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 214] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 215] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 216] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 217] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 218] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 219] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 220] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 221] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 222] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 223] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 224] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 225] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 226] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 227] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 228] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 229] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 230] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 231] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 232] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 233] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 234] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 234] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 235] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 235] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 236] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 237] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxText"] = 238] = "JsxText"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 239] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 240] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 241] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 242] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 236] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 237] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 238] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxText"] = 239] = "JsxText"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 240] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 241] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 242] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 243] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 243] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 244] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 245] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 246] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 244] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 245] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 246] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 247] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 247] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 248] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 248] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 249] = "ShorthandPropertyAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 249] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 250] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 250] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 251] = "SourceFile"; // JSDoc nodes. - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 251] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 252] = "JSDocTypeExpression"; // The * type. - SyntaxKind[SyntaxKind["JSDocAllType"] = 252] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 253] = "JSDocAllType"; // The ? type. - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 253] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 254] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 255] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 256] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 257] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 258] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 259] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 260] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 261] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 262] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 263] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 264] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 265] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 266] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 267] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 268] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 269] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 270] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 271] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 272] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 254] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 255] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 256] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 257] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 258] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 259] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 260] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 261] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 262] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 263] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 264] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 265] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 266] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 267] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 268] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 269] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 270] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 271] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 272] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 273] = "JSDocTemplateTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 273] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 274] = "SyntaxList"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 274] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 275] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 56] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 68] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 70] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 105] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 70] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 134] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 135] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 106] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 114] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 150] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 162] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 151] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 163] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 15] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 68] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 134] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 135] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -347,7 +348,7 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 14] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 25] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 68] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 135] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 136] = "FirstNode"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -372,10 +373,16 @@ var ts; NodeFlags[NodeFlags["ContainsThis"] = 262144] = "ContainsThis"; NodeFlags[NodeFlags["HasImplicitReturn"] = 524288] = "HasImplicitReturn"; NodeFlags[NodeFlags["HasExplicitReturn"] = 1048576] = "HasExplicitReturn"; + NodeFlags[NodeFlags["GlobalAugmentation"] = 2097152] = "GlobalAugmentation"; + NodeFlags[NodeFlags["HasClassExtends"] = 4194304] = "HasClassExtends"; + NodeFlags[NodeFlags["HasDecorators"] = 8388608] = "HasDecorators"; + NodeFlags[NodeFlags["HasParamDecorators"] = 16777216] = "HasParamDecorators"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 33554432] = "HasAsyncFunctions"; NodeFlags[NodeFlags["Modifier"] = 1022] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = 56] = "AccessibilityModifier"; NodeFlags[NodeFlags["BlockScoped"] = 24576] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 1572864] = "ReachabilityCheckFlags"; + NodeFlags[NodeFlags["EmitHelperFlags"] = 62914560] = "EmitHelperFlags"; })(ts.NodeFlags || (ts.NodeFlags = {})); var NodeFlags = ts.NodeFlags; /* @internal */ @@ -584,11 +591,6 @@ var ts; NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 8] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["EmitDecorate"] = 16] = "EmitDecorate"; - NodeCheckFlags[NodeCheckFlags["EmitParam"] = 32] = "EmitParam"; - NodeCheckFlags[NodeCheckFlags["EmitAwaiter"] = 64] = "EmitAwaiter"; - NodeCheckFlags[NodeCheckFlags["EmitGenerator"] = 128] = "EmitGenerator"; NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; @@ -1532,7 +1534,8 @@ var ts; directoryComponents.length--; } // Find the component that differs - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + var joinStartIndex; + for (joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } @@ -1681,6 +1684,12 @@ var ts; return copiedList; } ts.copyListRemovingItem = copyListRemovingItem; + function createGetCanonicalFileName(useCaseSensitivefileNames) { + return useCaseSensitivefileNames + ? (function (fileName) { return fileName; }) + : (function (fileName) { return fileName.toLowerCase(); }); + } + ts.createGetCanonicalFileName = createGetCanonicalFileName; })(ts || (ts = {})); /// var ts; @@ -1829,7 +1838,7 @@ var ts; var _os = require("os"); // average async stat takes about 30 microseconds // set chunk size to do 30 files in < 1 millisecond - function createWatchedFileSet(interval, chunkSize) { + function createPollingWatchedFileSet(interval, chunkSize) { if (interval === void 0) { interval = 2500; } if (chunkSize === void 0) { chunkSize = 30; } var watchedFiles = []; @@ -1843,13 +1852,13 @@ var ts; if (!watchedFile) { return; } - _fs.stat(watchedFile.fileName, function (err, stats) { + _fs.stat(watchedFile.filePath, function (err, stats) { if (err) { - watchedFile.callback(watchedFile.fileName); + watchedFile.callback(watchedFile.filePath); } else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { - watchedFile.mtime = getModifiedTime(watchedFile.fileName); - watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0); + watchedFile.mtime = getModifiedTime(watchedFile.filePath); + watchedFile.callback(watchedFile.filePath, watchedFile.mtime.getTime() === 0); } }); } @@ -1875,11 +1884,11 @@ var ts; nextFileToCheck = nextToCheck; }, interval); } - function addFile(fileName, callback) { + function addFile(filePath, callback) { var file = { - fileName: fileName, + filePath: filePath, callback: callback, - mtime: getModifiedTime(fileName) + mtime: getModifiedTime(filePath) }; watchedFiles.push(file); if (watchedFiles.length === 1) { @@ -1898,6 +1907,77 @@ var ts; removeFile: removeFile }; } + function createWatchedFileSet() { + var dirWatchers = ts.createFileMap(); + // One file can have multiple watchers + var fileWatcherCallbacks = ts.createFileMap(); + return { addFile: addFile, removeFile: removeFile }; + function reduceDirWatcherRefCountForFile(filePath) { + var dirPath = ts.getDirectoryPath(filePath); + if (dirWatchers.contains(dirPath)) { + var watcher = dirWatchers.get(dirPath); + watcher.referenceCount -= 1; + if (watcher.referenceCount <= 0) { + watcher.close(); + dirWatchers.remove(dirPath); + } + } + } + function addDirWatcher(dirPath) { + if (dirWatchers.contains(dirPath)) { + var watcher_1 = dirWatchers.get(dirPath); + watcher_1.referenceCount += 1; + return; + } + var watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher.referenceCount = 1; + dirWatchers.set(dirPath, watcher); + return; + } + function addFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + fileWatcherCallbacks.get(filePath).push(callback); + } + else { + fileWatcherCallbacks.set(filePath, [callback]); + } + } + function addFile(filePath, callback) { + addFileWatcherCallback(filePath, callback); + addDirWatcher(ts.getDirectoryPath(filePath)); + return { filePath: filePath, callback: callback }; + } + function removeFile(watchedFile) { + removeFileWatcherCallback(watchedFile.filePath, watchedFile.callback); + reduceDirWatcherRefCountForFile(watchedFile.filePath); + } + function removeFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + var newCallbacks = ts.copyListRemovingItem(callback, fileWatcherCallbacks.get(filePath)); + if (newCallbacks.length === 0) { + fileWatcherCallbacks.remove(filePath); + } + else { + fileWatcherCallbacks.set(filePath, newCallbacks); + } + } + } + /** + * @param watcherPath is the path from which the watcher is triggered. + */ + function fileEventHandler(eventName, relativeFileName, baseDirPath) { + // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" + var filePath = typeof relativeFileName !== "string" + ? undefined + : ts.toPath(relativeFileName, baseDirPath, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)); + if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) { + for (var _i = 0, _a = fileWatcherCallbacks.get(filePath); _i < _a.length; _i++) { + var fileCallback = _a[_i]; + fileCallback(filePath); + } + } + } + } // REVIEW: for now this implementation uses polling. // The advantage of polling is that it works reliably // on all os and with network mounted files. @@ -1911,7 +1991,11 @@ var ts; // changes for large reference sets? If so, do we want // to increase the chunk size or decrease the interval // time dynamically to match the large reference set? + var pollingWatchedFileSet = createPollingWatchedFileSet(); var watchedFileSet = createWatchedFileSet(); + function isNode4OrLater() { + return parseInt(process.version.charAt(1)) >= 4; + } var platform = _os.platform(); // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; @@ -1960,7 +2044,7 @@ var ts; } } function getCanonicalPath(path) { - return useCaseSensitiveFileNames ? path.toLowerCase() : path; + return useCaseSensitiveFileNames ? path : path.toLowerCase(); } function readDirectory(path, extension, exclude) { var result = []; @@ -2000,20 +2084,28 @@ var ts; }, readFile: readFile, writeFile: writeFile, - watchFile: function (fileName, callback) { + watchFile: function (filePath, callback) { // Node 4.0 stablized the `fs.watch` function on Windows which avoids polling // and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649 // and https://github.com/Microsoft/TypeScript/issues/4643), therefore // if the current node.js version is newer than 4, use `fs.watch` instead. - var watchedFile = watchedFileSet.addFile(fileName, callback); + var watchSet = isNode4OrLater() ? watchedFileSet : pollingWatchedFileSet; + var watchedFile = watchSet.addFile(filePath, callback); return { - close: function () { return watchedFileSet.removeFile(watchedFile); } + close: function () { return watchSet.removeFile(watchedFile); } }; }, watchDirectory: function (path, callback, recursive) { // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) - return _fs.watch(path, { persistent: true, recursive: !!recursive }, function (eventName, relativeFileName) { + var options; + if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + options = { persistent: true, recursive: !!recursive }; + } + else { + options = { persistent: true }; + } + return _fs.watch(path, options, function (eventName, relativeFileName) { // In watchDirectory we only care about adding and removing files (when event name is // "rename"); changes made within files are handled by corresponding fileWatchers (when // event name is "change") @@ -2283,7 +2375,6 @@ var ts; Cannot_find_parameter_0: { code: 1225, category: ts.DiagnosticCategory.Error, key: "Cannot_find_parameter_0_1225", message: "Cannot find parameter '{0}'." }, Type_predicate_0_is_not_assignable_to_1: { code: 1226, category: ts.DiagnosticCategory.Error, key: "Type_predicate_0_is_not_assignable_to_1_1226", message: "Type predicate '{0}' is not assignable to '{1}'." }, Parameter_0_is_not_in_the_same_position_as_parameter_1: { code: 1227, category: ts.DiagnosticCategory.Error, key: "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", message: "Parameter '{0}' is not in the same position as parameter '{1}'." }, - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: { code: 1228, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", message: "A type predicate is only allowed in return type position for functions and methods." }, A_type_predicate_cannot_reference_a_rest_parameter: { code: 1229, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_a_rest_parameter_1229", message: "A type predicate cannot reference a rest parameter." }, A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: { code: 1230, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", message: "A type predicate cannot reference element '{0}' in a binding pattern." }, An_export_assignment_can_only_be_used_in_a_module: { code: 1231, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_can_only_be_used_in_a_module_1231", message: "An export assignment can only be used in a module." }, @@ -2519,7 +2610,6 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, - A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -2548,6 +2638,16 @@ var ts; Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, + Cannot_re_export_name_that_is_not_defined_in_the_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_re_export_name_that_is_not_defined_in_the_module_2661", message: "Cannot re-export name that is not defined in the module." }, + Cannot_find_name_0_Did_you_mean_the_static_member_1_0: { code: 2662, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", message: "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?" }, + Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: { code: 2663, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", message: "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?" }, + Invalid_module_name_in_augmentation_module_0_cannot_be_found: { code: 2664, category: ts.DiagnosticCategory.Error, key: "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", message: "Invalid module name in augmentation, module '{0}' cannot be found." }, + Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope: { code: 2665, category: ts.DiagnosticCategory.Error, key: "Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope_2665", message: "Module augmentation cannot introduce new names in the top level scope." }, + Exports_and_export_assignments_are_not_permitted_in_module_augmentations: { code: 2666, category: ts.DiagnosticCategory.Error, key: "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", message: "Exports and export assignments are not permitted in module augmentations." }, + Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: { code: 2667, category: ts.DiagnosticCategory.Error, key: "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", message: "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module." }, + export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: { code: 2668, category: ts.DiagnosticCategory.Error, key: "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", message: "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible." }, + Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: { code: 2669, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", message: "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations." }, + Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: { code: 2670, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", message: "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2712,6 +2812,7 @@ var ts; _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", message: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", message: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", message: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: { code: 7015, category: ts.DiagnosticCategory.Error, key: "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", message: "Element implicitly has an 'any' type because index expression is not of type 'number'." }, Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation_7016", message: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index_signature_of_object_type_implicitly_has_an_any_type_7017", message: "Index signature of object type implicitly has an 'any' type." }, Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: ts.DiagnosticCategory.Error, key: "Object_literal_s_property_0_implicitly_has_an_1_type_7018", message: "Object literal's property '{0}' implicitly has an '{1}' type." }, @@ -2810,6 +2911,7 @@ var ts; "protected": 111 /* ProtectedKeyword */, "public": 112 /* PublicKeyword */, "require": 127 /* RequireKeyword */, + "global": 134 /* GlobalKeyword */, "return": 94 /* ReturnKeyword */, "set": 129 /* SetKeyword */, "static": 113 /* StaticKeyword */, @@ -2830,7 +2932,7 @@ var ts; "yield": 114 /* YieldKeyword */, "async": 118 /* AsyncKeyword */, "await": 119 /* AwaitKeyword */, - "of": 134 /* OfKeyword */, + "of": 135 /* OfKeyword */, "{": 15 /* OpenBraceToken */, "}": 16 /* CloseBraceToken */, "(": 17 /* OpenParenToken */, @@ -4246,7 +4348,7 @@ var ts; break; } } - return token = 238 /* JsxText */; + return token = 239 /* JsxText */; } // Scans a JSX identifier; these differ from normal identifiers in that // they allow dashes @@ -4429,7 +4531,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 250 /* SourceFile */) { + while (node && node.kind !== 251 /* SourceFile */) { node = node.parent; } return node; @@ -4532,6 +4634,31 @@ var ts; isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function isAmbientModule(node) { + return node && node.kind === 221 /* ModuleDeclaration */ && + (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); + } + ts.isAmbientModule = isAmbientModule; + function isGlobalScopeAugmentation(module) { + return !!(module.flags & 2097152 /* GlobalAugmentation */); + } + ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; + function isExternalModuleAugmentation(node) { + // external module augmentation is a ambient module declaration that is either: + // - defined in the top level scope and source file is an external module + // - defined inside ambient module declaration located in the top level scope and source file not an external module + if (!node || !isAmbientModule(node)) { + return false; + } + switch (node.parent.kind) { + case 251 /* SourceFile */: + return isExternalModule(node.parent); + case 222 /* ModuleBlock */: + return isAmbientModule(node.parent.parent) && !isExternalModule(node.parent.parent.parent); + } + return false; + } + ts.isExternalModuleAugmentation = isExternalModuleAugmentation; // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { @@ -4541,15 +4668,15 @@ var ts; return current; } switch (current.kind) { - case 250 /* SourceFile */: - case 222 /* CaseBlock */: - case 246 /* CatchClause */: - case 220 /* ModuleDeclaration */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 251 /* SourceFile */: + case 223 /* CaseBlock */: + case 247 /* CatchClause */: + case 221 /* ModuleDeclaration */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: return current; - case 194 /* Block */: + case 195 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { @@ -4562,9 +4689,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 213 /* VariableDeclaration */ && + declaration.kind === 214 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 246 /* CatchClause */; + declaration.parent.kind === 247 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; // Return display name of an identifier @@ -4603,7 +4730,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -4612,17 +4739,18 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 220 /* ModuleDeclaration */: - case 219 /* EnumDeclaration */: - case 249 /* EnumMember */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 220 /* EnumDeclaration */: + case 250 /* EnumMember */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 219 /* TypeAliasDeclaration */: errorNode = node.name; break; } @@ -4650,11 +4778,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 219 /* EnumDeclaration */ && isConst(node); + return node.kind === 220 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 165 /* BindingElement */ || isBindingPattern(node))) { + while (node && (node.kind === 166 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; @@ -4669,14 +4797,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 213 /* VariableDeclaration */) { + if (node.kind === 214 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 214 /* VariableDeclarationList */) { + if (node && node.kind === 215 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 195 /* VariableStatement */) { + if (node && node.kind === 196 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -4691,7 +4819,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 197 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; + return node.kind === 198 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -4707,7 +4835,7 @@ var ts; } ts.getJsDocComments = getJsDocComments; function getJsDocCommentsFromText(node, text) { - var commentRanges = (node.kind === 138 /* Parameter */ || node.kind === 137 /* TypeParameter */) ? + var commentRanges = (node.kind === 139 /* Parameter */ || node.kind === 138 /* TypeParameter */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, isJsDocComment); @@ -4722,7 +4850,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (150 /* FirstTypeNode */ <= node.kind && node.kind <= 162 /* LastTypeNode */) { + if (151 /* FirstTypeNode */ <= node.kind && node.kind <= 163 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -4733,26 +4861,26 @@ var ts; case 131 /* SymbolKeyword */: return true; case 103 /* VoidKeyword */: - return node.parent.kind !== 179 /* VoidExpression */; - case 190 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 180 /* VoidExpression */; + case 191 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 69 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); - case 135 /* QualifiedName */: - case 168 /* PropertyAccessExpression */: + ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 136 /* QualifiedName */ || node.kind === 169 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + case 136 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: case 97 /* ThisKeyword */: var parent_1 = node.parent; - if (parent_1.kind === 154 /* TypeQuery */) { + if (parent_1.kind === 155 /* TypeQuery */) { return false; } // Do not recursively call isTypeNode on the parent. In the example: @@ -4761,38 +4889,38 @@ var ts; // // Calling isTypeNode would consider the qualified name A.B a type node. Only C or // A.B.C is a type node. - if (150 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 162 /* LastTypeNode */) { + if (151 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 163 /* LastTypeNode */) { return true; } switch (parent_1.kind) { - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return node === parent_1.constraint; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 138 /* Parameter */: - case 213 /* VariableDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 139 /* Parameter */: + case 214 /* VariableDeclaration */: return node === parent_1.type; - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 144 /* Constructor */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 145 /* Constructor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return node === parent_1.type; - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return node === parent_1.type; - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: return node === parent_1.type; - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -4806,23 +4934,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return visitor(node); - case 222 /* CaseBlock */: - case 194 /* Block */: - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 207 /* WithStatement */: - case 208 /* SwitchStatement */: - case 243 /* CaseClause */: - case 244 /* DefaultClause */: - case 209 /* LabeledStatement */: - case 211 /* TryStatement */: - case 246 /* CatchClause */: + case 223 /* CaseBlock */: + case 195 /* Block */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 208 /* WithStatement */: + case 209 /* SwitchStatement */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: + case 210 /* LabeledStatement */: + case 212 /* TryStatement */: + case 247 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4832,18 +4960,18 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: - case 220 /* ModuleDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. @@ -4851,7 +4979,7 @@ var ts; default: if (isFunctionLike(node)) { var name_5 = node.name; - if (name_5 && name_5.kind === 136 /* ComputedPropertyName */) { + if (name_5 && name_5.kind === 137 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(name_5.expression); @@ -4870,14 +4998,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 165 /* BindingElement */: - case 249 /* EnumMember */: - case 138 /* Parameter */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 248 /* ShorthandPropertyAssignment */: - case 213 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 250 /* EnumMember */: + case 139 /* Parameter */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 249 /* ShorthandPropertyAssignment */: + case 214 /* VariableDeclaration */: return true; } } @@ -4885,11 +5013,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 145 /* GetAccessor */ || node.kind === 146 /* SetAccessor */); + return node && (node.kind === 146 /* GetAccessor */ || node.kind === 147 /* SetAccessor */); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */); + return node && (node.kind === 217 /* ClassDeclaration */ || node.kind === 189 /* ClassExpression */); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -4898,32 +5026,32 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 144 /* Constructor */: - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 145 /* Constructor */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return true; } } ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: return true; } return false; @@ -4931,24 +5059,24 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: return true; - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 194 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 195 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 /* MethodDeclaration */ && node.parent.kind === 167 /* ObjectLiteralExpression */; + return node && node.kind === 144 /* MethodDeclaration */ && node.parent.kind === 168 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isIdentifierTypePredicate(predicate) { @@ -4980,7 +5108,7 @@ var ts; return undefined; } switch (node.kind) { - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -4995,9 +5123,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 139 /* Decorator */: + case 140 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 138 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 139 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -5008,26 +5136,26 @@ var ts; node = node.parent; } break; - case 176 /* ArrowFunction */: + case 177 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // Fall through - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 220 /* ModuleDeclaration */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 219 /* EnumDeclaration */: - case 250 /* SourceFile */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 221 /* ModuleDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 220 /* EnumDeclaration */: + case 251 /* SourceFile */: return node; } } @@ -5037,7 +5165,7 @@ var ts; * Given an super call\property node returns a closest node where either * - super call\property is legal in the node and not legal in the parent node the node. * i.e. super call is legal in constructor but not legal in the class body. - * - node is arrow function (so caller might need to call getSuperContainer in case if he needs to climb higher) + * - node is arrow function (so caller might need to call getSuperContainer in case it needs to climb higher) * - super call\property is definitely illegal in the node (but might be legal in some subnode) * i.e. super property access is illegal in function declaration but can be legal in the statement list */ @@ -5048,26 +5176,26 @@ var ts; return node; } switch (node.kind) { - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: node = node.parent; break; - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: if (!stopOnFunctions) { continue; } - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return node; - case 139 /* Decorator */: + case 140 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 138 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 139 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -5085,12 +5213,12 @@ var ts; function getEntityNameFromTypeNode(node) { if (node) { switch (node.kind) { - case 151 /* TypeReference */: + case 152 /* TypeReference */: return node.typeName; - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return node.expression; case 69 /* Identifier */: - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return node; } } @@ -5098,7 +5226,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { return node.tag; } // Will either be a CallExpression, NewExpression, or Decorator. @@ -5107,58 +5235,40 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: // classes are valid targets return true; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 216 /* ClassDeclaration */; - case 138 /* Parameter */: - // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; - return node.parent.body && node.parent.parent.kind === 216 /* ClassDeclaration */; - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 143 /* MethodDeclaration */: + return node.parent.kind === 217 /* ClassDeclaration */; + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 144 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. - return node.body && node.parent.kind === 216 /* ClassDeclaration */; + return node.body !== undefined + && node.parent.kind === 217 /* ClassDeclaration */; + case 139 /* Parameter */: + // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; + return node.parent.body !== undefined + && (node.parent.kind === 145 /* Constructor */ + || node.parent.kind === 144 /* MethodDeclaration */ + || node.parent.kind === 147 /* SetAccessor */) + && node.parent.parent.kind === 217 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { - switch (node.kind) { - case 216 /* ClassDeclaration */: - if (node.decorators) { - return true; - } - return false; - case 141 /* PropertyDeclaration */: - case 138 /* Parameter */: - if (node.decorators) { - return true; - } - return false; - case 145 /* GetAccessor */: - if (node.body && node.decorators) { - return true; - } - return false; - case 143 /* MethodDeclaration */: - case 146 /* SetAccessor */: - if (node.body && node.decorators) { - return true; - } - return false; - } - return false; + return node.decorators !== undefined + && nodeCanBeDecorated(node); } ts.nodeIsDecorated = nodeIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 168 /* PropertyAccessExpression */; + return node.kind === 169 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 169 /* ElementAccessExpression */; + return node.kind === 170 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -5168,42 +5278,42 @@ var ts; case 99 /* TrueKeyword */: case 84 /* FalseKeyword */: case 10 /* RegularExpressionLiteral */: - case 166 /* ArrayLiteralExpression */: - case 167 /* ObjectLiteralExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 172 /* TaggedTemplateExpression */: - case 191 /* AsExpression */: - case 173 /* TypeAssertionExpression */: - case 174 /* ParenthesizedExpression */: - case 175 /* FunctionExpression */: - case 188 /* ClassExpression */: - case 176 /* ArrowFunction */: - case 179 /* VoidExpression */: - case 177 /* DeleteExpression */: - case 178 /* TypeOfExpression */: - case 181 /* PrefixUnaryExpression */: - case 182 /* PostfixUnaryExpression */: - case 183 /* BinaryExpression */: - case 184 /* ConditionalExpression */: - case 187 /* SpreadElementExpression */: - case 185 /* TemplateExpression */: + case 167 /* ArrayLiteralExpression */: + case 168 /* ObjectLiteralExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 173 /* TaggedTemplateExpression */: + case 192 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 175 /* ParenthesizedExpression */: + case 176 /* FunctionExpression */: + case 189 /* ClassExpression */: + case 177 /* ArrowFunction */: + case 180 /* VoidExpression */: + case 178 /* DeleteExpression */: + case 179 /* TypeOfExpression */: + case 182 /* PrefixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: + case 184 /* BinaryExpression */: + case 185 /* ConditionalExpression */: + case 188 /* SpreadElementExpression */: + case 186 /* TemplateExpression */: case 11 /* NoSubstitutionTemplateLiteral */: - case 189 /* OmittedExpression */: - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: - case 186 /* YieldExpression */: - case 180 /* AwaitExpression */: + case 190 /* OmittedExpression */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: + case 187 /* YieldExpression */: + case 181 /* AwaitExpression */: return true; - case 135 /* QualifiedName */: - while (node.parent.kind === 135 /* QualifiedName */) { + case 136 /* QualifiedName */: + while (node.parent.kind === 136 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 154 /* TypeQuery */; + return node.parent.kind === 155 /* TypeQuery */; case 69 /* Identifier */: - if (node.parent.kind === 154 /* TypeQuery */) { + if (node.parent.kind === 155 /* TypeQuery */) { return true; } // fall through @@ -5212,47 +5322,47 @@ var ts; case 97 /* ThisKeyword */: var parent_2 = node.parent; switch (parent_2.kind) { - case 213 /* VariableDeclaration */: - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 249 /* EnumMember */: - case 247 /* PropertyAssignment */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 139 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 250 /* EnumMember */: + case 248 /* PropertyAssignment */: + case 166 /* BindingElement */: return parent_2.initializer === node; - case 197 /* ExpressionStatement */: - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 206 /* ReturnStatement */: - case 207 /* WithStatement */: - case 208 /* SwitchStatement */: - case 243 /* CaseClause */: - case 210 /* ThrowStatement */: - case 208 /* SwitchStatement */: + case 198 /* ExpressionStatement */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 207 /* ReturnStatement */: + case 208 /* WithStatement */: + case 209 /* SwitchStatement */: + case 244 /* CaseClause */: + case 211 /* ThrowStatement */: + case 209 /* SwitchStatement */: return parent_2.expression === node; - case 201 /* ForStatement */: + case 202 /* ForStatement */: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 214 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 215 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 215 /* VariableDeclarationList */) || forInStatement.expression === node; - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: return node === parent_2.expression; - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return node === parent_2.expression; - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: return node === parent_2.expression; - case 139 /* Decorator */: - case 242 /* JsxExpression */: - case 241 /* JsxSpreadAttribute */: + case 140 /* Decorator */: + case 243 /* JsxExpression */: + case 242 /* JsxSpreadAttribute */: return true; - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -5276,7 +5386,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */; + return node.kind === 224 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 235 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -5285,7 +5395,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 234 /* ExternalModuleReference */; + return node.kind === 224 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 235 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -5303,7 +5413,7 @@ var ts; */ function isRequireCall(expression) { // of the form 'require("name")' - return expression.kind === 170 /* CallExpression */ && + return expression.kind === 171 /* CallExpression */ && expression.expression.kind === 69 /* Identifier */ && expression.expression.text === "require" && expression.arguments.length === 1 && @@ -5313,11 +5423,11 @@ var ts; /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property /// assignments we treat as special in the binder function getSpecialPropertyAssignmentKind(expression) { - if (expression.kind !== 183 /* BinaryExpression */) { + if (expression.kind !== 184 /* BinaryExpression */) { return 0 /* None */; } var expr = expression; - if (expr.operatorToken.kind !== 56 /* EqualsToken */ || expr.left.kind !== 168 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 56 /* EqualsToken */ || expr.left.kind !== 169 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; @@ -5335,7 +5445,7 @@ var ts; else if (lhs.expression.kind === 97 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 168 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 169 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 69 /* Identifier */ && innerPropertyAccess.name.text === "prototype") { @@ -5346,30 +5456,33 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 224 /* ImportDeclaration */) { + if (node.kind === 225 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 223 /* ImportEqualsDeclaration */) { + if (node.kind === 224 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 234 /* ExternalModuleReference */) { + if (reference.kind === 235 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 230 /* ExportDeclaration */) { + if (node.kind === 231 /* ExportDeclaration */) { return node.moduleSpecifier; } + if (node.kind === 221 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + return node.name; + } } ts.getExternalModuleName = getExternalModuleName; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 138 /* Parameter */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 248 /* ShorthandPropertyAssignment */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 139 /* Parameter */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 249 /* ShorthandPropertyAssignment */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -5377,9 +5490,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 263 /* JSDocFunctionType */ && + return node.kind === 264 /* JSDocFunctionType */ && node.parameters.length > 0 && - node.parameters[0].type.kind === 265 /* JSDocConstructorType */; + node.parameters[0].type.kind === 266 /* JSDocConstructorType */; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -5393,15 +5506,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 271 /* JSDocTypeTag */); + return getJSDocTag(node, 272 /* JSDocTypeTag */); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 270 /* JSDocReturnTag */); + return getJSDocTag(node, 271 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 272 /* JSDocTemplateTag */); + return getJSDocTag(node, 273 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -5412,7 +5525,7 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 269 /* JSDocParameterTag */) { + if (t.kind === 270 /* JSDocParameterTag */) { var parameterTag = t; var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; if (name_6.text === parameterName) { @@ -5431,12 +5544,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32 /* JavaScriptFile */) { - if (node.type && node.type.kind === 264 /* JSDocVariadicType */) { + if (node.type && node.type.kind === 265 /* JSDocVariadicType */) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 264 /* JSDocVariadicType */; + return paramTag.typeExpression.type.kind === 265 /* JSDocVariadicType */; } } return node.dotDotDotToken !== undefined; @@ -5457,7 +5570,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 164 /* ArrayBindingPattern */ || node.kind === 163 /* ObjectBindingPattern */); + return !!node && (node.kind === 165 /* ArrayBindingPattern */ || node.kind === 164 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -5481,34 +5594,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 176 /* ArrowFunction */: - case 165 /* BindingElement */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 144 /* Constructor */: - case 219 /* EnumDeclaration */: - case 249 /* EnumMember */: - case 232 /* ExportSpecifier */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 145 /* GetAccessor */: - case 225 /* ImportClause */: - case 223 /* ImportEqualsDeclaration */: - case 228 /* ImportSpecifier */: - case 217 /* InterfaceDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 220 /* ModuleDeclaration */: - case 226 /* NamespaceImport */: - case 138 /* Parameter */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 146 /* SetAccessor */: - case 248 /* ShorthandPropertyAssignment */: - case 218 /* TypeAliasDeclaration */: - case 137 /* TypeParameter */: - case 213 /* VariableDeclaration */: + case 177 /* ArrowFunction */: + case 166 /* BindingElement */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 145 /* Constructor */: + case 220 /* EnumDeclaration */: + case 250 /* EnumMember */: + case 233 /* ExportSpecifier */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 146 /* GetAccessor */: + case 226 /* ImportClause */: + case 224 /* ImportEqualsDeclaration */: + case 229 /* ImportSpecifier */: + case 218 /* InterfaceDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 221 /* ModuleDeclaration */: + case 227 /* NamespaceImport */: + case 139 /* Parameter */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 147 /* SetAccessor */: + case 249 /* ShorthandPropertyAssignment */: + case 219 /* TypeAliasDeclaration */: + case 138 /* TypeParameter */: + case 214 /* VariableDeclaration */: return true; } return false; @@ -5516,25 +5629,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: - case 212 /* DebuggerStatement */: - case 199 /* DoStatement */: - case 197 /* ExpressionStatement */: - case 196 /* EmptyStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 201 /* ForStatement */: - case 198 /* IfStatement */: - case 209 /* LabeledStatement */: - case 206 /* ReturnStatement */: - case 208 /* SwitchStatement */: - case 210 /* ThrowStatement */: - case 211 /* TryStatement */: - case 195 /* VariableStatement */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 229 /* ExportAssignment */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 213 /* DebuggerStatement */: + case 200 /* DoStatement */: + case 198 /* ExpressionStatement */: + case 197 /* EmptyStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 202 /* ForStatement */: + case 199 /* IfStatement */: + case 210 /* LabeledStatement */: + case 207 /* ReturnStatement */: + case 209 /* SwitchStatement */: + case 211 /* ThrowStatement */: + case 212 /* TryStatement */: + case 196 /* VariableStatement */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 230 /* ExportAssignment */: return true; default: return false; @@ -5543,13 +5656,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 144 /* Constructor */: - case 141 /* PropertyDeclaration */: - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 142 /* MethodSignature */: - case 149 /* IndexSignature */: + case 145 /* Constructor */: + case 142 /* PropertyDeclaration */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 143 /* MethodSignature */: + case 150 /* IndexSignature */: return true; default: return false; @@ -5562,7 +5675,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 228 /* ImportSpecifier */ || parent.kind === 232 /* ExportSpecifier */) { + if (parent.kind === 229 /* ImportSpecifier */ || parent.kind === 233 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -5577,31 +5690,31 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 249 /* EnumMember */: - case 247 /* PropertyAssignment */: - case 168 /* PropertyAccessExpression */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 250 /* EnumMember */: + case 248 /* PropertyAssignment */: + case 169 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 135 /* QualifiedName */) { + while (parent.kind === 136 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 154 /* TypeQuery */; + return parent.kind === 155 /* TypeQuery */; } return false; - case 165 /* BindingElement */: - case 228 /* ImportSpecifier */: + case 166 /* BindingElement */: + case 229 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 232 /* ExportSpecifier */: + case 233 /* ExportSpecifier */: // Any name in an export specifier return true; } @@ -5617,12 +5730,12 @@ var ts; // export = ... // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 223 /* ImportEqualsDeclaration */ || - node.kind === 225 /* ImportClause */ && !!node.name || - node.kind === 226 /* NamespaceImport */ || - node.kind === 228 /* ImportSpecifier */ || - node.kind === 232 /* ExportSpecifier */ || - node.kind === 229 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; + return node.kind === 224 /* ImportEqualsDeclaration */ || + node.kind === 226 /* ImportClause */ && !!node.name || + node.kind === 227 /* NamespaceImport */ || + node.kind === 229 /* ImportSpecifier */ || + node.kind === 233 /* ExportSpecifier */ || + node.kind === 230 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -5704,7 +5817,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 70 /* FirstKeyword */ <= token && token <= 134 /* LastKeyword */; + return 70 /* FirstKeyword */ <= token && token <= 135 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -5731,7 +5844,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 136 /* ComputedPropertyName */ && + return name.kind === 137 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression.kind) && !isWellKnownSymbolSyntactically(name.expression); } @@ -5749,7 +5862,7 @@ var ts; if (name.kind === 69 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */) { return name.text; } - if (name.kind === 136 /* ComputedPropertyName */) { + if (name.kind === 137 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -5789,18 +5902,18 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 138 /* Parameter */; + return root.kind === 139 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 165 /* BindingElement */) { + while (node.kind === 166 /* BindingElement */) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 220 /* ModuleDeclaration */ || n.kind === 250 /* SourceFile */; + return isFunctionLike(n) || n.kind === 221 /* ModuleDeclaration */ || n.kind === 251 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; /** @@ -5850,7 +5963,7 @@ var ts; } ts.cloneEntityName = cloneEntityName; function isQualifiedName(node) { - return node.kind === 135 /* QualifiedName */; + return node.kind === 136 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { @@ -6180,7 +6293,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 144 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 145 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -6197,10 +6310,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 145 /* GetAccessor */) { + if (accessor.kind === 146 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 146 /* SetAccessor */) { + else if (accessor.kind === 147 /* SetAccessor */) { setAccessor = accessor; } else { @@ -6209,7 +6322,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 145 /* GetAccessor */ || member.kind === 146 /* SetAccessor */) + if ((member.kind === 146 /* GetAccessor */ || member.kind === 147 /* SetAccessor */) && (member.flags & 64 /* Static */) === (accessor.flags & 64 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -6220,10 +6333,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 145 /* GetAccessor */ && !getAccessor) { + if (member.kind === 146 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 146 /* SetAccessor */ && !setAccessor) { + if (member.kind === 147 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6433,24 +6546,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 171 /* NewExpression */: - case 170 /* CallExpression */: - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: - case 172 /* TaggedTemplateExpression */: - case 166 /* ArrayLiteralExpression */: - case 174 /* ParenthesizedExpression */: - case 167 /* ObjectLiteralExpression */: - case 188 /* ClassExpression */: - case 175 /* FunctionExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 172 /* NewExpression */: + case 171 /* CallExpression */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: + case 173 /* TaggedTemplateExpression */: + case 167 /* ArrayLiteralExpression */: + case 175 /* ParenthesizedExpression */: + case 168 /* ObjectLiteralExpression */: + case 189 /* ClassExpression */: + case 176 /* FunctionExpression */: case 69 /* Identifier */: case 10 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 11 /* NoSubstitutionTemplateLiteral */: - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: case 84 /* FalseKeyword */: case 93 /* NullKeyword */: case 97 /* ThisKeyword */: @@ -6467,7 +6580,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 190 /* ExpressionWithTypeArguments */ && + return node.kind === 191 /* ExpressionWithTypeArguments */ && node.parent.token === 83 /* ExtendsKeyword */ && isClassLike(node.parent.parent); } @@ -6490,16 +6603,16 @@ var ts; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 167 /* ObjectLiteralExpression */) { + if (kind === 168 /* ObjectLiteralExpression */) { return expression.properties.length === 0; } - if (kind === 166 /* ArrayLiteralExpression */) { + if (kind === 167 /* ArrayLiteralExpression */) { return expression.elements.length === 0; } return false; @@ -6854,9 +6967,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 137 /* TypeParameter */) { + if (d && d.kind === 138 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 218 /* InterfaceDeclaration */) { return current; } } @@ -6864,7 +6977,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return node.flags & 56 /* AccessibilityModifier */ && node.parent.kind === 144 /* Constructor */ && ts.isClassLike(node.parent.parent); + return node.flags & 56 /* AccessibilityModifier */ && node.parent.kind === 145 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); @@ -6876,7 +6989,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 250 /* SourceFile */) { + if (kind === 251 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -6919,26 +7032,26 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 248 /* ShorthandPropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 247 /* PropertyAssignment */: - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 139 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 248 /* PropertyAssignment */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -6947,24 +7060,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -6975,290 +7088,290 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 157 /* TupleType */: + case 158 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: return visitNodes(cbNodes, node.types); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 178 /* TypeOfExpression */: + case 179 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 179 /* VoidExpression */: + case 180 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 180 /* AwaitExpression */: + case 181 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 191 /* AsExpression */: + case 192 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 187 /* SpreadElementExpression */: + case 188 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 214 /* VariableDeclarationList */: + case 215 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 198 /* IfStatement */: + case 199 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 199 /* DoStatement */: + case 200 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 202 /* ForInStatement */: + case 203 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 203 /* ForOfStatement */: + case 204 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 204 /* ContinueStatement */: - case 205 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 206 /* BreakStatement */: return visitNode(cbNode, node.label); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 243 /* CaseClause */: + case 244 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 244 /* DefaultClause */: + case 245 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 211 /* TryStatement */: + case 212 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 139 /* Decorator */: + case 140 /* Decorator */: return visitNode(cbNode, node.expression); - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 225 /* ImportClause */: + case 226 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 226 /* NamespaceImport */: + case 227 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 227 /* NamedImports */: - case 231 /* NamedExports */: + case 228 /* NamedImports */: + case 232 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 245 /* HeritageClause */: + case 246 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 234 /* ExternalModuleReference */: + case 235 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 233 /* MissingDeclaration */: + case 234 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); - case 235 /* JsxElement */: + case 236 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 236 /* JsxSelfClosingElement */: - case 237 /* JsxOpeningElement */: + case 237 /* JsxSelfClosingElement */: + case 238 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 240 /* JsxAttribute */: + case 241 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 241 /* JsxSpreadAttribute */: + case 242 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return visitNode(cbNode, node.expression); - case 239 /* JsxClosingElement */: + case 240 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 251 /* JSDocTypeExpression */: + case 252 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 255 /* JSDocUnionType */: + case 256 /* JSDocUnionType */: return visitNodes(cbNodes, node.types); - case 256 /* JSDocTupleType */: + case 257 /* JSDocTupleType */: return visitNodes(cbNodes, node.types); - case 254 /* JSDocArrayType */: + case 255 /* JSDocArrayType */: return visitNode(cbNode, node.elementType); - case 258 /* JSDocNonNullableType */: + case 259 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 257 /* JSDocNullableType */: + case 258 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 259 /* JSDocRecordType */: + case 260 /* JSDocRecordType */: return visitNodes(cbNodes, node.members); - case 261 /* JSDocTypeReference */: + case 262 /* JSDocTypeReference */: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 262 /* JSDocOptionalType */: + case 263 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 263 /* JSDocFunctionType */: + case 264 /* JSDocFunctionType */: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 264 /* JSDocVariadicType */: + case 265 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 265 /* JSDocConstructorType */: + case 266 /* JSDocConstructorType */: return visitNode(cbNode, node.type); - case 266 /* JSDocThisType */: + case 267 /* JSDocThisType */: return visitNode(cbNode, node.type); - case 260 /* JSDocRecordMember */: + case 261 /* JSDocRecordMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 267 /* JSDocComment */: + case 268 /* JSDocComment */: return visitNodes(cbNodes, node.tags); - case 269 /* JSDocParameterTag */: + case 270 /* JSDocParameterTag */: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 270 /* JSDocReturnTag */: + case 271 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 271 /* JSDocTypeTag */: + case 272 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 272 /* JSDocTemplateTag */: + case 273 /* JSDocTemplateTag */: return visitNodes(cbNodes, node.typeParameters); } } @@ -7466,9 +7579,9 @@ var ts; // Add additional cases as necessary depending on how we see JSDoc comments used // in the wild. switch (node.kind) { - case 195 /* VariableStatement */: - case 215 /* FunctionDeclaration */: - case 138 /* Parameter */: + case 196 /* VariableStatement */: + case 216 /* FunctionDeclaration */: + case 139 /* Parameter */: addJSDocComment(node); } forEachChild(node, visit); @@ -7511,7 +7624,7 @@ var ts; function createSourceFile(fileName, languageVersion) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(250 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(251 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -7685,16 +7798,18 @@ var ts; } return result; } - // Invokes the provided callback then unconditionally restores the parser to the state it - // was in immediately prior to invoking the callback. The result of invoking the callback - // is returned from this function. + /** Invokes the provided callback then unconditionally restores the parser to the state it + * was in immediately prior to invoking the callback. The result of invoking the callback + * is returned from this function. + */ function lookAhead(callback) { return speculationHelper(callback, /*isLookAhead*/ true); } - // Invokes the provided callback. If the callback returns something falsy, then it restores - // the parser to the state it was in immediately prior to invoking the callback. If the - // callback returns something truthy, then the parser state is not rolled back. The result - // of invoking the callback is returned from this function. + /** Invokes the provided callback. If the callback returns something falsy, then it restores + * the parser to the state it was in immediately prior to invoking the callback. If the + * callback returns something truthy, then the parser state is not rolled back. The result + * of invoking the callback is returned from this function. + */ function tryParse(callback) { return speculationHelper(callback, /*isLookAhead*/ false); } @@ -7861,7 +7976,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(136 /* ComputedPropertyName */); + var node = createNode(137 /* ComputedPropertyName */); parseExpected(19 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -8262,14 +8377,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 144 /* Constructor */: - case 149 /* IndexSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 141 /* PropertyDeclaration */: - case 193 /* SemicolonClassElement */: + case 145 /* Constructor */: + case 150 /* IndexSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 194 /* SemicolonClassElement */: return true; - case 143 /* MethodDeclaration */: + case 144 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -8284,8 +8399,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: return true; } } @@ -8294,58 +8409,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: - case 195 /* VariableStatement */: - case 194 /* Block */: - case 198 /* IfStatement */: - case 197 /* ExpressionStatement */: - case 210 /* ThrowStatement */: - case 206 /* ReturnStatement */: - case 208 /* SwitchStatement */: - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 201 /* ForStatement */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 196 /* EmptyStatement */: - case 211 /* TryStatement */: - case 209 /* LabeledStatement */: - case 199 /* DoStatement */: - case 212 /* DebuggerStatement */: - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 230 /* ExportDeclaration */: - case 229 /* ExportAssignment */: - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 218 /* TypeAliasDeclaration */: + case 216 /* FunctionDeclaration */: + case 196 /* VariableStatement */: + case 195 /* Block */: + case 199 /* IfStatement */: + case 198 /* ExpressionStatement */: + case 211 /* ThrowStatement */: + case 207 /* ReturnStatement */: + case 209 /* SwitchStatement */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 202 /* ForStatement */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 197 /* EmptyStatement */: + case 212 /* TryStatement */: + case 210 /* LabeledStatement */: + case 200 /* DoStatement */: + case 213 /* DebuggerStatement */: + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 231 /* ExportDeclaration */: + case 230 /* ExportAssignment */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 219 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 249 /* EnumMember */; + return node.kind === 250 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 148 /* ConstructSignature */: - case 142 /* MethodSignature */: - case 149 /* IndexSignature */: - case 140 /* PropertySignature */: - case 147 /* CallSignature */: + case 149 /* ConstructSignature */: + case 143 /* MethodSignature */: + case 150 /* IndexSignature */: + case 141 /* PropertySignature */: + case 148 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 213 /* VariableDeclaration */) { + if (node.kind !== 214 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -8366,7 +8481,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 138 /* Parameter */) { + if (node.kind !== 139 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -8483,7 +8598,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(21 /* DotToken */)) { - var node = createNode(135 /* QualifiedName */, entity.pos); + var node = createNode(136 /* QualifiedName */, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -8522,7 +8637,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(185 /* TemplateExpression */); + var template = createNode(186 /* TemplateExpression */); template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; @@ -8535,7 +8650,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(192 /* TemplateSpan */); + var span = createNode(193 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token === 16 /* CloseBraceToken */) { @@ -8549,7 +8664,7 @@ var ts; return finishNode(span); } function parseStringLiteralTypeNode() { - return parseLiteralLikeNode(162 /* StringLiteralType */, /*internName*/ true); + return parseLiteralLikeNode(163 /* StringLiteralType */, /*internName*/ true); } function parseLiteralNode(internName) { return parseLiteralLikeNode(token, internName); @@ -8584,12 +8699,9 @@ var ts; return node; } // TYPES - function parseTypeReferenceOrTypePredicate() { + function parseTypeReference() { var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); - if (typeName.kind === 69 /* Identifier */ && token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { - return parseTypePredicate(typeName); - } - var node = createNode(151 /* TypeReference */, typeName.pos); + var node = createNode(152 /* TypeReference */, typeName.pos); node.typeName = typeName; if (!scanner.hasPrecedingLineBreak() && token === 25 /* LessThanToken */) { node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 25 /* LessThanToken */, 27 /* GreaterThanToken */); @@ -8598,24 +8710,24 @@ var ts; } function parseTypePredicate(lhs) { nextToken(); - var node = createNode(150 /* TypePredicate */, lhs.pos); + var node = createNode(151 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(161 /* ThisType */); + var node = createNode(162 /* ThisType */); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(154 /* TypeQuery */); + var node = createNode(155 /* TypeQuery */); parseExpected(101 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(137 /* TypeParameter */); + var node = createNode(138 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(83 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -8659,7 +8771,7 @@ var ts; } } function parseParameter() { - var node = createNode(138 /* Parameter */); + var node = createNode(139 /* Parameter */); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(22 /* DotDotDotToken */); @@ -8702,10 +8814,10 @@ var ts; signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList); if (returnTokenRequired) { parseExpected(returnToken); - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } else if (parseOptional(returnToken)) { - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } } function parseParameterList(yieldContext, awaitContext, requireCompleteParameterList) { @@ -8753,7 +8865,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 148 /* ConstructSignature */) { + if (kind === 149 /* ConstructSignature */) { parseExpected(92 /* NewKeyword */); } fillSignature(54 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -8817,7 +8929,7 @@ var ts; return token === 54 /* ColonToken */ || token === 24 /* CommaToken */ || token === 20 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(149 /* IndexSignature */, fullStart); + var node = createNode(150 /* IndexSignature */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 19 /* OpenBracketToken */, 20 /* CloseBracketToken */); @@ -8830,7 +8942,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(53 /* QuestionToken */); if (token === 17 /* OpenParenToken */ || token === 25 /* LessThanToken */) { - var method = createNode(142 /* MethodSignature */, fullStart); + var method = createNode(143 /* MethodSignature */, fullStart); method.name = name; method.questionToken = questionToken; // Method signatues don't exist in expression contexts. So they have neither @@ -8840,7 +8952,7 @@ var ts; return finishNode(method); } else { - var property = createNode(140 /* PropertySignature */, fullStart); + var property = createNode(141 /* PropertySignature */, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -8888,7 +9000,7 @@ var ts; switch (token) { case 17 /* OpenParenToken */: case 25 /* LessThanToken */: - return parseSignatureMember(147 /* CallSignature */); + return parseSignatureMember(148 /* CallSignature */); case 19 /* OpenBracketToken */: // Indexer or computed property return isIndexSignature() @@ -8896,7 +9008,7 @@ var ts; : parsePropertyOrMethodSignature(); case 92 /* NewKeyword */: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(148 /* ConstructSignature */); + return parseSignatureMember(149 /* ConstructSignature */); } // fall through. case 9 /* StringLiteral */: @@ -8933,7 +9045,7 @@ var ts; return token === 17 /* OpenParenToken */ || token === 25 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(155 /* TypeLiteral */); + var node = createNode(156 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -8949,12 +9061,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(157 /* TupleType */); + var node = createNode(158 /* TupleType */); node.elementTypes = parseBracketedList(19 /* TupleElementTypes */, parseType, 19 /* OpenBracketToken */, 20 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(160 /* ParenthesizedType */); + var node = createNode(161 /* ParenthesizedType */); parseExpected(17 /* OpenParenToken */); node.type = parseType(); parseExpected(18 /* CloseParenToken */); @@ -8962,7 +9074,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 153 /* ConstructorType */) { + if (kind === 154 /* ConstructorType */) { parseExpected(92 /* NewKeyword */); } fillSignature(34 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -8981,7 +9093,7 @@ var ts; case 131 /* SymbolKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReferenceOrTypePredicate(); + return node || parseTypeReference(); case 9 /* StringLiteral */: return parseStringLiteralTypeNode(); case 103 /* VoidKeyword */: @@ -9004,7 +9116,7 @@ var ts; case 17 /* OpenParenToken */: return parseParenthesizedType(); default: - return parseTypeReferenceOrTypePredicate(); + return parseTypeReference(); } } function isStartOfType() { @@ -9039,7 +9151,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(19 /* OpenBracketToken */)) { parseExpected(20 /* CloseBracketToken */); - var node = createNode(156 /* ArrayType */, type.pos); + var node = createNode(157 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -9061,10 +9173,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(159 /* IntersectionType */, parseArrayTypeOrHigher, 46 /* AmpersandToken */); + return parseUnionOrIntersectionType(160 /* IntersectionType */, parseArrayTypeOrHigher, 46 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(158 /* UnionType */, parseIntersectionTypeOrHigher, 47 /* BarToken */); + return parseUnionOrIntersectionType(159 /* UnionType */, parseIntersectionTypeOrHigher, 47 /* BarToken */); } function isStartOfFunctionType() { if (token === 25 /* LessThanToken */) { @@ -9101,6 +9213,26 @@ var ts; } return false; } + function parseTypeOrTypePredicate() { + var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); + var type = parseType(); + if (typePredicateVariable) { + var node = createNode(151 /* TypePredicate */, typePredicateVariable.pos); + node.parameterName = typePredicateVariable; + node.type = type; + return finishNode(node); + } + else { + return type; + } + } + function parseTypePredicatePrefix() { + var id = parseIdentifier(); + if (token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + nextToken(); + return id; + } + } function parseType() { // The rules about 'yield' only apply to actual code/expression contexts. They don't // apply to 'type' contexts. So we disable these parameters here before moving on. @@ -9108,10 +9240,10 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(152 /* FunctionType */); + return parseFunctionOrConstructorType(153 /* FunctionType */); } if (token === 92 /* NewKeyword */) { - return parseFunctionOrConstructorType(153 /* ConstructorType */); + return parseFunctionOrConstructorType(154 /* ConstructorType */); } return parseUnionTypeOrHigher(); } @@ -9304,7 +9436,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(186 /* YieldExpression */); + var node = createNode(187 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -9324,8 +9456,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(176 /* ArrowFunction */, identifier.pos); - var parameter = createNode(138 /* Parameter */, identifier.pos); + var node = createNode(177 /* ArrowFunction */, identifier.pos); + var parameter = createNode(139 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -9477,7 +9609,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(/*allowAmbiguity*/ false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(176 /* ArrowFunction */); + var node = createNode(177 /* ArrowFunction */); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256 /* Async */); // Arrow functions are never generators. @@ -9543,7 +9675,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(184 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(185 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -9556,7 +9688,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 90 /* InKeyword */ || t === 134 /* OfKeyword */; + return t === 90 /* InKeyword */ || t === 135 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -9664,39 +9796,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(183 /* BinaryExpression */, left.pos); + var node = createNode(184 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(191 /* AsExpression */, left.pos); + var node = createNode(192 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(181 /* PrefixUnaryExpression */); + var node = createNode(182 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(177 /* DeleteExpression */); + var node = createNode(178 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(178 /* TypeOfExpression */); + var node = createNode(179 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(179 /* VoidExpression */); + var node = createNode(180 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9712,7 +9844,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(180 /* AwaitExpression */); + var node = createNode(181 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9738,7 +9870,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 173 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 174 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -9828,7 +9960,7 @@ var ts; */ function parseIncrementExpression() { if (token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) { - var node = createNode(181 /* PrefixUnaryExpression */); + var node = createNode(182 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -9841,7 +9973,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(182 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(183 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -9945,7 +10077,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(168 /* PropertyAccessExpression */, expression.pos); + var node = createNode(169 /* PropertyAccessExpression */, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -9964,8 +10096,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 237 /* JsxOpeningElement */) { - var node = createNode(235 /* JsxElement */, opening.pos); + if (opening.kind === 238 /* JsxOpeningElement */) { + var node = createNode(236 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -9975,7 +10107,7 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 236 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 237 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -9990,7 +10122,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(183 /* BinaryExpression */, result.pos); + var badNode = createNode(184 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -10002,13 +10134,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(238 /* JsxText */, scanner.getStartPos()); + var node = createNode(239 /* JsxText */, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 238 /* JsxText */: + case 239 /* JsxText */: return parseJsxText(); case 15 /* OpenBraceToken */: return parseJsxExpression(/*inExpressionContext*/ false); @@ -10050,7 +10182,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(237 /* JsxOpeningElement */, fullStart); + node = createNode(238 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -10062,7 +10194,7 @@ var ts; parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(236 /* JsxSelfClosingElement */, fullStart); + node = createNode(237 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -10073,7 +10205,7 @@ var ts; var elementName = parseIdentifierName(); while (parseOptional(21 /* DotToken */)) { scanJsxIdentifier(); - var node = createNode(135 /* QualifiedName */, elementName.pos); + var node = createNode(136 /* QualifiedName */, elementName.pos); node.left = elementName; node.right = parseIdentifierName(); elementName = finishNode(node); @@ -10081,7 +10213,7 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(242 /* JsxExpression */); + var node = createNode(243 /* JsxExpression */); parseExpected(15 /* OpenBraceToken */); if (token !== 16 /* CloseBraceToken */) { node.expression = parseAssignmentExpressionOrHigher(); @@ -10100,7 +10232,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(240 /* JsxAttribute */); + var node = createNode(241 /* JsxAttribute */); node.name = parseIdentifierName(); if (parseOptional(56 /* EqualsToken */)) { switch (token) { @@ -10115,7 +10247,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(241 /* JsxSpreadAttribute */); + var node = createNode(242 /* JsxSpreadAttribute */); parseExpected(15 /* OpenBraceToken */); parseExpected(22 /* DotDotDotToken */); node.expression = parseExpression(); @@ -10123,7 +10255,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(239 /* JsxClosingElement */); + var node = createNode(240 /* JsxClosingElement */); parseExpected(26 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -10136,7 +10268,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(173 /* TypeAssertionExpression */); + var node = createNode(174 /* TypeAssertionExpression */); parseExpected(25 /* LessThanToken */); node.type = parseType(); parseExpected(27 /* GreaterThanToken */); @@ -10147,7 +10279,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(168 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(169 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -10156,7 +10288,7 @@ var ts; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(19 /* OpenBracketToken */)) { - var indexedAccess = createNode(169 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(170 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -10172,7 +10304,7 @@ var ts; continue; } if (token === 11 /* NoSubstitutionTemplateLiteral */ || token === 12 /* TemplateHead */) { - var tagExpression = createNode(172 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(173 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -10195,7 +10327,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(170 /* CallExpression */, expression.pos); + var callExpr = createNode(171 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -10203,7 +10335,7 @@ var ts; continue; } else if (token === 17 /* OpenParenToken */) { - var callExpr = createNode(170 /* CallExpression */, expression.pos); + var callExpr = createNode(171 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -10313,28 +10445,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(174 /* ParenthesizedExpression */); + var node = createNode(175 /* ParenthesizedExpression */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(187 /* SpreadElementExpression */); + var node = createNode(188 /* SpreadElementExpression */); parseExpected(22 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 /* DotDotDotToken */ ? parseSpreadElement() : - token === 24 /* CommaToken */ ? createNode(189 /* OmittedExpression */) : + token === 24 /* CommaToken */ ? createNode(190 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(166 /* ArrayLiteralExpression */); + var node = createNode(167 /* ArrayLiteralExpression */); parseExpected(19 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024 /* MultiLine */; @@ -10344,10 +10476,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(123 /* GetKeyword */)) { - return parseAccessorDeclaration(145 /* GetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(146 /* GetAccessor */, fullStart, decorators, modifiers); } else if (parseContextualModifier(129 /* SetKeyword */)) { - return parseAccessorDeclaration(146 /* SetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(147 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -10374,7 +10506,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 /* CommaToken */ || token === 16 /* CloseBraceToken */ || token === 56 /* EqualsToken */); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(248 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(249 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56 /* EqualsToken */); @@ -10385,7 +10517,7 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(247 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(248 /* PropertyAssignment */, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -10395,7 +10527,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(167 /* ObjectLiteralExpression */); + var node = createNode(168 /* ObjectLiteralExpression */); parseExpected(15 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024 /* MultiLine */; @@ -10414,7 +10546,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNode(175 /* FunctionExpression */); + var node = createNode(176 /* FunctionExpression */); setModifiers(node, parseModifiers()); parseExpected(87 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(37 /* AsteriskToken */); @@ -10436,7 +10568,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(171 /* NewExpression */); + var node = createNode(172 /* NewExpression */); parseExpected(92 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -10447,7 +10579,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(194 /* Block */); + var node = createNode(195 /* Block */); if (parseExpected(15 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -10477,12 +10609,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(196 /* EmptyStatement */); + var node = createNode(197 /* EmptyStatement */); parseExpected(23 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(198 /* IfStatement */); + var node = createNode(199 /* IfStatement */); parseExpected(88 /* IfKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10492,7 +10624,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(199 /* DoStatement */); + var node = createNode(200 /* DoStatement */); parseExpected(79 /* DoKeyword */); node.statement = parseStatement(); parseExpected(104 /* WhileKeyword */); @@ -10507,7 +10639,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(200 /* WhileStatement */); + var node = createNode(201 /* WhileStatement */); parseExpected(104 /* WhileKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10530,21 +10662,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90 /* InKeyword */)) { - var forInStatement = createNode(202 /* ForInStatement */, pos); + var forInStatement = createNode(203 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(134 /* OfKeyword */)) { - var forOfStatement = createNode(203 /* ForOfStatement */, pos); + else if (parseOptional(135 /* OfKeyword */)) { + var forOfStatement = createNode(204 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(201 /* ForStatement */, pos); + var forStatement = createNode(202 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(23 /* SemicolonToken */); if (token !== 23 /* SemicolonToken */ && token !== 18 /* CloseParenToken */) { @@ -10562,7 +10694,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); + parseExpected(kind === 206 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -10570,7 +10702,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(206 /* ReturnStatement */); + var node = createNode(207 /* ReturnStatement */); parseExpected(94 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -10579,7 +10711,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(207 /* WithStatement */); + var node = createNode(208 /* WithStatement */); parseExpected(105 /* WithKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10588,7 +10720,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(243 /* CaseClause */); + var node = createNode(244 /* CaseClause */); parseExpected(71 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(54 /* ColonToken */); @@ -10596,7 +10728,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(244 /* DefaultClause */); + var node = createNode(245 /* DefaultClause */); parseExpected(77 /* DefaultKeyword */); parseExpected(54 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -10606,12 +10738,12 @@ var ts; return token === 71 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(208 /* SwitchStatement */); + var node = createNode(209 /* SwitchStatement */); parseExpected(96 /* SwitchKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); - var caseBlock = createNode(222 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(223 /* CaseBlock */, scanner.getStartPos()); parseExpected(15 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(16 /* CloseBraceToken */); @@ -10626,7 +10758,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(210 /* ThrowStatement */); + var node = createNode(211 /* ThrowStatement */); parseExpected(98 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -10634,7 +10766,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(211 /* TryStatement */); + var node = createNode(212 /* TryStatement */); parseExpected(100 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token === 72 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -10647,7 +10779,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(246 /* CatchClause */); + var result = createNode(247 /* CatchClause */); parseExpected(72 /* CatchKeyword */); if (parseExpected(17 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -10657,7 +10789,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(212 /* DebuggerStatement */); + var node = createNode(213 /* DebuggerStatement */); parseExpected(76 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -10669,13 +10801,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 /* Identifier */ && parseOptional(54 /* ColonToken */)) { - var labeledStatement = createNode(209 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(210 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(197 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(198 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -10742,6 +10874,8 @@ var ts; return false; } continue; + case 134 /* GlobalKeyword */: + return nextToken() === 15 /* OpenBraceToken */; case 89 /* ImportKeyword */: nextToken(); return token === 9 /* StringLiteral */ || token === 37 /* AsteriskToken */ || @@ -10801,6 +10935,7 @@ var ts; case 125 /* ModuleKeyword */: case 126 /* NamespaceKeyword */: case 132 /* TypeKeyword */: + case 134 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 112 /* PublicKeyword */: @@ -10849,9 +10984,9 @@ var ts; case 86 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 75 /* ContinueKeyword */: - return parseBreakOrContinueStatement(204 /* ContinueStatement */); + return parseBreakOrContinueStatement(205 /* ContinueStatement */); case 70 /* BreakKeyword */: - return parseBreakOrContinueStatement(205 /* BreakStatement */); + return parseBreakOrContinueStatement(206 /* BreakStatement */); case 94 /* ReturnKeyword */: return parseReturnStatement(); case 105 /* WithKeyword */: @@ -10884,6 +11019,7 @@ var ts; case 112 /* PublicKeyword */: case 115 /* AbstractKeyword */: case 113 /* StaticKeyword */: + case 134 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -10910,6 +11046,7 @@ var ts; return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 81 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); + case 134 /* GlobalKeyword */: case 125 /* ModuleKeyword */: case 126 /* NamespaceKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -10924,7 +11061,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(233 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(234 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -10946,16 +11083,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token === 24 /* CommaToken */) { - return createNode(189 /* OmittedExpression */); + return createNode(190 /* OmittedExpression */); } - var node = createNode(165 /* BindingElement */); + var node = createNode(166 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(22 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(/*inParameter*/ false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(165 /* BindingElement */); + var node = createNode(166 /* BindingElement */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54 /* ColonToken */) { @@ -10970,14 +11107,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(163 /* ObjectBindingPattern */); + var node = createNode(164 /* ObjectBindingPattern */); parseExpected(15 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(16 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(164 /* ArrayBindingPattern */); + var node = createNode(165 /* ArrayBindingPattern */); parseExpected(19 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(20 /* CloseBracketToken */); @@ -10996,7 +11133,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(213 /* VariableDeclaration */); + var node = createNode(214 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -11005,7 +11142,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(214 /* VariableDeclarationList */); + var node = createNode(215 /* VariableDeclarationList */); switch (token) { case 102 /* VarKeyword */: break; @@ -11028,7 +11165,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token === 134 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token === 135 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -11043,7 +11180,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(195 /* VariableStatement */, fullStart); + var node = createNode(196 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); @@ -11051,7 +11188,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215 /* FunctionDeclaration */, fullStart); + var node = createNode(216 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87 /* FunctionKeyword */); @@ -11064,7 +11201,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(144 /* Constructor */, pos); + var node = createNode(145 /* Constructor */, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(121 /* ConstructorKeyword */); @@ -11073,7 +11210,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(143 /* MethodDeclaration */, fullStart); + var method = createNode(144 /* MethodDeclaration */, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -11086,7 +11223,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(141 /* PropertyDeclaration */, fullStart); + var property = createNode(142 /* PropertyDeclaration */, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -11212,7 +11349,7 @@ var ts; decorators = []; decorators.pos = decoratorStart; } - var decorator = createNode(139 /* Decorator */, decoratorStart); + var decorator = createNode(140 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -11277,7 +11414,7 @@ var ts; } function parseClassElement() { if (token === 23 /* SemicolonToken */) { - var result = createNode(193 /* SemicolonClassElement */); + var result = createNode(194 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -11315,10 +11452,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart*/ scanner.getStartPos(), /*decorators*/ undefined, - /*modifiers*/ undefined, 188 /* ClassExpression */); + /*modifiers*/ undefined, 189 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 217 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -11362,7 +11499,7 @@ var ts; } function parseHeritageClause() { if (token === 83 /* ExtendsKeyword */ || token === 106 /* ImplementsKeyword */) { - var node = createNode(245 /* HeritageClause */); + var node = createNode(246 /* HeritageClause */); node.token = token; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -11371,7 +11508,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(190 /* ExpressionWithTypeArguments */); + var node = createNode(191 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25 /* LessThanToken */) { node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 25 /* LessThanToken */, 27 /* GreaterThanToken */); @@ -11385,7 +11522,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217 /* InterfaceDeclaration */, fullStart); + var node = createNode(218 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107 /* InterfaceKeyword */); @@ -11396,7 +11533,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218 /* TypeAliasDeclaration */, fullStart); + var node = createNode(219 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132 /* TypeKeyword */); @@ -11412,13 +11549,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(249 /* EnumMember */, scanner.getStartPos()); + var node = createNode(250 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(219 /* EnumDeclaration */, fullStart); + var node = createNode(220 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81 /* EnumKeyword */); @@ -11433,7 +11570,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(221 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(222 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(15 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -11444,7 +11581,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(220 /* ModuleDeclaration */, fullStart); + var node = createNode(221 /* ModuleDeclaration */, fullStart); // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 65536 /* Namespace */; @@ -11458,16 +11595,27 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(220 /* ModuleDeclaration */, fullStart); + var node = createNode(221 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - node.name = parseLiteralNode(/*internName*/ true); + if (token === 134 /* GlobalKeyword */) { + // parse 'global' as name of global scope augmentation + node.name = parseIdentifier(); + node.flags |= 2097152 /* GlobalAugmentation */; + } + else { + node.name = parseLiteralNode(/*internName*/ true); + } node.body = parseModuleBlock(); return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = modifiers ? modifiers.flags : 0; - if (parseOptional(126 /* NamespaceKeyword */)) { + if (token === 134 /* GlobalKeyword */) { + // global augmentation + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + else if (parseOptional(126 /* NamespaceKeyword */)) { flags |= 65536 /* Namespace */; } else { @@ -11498,7 +11646,7 @@ var ts; // ImportEquals declaration of type: // import x = require("mod"); or // import x = M.x; - var importEqualsDeclaration = createNode(223 /* ImportEqualsDeclaration */, fullStart); + var importEqualsDeclaration = createNode(224 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -11509,7 +11657,7 @@ var ts; } } // Import statement - var importDeclaration = createNode(224 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(225 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); // ImportDeclaration: @@ -11532,7 +11680,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(225 /* ImportClause */, fullStart); + var importClause = createNode(226 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -11542,7 +11690,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(24 /* CommaToken */)) { - importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(227 /* NamedImports */); + importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(228 /* NamedImports */); } return finishNode(importClause); } @@ -11552,7 +11700,7 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(234 /* ExternalModuleReference */); + var node = createNode(235 /* ExternalModuleReference */); parseExpected(127 /* RequireKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = parseModuleSpecifier(); @@ -11575,7 +11723,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(226 /* NamespaceImport */); + var namespaceImport = createNode(227 /* NamespaceImport */); parseExpected(37 /* AsteriskToken */); parseExpected(116 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -11590,14 +11738,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 227 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); + node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 228 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(232 /* ExportSpecifier */); + return parseImportOrExportSpecifier(233 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(228 /* ImportSpecifier */); + return parseImportOrExportSpecifier(229 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -11622,14 +11770,14 @@ var ts; else { node.name = identifierName; } - if (kind === 228 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 229 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230 /* ExportDeclaration */, fullStart); + var node = createNode(231 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37 /* AsteriskToken */)) { @@ -11637,7 +11785,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(231 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(232 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. @@ -11650,7 +11798,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(229 /* ExportAssignment */, fullStart); + var node = createNode(230 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56 /* EqualsToken */)) { @@ -11725,10 +11873,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 /* Export */ - || node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */ - || node.kind === 224 /* ImportDeclaration */ - || node.kind === 229 /* ExportAssignment */ - || node.kind === 230 /* ExportDeclaration */ + || node.kind === 224 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 235 /* ExternalModuleReference */ + || node.kind === 225 /* ImportDeclaration */ + || node.kind === 230 /* ExportAssignment */ + || node.kind === 231 /* ExportDeclaration */ ? node : undefined; }); @@ -11803,7 +11951,7 @@ var ts; scanner.setText(sourceText, start, length); // Prime the first token for us to start processing. token = nextToken(); - var result = createNode(251 /* JSDocTypeExpression */); + var result = createNode(252 /* JSDocTypeExpression */); parseExpected(15 /* OpenBraceToken */); result.type = parseJSDocTopLevelType(); parseExpected(16 /* CloseBraceToken */); @@ -11814,12 +11962,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47 /* BarToken */) { - var unionType = createNode(255 /* JSDocUnionType */, type.pos); + var unionType = createNode(256 /* JSDocUnionType */, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56 /* EqualsToken */) { - var optionalType = createNode(262 /* JSDocOptionalType */, type.pos); + var optionalType = createNode(263 /* JSDocOptionalType */, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -11830,20 +11978,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19 /* OpenBracketToken */) { - var arrayType = createNode(254 /* JSDocArrayType */, type.pos); + var arrayType = createNode(255 /* JSDocArrayType */, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20 /* CloseBracketToken */); type = finishNode(arrayType); } else if (token === 53 /* QuestionToken */) { - var nullableType = createNode(257 /* JSDocNullableType */, type.pos); + var nullableType = createNode(258 /* JSDocNullableType */, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49 /* ExclamationToken */) { - var nonNullableType = createNode(258 /* JSDocNonNullableType */, type.pos); + var nonNullableType = createNode(259 /* JSDocNonNullableType */, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -11888,27 +12036,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(266 /* JSDocThisType */); + var result = createNode(267 /* JSDocThisType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(265 /* JSDocConstructorType */); + var result = createNode(266 /* JSDocConstructorType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(264 /* JSDocVariadicType */); + var result = createNode(265 /* JSDocVariadicType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(263 /* JSDocFunctionType */); + var result = createNode(264 /* JSDocFunctionType */); nextToken(); parseExpected(17 /* OpenParenToken */); result.parameters = parseDelimitedList(22 /* JSDocFunctionParameters */, parseJSDocParameter); @@ -11921,12 +12069,12 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(138 /* Parameter */); + var parameter = createNode(139 /* Parameter */); parameter.type = parseJSDocType(); return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(261 /* JSDocTypeReference */); + var result = createNode(262 /* JSDocTypeReference */); result.name = parseSimplePropertyName(); while (parseOptional(21 /* DotToken */)) { if (token === 25 /* LessThanToken */) { @@ -11956,13 +12104,13 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(135 /* QualifiedName */, left.pos); + var result = createNode(136 /* QualifiedName */, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(259 /* JSDocRecordType */); + var result = createNode(260 /* JSDocRecordType */); nextToken(); result.members = parseDelimitedList(24 /* JSDocRecordMembers */, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -11970,7 +12118,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(260 /* JSDocRecordMember */); + var result = createNode(261 /* JSDocRecordMember */); result.name = parseSimplePropertyName(); if (token === 54 /* ColonToken */) { nextToken(); @@ -11979,13 +12127,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(258 /* JSDocNonNullableType */); + var result = createNode(259 /* JSDocNonNullableType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(256 /* JSDocTupleType */); + var result = createNode(257 /* JSDocTupleType */); nextToken(); result.types = parseDelimitedList(25 /* JSDocTupleTypes */, parseJSDocType); checkForTrailingComma(result.types); @@ -11999,7 +12147,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(255 /* JSDocUnionType */); + var result = createNode(256 /* JSDocUnionType */); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18 /* CloseParenToken */); @@ -12017,7 +12165,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(252 /* JSDocAllType */); + var result = createNode(253 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -12040,11 +12188,11 @@ var ts; token === 27 /* GreaterThanToken */ || token === 56 /* EqualsToken */ || token === 47 /* BarToken */) { - var result = createNode(253 /* JSDocUnknownType */, pos); + var result = createNode(254 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(257 /* JSDocNullableType */, pos); + var result = createNode(258 /* JSDocNullableType */, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -12132,7 +12280,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(267 /* JSDocComment */, start); + var result = createNode(268 /* JSDocComment */, start); result.tags = tags; return finishNode(result, end); } @@ -12169,7 +12317,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(268 /* JSDocTag */, atToken.pos); + var result = createNode(269 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -12220,7 +12368,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(269 /* JSDocParameterTag */, atToken.pos); + var result = createNode(270 /* JSDocParameterTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -12230,27 +12378,27 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 271 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(270 /* JSDocReturnTag */, atToken.pos); + var result = createNode(271 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 271 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 272 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(271 /* JSDocTypeTag */, atToken.pos); + var result = createNode(272 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 272 /* JSDocTemplateTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 273 /* JSDocTemplateTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = []; @@ -12263,7 +12411,7 @@ var ts; parseErrorAtPosition(startPos, 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(137 /* TypeParameter */, name_8.pos); + var typeParameter = createNode(138 /* TypeParameter */, name_8.pos); typeParameter.name = name_8; finishNode(typeParameter, pos); typeParameters.push(typeParameter); @@ -12274,7 +12422,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(272 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(273 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -12804,16 +12952,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 218 /* TypeAliasDeclaration */) { + if (node.kind === 218 /* InterfaceDeclaration */ || node.kind === 219 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { + else if ((node.kind === 225 /* ImportDeclaration */ || node.kind === 224 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 221 /* ModuleBlock */) { + else if (node.kind === 222 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -12832,7 +12980,7 @@ var ts; }); return state; } - else if (node.kind === 220 /* ModuleDeclaration */) { + else if (node.kind === 221 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -12882,6 +13030,11 @@ var ts; var labelStack; var labelIndexMap; var implicitLabels; + // state used for emit helpers + var hasClassExtends; + var hasAsyncFunctions; + var hasDecorators; + var hasParameterDecorators; // If this file is an external module, then it is automatically in strict-mode according to // ES6. If it is not an external module, then we'll determine if it is in strict mode or // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). @@ -12911,6 +13064,10 @@ var ts; labelStack = undefined; labelIndexMap = undefined; implicitLabels = undefined; + hasClassExtends = false; + hasAsyncFunctions = false; + hasDecorators = false; + hasParameterDecorators = false; } return bindSourceFile; function createSymbol(flags, name) { @@ -12933,7 +13090,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 221 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -12943,10 +13100,10 @@ var ts; // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 220 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { - return "\"" + node.name.text + "\""; + if (ts.isAmbientModule(node)) { + return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression.kind)) { @@ -12958,21 +13115,21 @@ var ts; return node.name.text; } switch (node.kind) { - case 144 /* Constructor */: + case 145 /* Constructor */: return "__constructor"; - case 152 /* FunctionType */: - case 147 /* CallSignature */: + case 153 /* FunctionType */: + case 148 /* CallSignature */: return "__call"; - case 153 /* ConstructorType */: - case 148 /* ConstructSignature */: + case 154 /* ConstructorType */: + case 149 /* ConstructSignature */: return "__new"; - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: return "__index"; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return "__export"; - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2 /* ModuleExports */: // module.exports = ... @@ -12987,8 +13144,8 @@ var ts; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 215 /* FunctionDeclaration */: - case 216 /* ClassDeclaration */: + case 216 /* FunctionDeclaration */: + case 217 /* ClassDeclaration */: return node.flags & 512 /* Default */ ? "default" : undefined; } } @@ -13065,7 +13222,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 232 /* ExportSpecifier */ || (node.kind === 223 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 233 /* ExportSpecifier */ || (node.kind === 224 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -13084,7 +13241,11 @@ var ts; // 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol, // but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way // when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope. - if (hasExportModifier || container.flags & 131072 /* ExportContext */) { + // NOTE: Nested ambient modules always should go to to 'locals' table to prevent their automatic merge + // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation + // and this case is specially handled. Module augmentations should only be merged with original module definition + // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. + if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 131072 /* ExportContext */)) { var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | (symbolFlags & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | (symbolFlags & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); @@ -13148,10 +13309,12 @@ var ts; var flags = node.flags; // reset all reachability check related flags on node (for incremental scenarios) flags &= ~1572864 /* ReachabilityCheckFlags */; - if (kind === 217 /* InterfaceDeclaration */) { + // reset all emit helper flags on node (for incremental scenarios) + flags &= ~62914560 /* EmitHelperFlags */; + if (kind === 218 /* InterfaceDeclaration */) { seenThisKeyword = false; } - var saveState = kind === 250 /* SourceFile */ || kind === 221 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); + var saveState = kind === 251 /* SourceFile */ || kind === 222 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -13169,9 +13332,23 @@ var ts; flags |= 1048576 /* HasExplicitReturn */; } } - if (kind === 217 /* InterfaceDeclaration */) { + if (kind === 218 /* InterfaceDeclaration */) { flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; } + if (kind === 251 /* SourceFile */) { + if (hasClassExtends) { + flags |= 4194304 /* HasClassExtends */; + } + if (hasDecorators) { + flags |= 8388608 /* HasDecorators */; + } + if (hasParameterDecorators) { + flags |= 16777216 /* HasParamDecorators */; + } + if (hasAsyncFunctions) { + flags |= 33554432 /* HasAsyncFunctions */; + } + } node.flags = flags; if (saveState) { hasExplicitReturn = savedHasExplicitReturn; @@ -13194,40 +13371,40 @@ var ts; return; } switch (node.kind) { - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: bindWhileStatement(node); break; - case 199 /* DoStatement */: + case 200 /* DoStatement */: bindDoStatement(node); break; - case 201 /* ForStatement */: + case 202 /* ForStatement */: bindForStatement(node); break; - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 198 /* IfStatement */: + case 199 /* IfStatement */: bindIfStatement(node); break; - case 206 /* ReturnStatement */: - case 210 /* ThrowStatement */: + case 207 /* ReturnStatement */: + case 211 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 211 /* TryStatement */: + case 212 /* TryStatement */: bindTryStatement(node); break; - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: bindSwitchStatement(node); break; - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: bindCaseBlock(node); break; - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: bindLabeledStatement(node); break; default: @@ -13302,7 +13479,7 @@ var ts; function bindReturnOrThrow(n) { // bind expression (don't affect reachability) bind(n.expression); - if (n.kind === 206 /* ReturnStatement */) { + if (n.kind === 207 /* ReturnStatement */) { hasExplicitReturn = true; } currentReachabilityState = 4 /* Unreachable */; @@ -13311,7 +13488,7 @@ var ts; // call bind on label (don't affect reachability) bind(n.label); // for continue case touch label so it will be marked a used - var isValidJump = jumpToLabel(n.label, n.kind === 205 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); + var isValidJump = jumpToLabel(n.label, n.kind === 206 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); if (isValidJump) { currentReachabilityState = 4 /* Unreachable */; } @@ -13337,7 +13514,7 @@ var ts; // bind expression (don't affect reachability) bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244 /* DefaultClause */; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 245 /* DefaultClause */; }); // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); @@ -13364,37 +13541,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 155 /* TypeLiteral */: - case 167 /* ObjectLiteralExpression */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 156 /* TypeLiteral */: + case 168 /* ObjectLiteralExpression */: return 1 /* IsContainer */; - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 215 /* FunctionDeclaration */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 220 /* ModuleDeclaration */: - case 250 /* SourceFile */: - case 218 /* TypeAliasDeclaration */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 221 /* ModuleDeclaration */: + case 251 /* SourceFile */: + case 219 /* TypeAliasDeclaration */: return 5 /* IsContainerWithLocals */; - case 246 /* CatchClause */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 222 /* CaseBlock */: + case 247 /* CatchClause */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 223 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 194 /* Block */: + case 195 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Othewise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -13431,38 +13608,38 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 155 /* TypeLiteral */: - case 167 /* ObjectLiteralExpression */: - case 217 /* InterfaceDeclaration */: + case 156 /* TypeLiteral */: + case 168 /* ObjectLiteralExpression */: + case 218 /* InterfaceDeclaration */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 218 /* TypeAliasDeclaration */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 219 /* TypeAliasDeclaration */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -13483,11 +13660,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 250 /* SourceFile */ ? node : node.body; - if (body.kind === 250 /* SourceFile */ || body.kind === 221 /* ModuleBlock */) { + var body = node.kind === 251 /* SourceFile */ ? node : node.body; + if (body.kind === 251 /* SourceFile */ || body.kind === 222 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 230 /* ExportDeclaration */ || stat.kind === 229 /* ExportAssignment */) { + if (stat.kind === 231 /* ExportDeclaration */ || stat.kind === 230 /* ExportAssignment */) { return true; } } @@ -13506,7 +13683,10 @@ var ts; } function bindModuleDeclaration(node) { setExportContextFlag(node); - if (node.name.kind === 9 /* StringLiteral */) { + if (ts.isAmbientModule(node)) { + if (node.flags & 2 /* Export */) { + errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); + } declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); } else { @@ -13571,7 +13751,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ + var currentKind = prop.kind === 248 /* PropertyAssignment */ || prop.kind === 249 /* ShorthandPropertyAssignment */ || prop.kind === 144 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen[identifier.text]; @@ -13593,10 +13773,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -13756,17 +13936,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 250 /* SourceFile */: - case 221 /* ModuleBlock */: + case 251 /* SourceFile */: + case 222 /* ModuleBlock */: updateStrictModeStatementList(node.statements); return; - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return; @@ -13796,7 +13976,7 @@ var ts; /* Strict mode checks */ case 69 /* Identifier */: return checkStrictModeIdentifier(node); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: if (ts.isInJavaScriptFile(node)) { var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { @@ -13820,100 +14000,97 @@ var ts; } } return checkStrictModeBinaryExpression(node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return checkStrictModeCatchClause(node); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return checkStrictModeWithStatement(node); - case 161 /* ThisType */: + case 162 /* ThisType */: seenThisKeyword = true; return; - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return checkTypePredicate(node); - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); - case 138 /* Parameter */: + case 139 /* Parameter */: return bindParameter(node); - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: return bindVariableDeclarationOrBindingElement(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); - case 247 /* PropertyAssignment */: - case 248 /* ShorthandPropertyAssignment */: + case 248 /* PropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 215 /* FunctionDeclaration */: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); - case 144 /* Constructor */: + case 216 /* FunctionDeclaration */: + return bindFunctionDeclaration(node); + case 145 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 145 /* GetAccessor */: + case 146 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 146 /* SetAccessor */: + case 147 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - checkStrictModeFunctionName(node); - var bindingName = node.name ? node.name.text : "__function"; - return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); - case 170 /* CallExpression */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + return bindFunctionExpression(node); + case 171 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: return bindClassLikeDeclaration(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Imports and exports - case 223 /* ImportEqualsDeclaration */: - case 226 /* NamespaceImport */: - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 227 /* NamespaceImport */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 225 /* ImportClause */: + case 226 /* ImportClause */: return bindImportClause(node); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return bindExportDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return bindExportAssignment(node); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return bindSourceFileIfExternalModule(); } } @@ -13922,7 +14099,7 @@ var ts; if (parameterName && parameterName.kind === 69 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 161 /* ThisType */) { + if (parameterName && parameterName.kind === 162 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -13937,7 +14114,7 @@ var ts; bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 229 /* ExportAssignment */ ? node.expression : node.right; + var boundExpression = node.kind === 230 /* ExportAssignment */ ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { // Export assignment in some sort of block construct bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); @@ -13985,7 +14162,7 @@ var ts; } function bindThisPropertyAssignment(node) { // Declare a 'member' in case it turns out the container was an ES5 class - if (container.kind === 175 /* FunctionExpression */ || container.kind === 215 /* FunctionDeclaration */) { + if (container.kind === 176 /* FunctionExpression */ || container.kind === 216 /* FunctionDeclaration */) { container.symbol.members = container.symbol.members || {}; declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } @@ -14014,7 +14191,15 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 216 /* ClassDeclaration */) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { + hasClassExtends = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } + if (node.kind === 217 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -14076,6 +14261,12 @@ var ts; } } function bindParameter(node) { + if (!ts.isDeclarationFile(file) && + !ts.isInAmbientContext(node) && + ts.nodeIsDecorated(node)) { + hasDecorators = true; + hasParameterDecorators = true; + } if (inStrictMode) { // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) @@ -14094,7 +14285,34 @@ var ts; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } } + function bindFunctionDeclaration(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); + } + function bindFunctionExpression(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.text : "__function"; + return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); + } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } return ts.hasDynamicName(node) ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); @@ -14159,13 +14377,13 @@ var ts; case 4 /* Unreachable */: var reportError = // report error on all statements except empty ones - (ts.isStatement(node) && node.kind !== 196 /* EmptyStatement */) || + (ts.isStatement(node) && node.kind !== 197 /* EmptyStatement */) || // report error on class declarations - node.kind === 216 /* ClassDeclaration */ || + node.kind === 217 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 220 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 221 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 219 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 220 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8 /* ReportedUnreachable */; // unreachable code is reported if @@ -14179,7 +14397,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 195 /* VariableStatement */ || + (node.kind !== 196 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -14264,6 +14482,7 @@ var ts; getTypeCount: function () { return typeCount; }, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, // The language service will always care about the narrowed type of a symbol, because that is @@ -14280,6 +14499,7 @@ var ts; getSymbolsInScope: getSymbolsInScope, getSymbolAtLocation: getSymbolAtLocation, getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, + getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, getTypeAtLocation: getTypeOfNode, typeToString: typeToString, getSymbolDisplayBuilder: getSymbolDisplayBuilder, @@ -14355,11 +14575,6 @@ var ts; var unionTypes = {}; var intersectionTypes = {}; var stringLiteralTypes = {}; - var emitExtends = false; - var emitDecorate = false; - var emitParam = false; - var emitAwaiter = false; - var emitGenerator = false; var resolutionTargets = []; var resolutionResults = []; var resolutionPropertyNames = []; @@ -14504,7 +14719,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 220 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 220 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 221 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 221 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -14559,6 +14774,30 @@ var ts; } } } + function mergeModuleAugmentation(moduleName) { + var moduleAugmentation = moduleName.parent; + if (moduleAugmentation.symbol.valueDeclaration !== moduleAugmentation) { + // this is a combined symbol for multiple augmentations within the same file. + // its symbol already has accumulated information for all declarations + // so we need to add it just once - do the work only for first declaration + ts.Debug.assert(moduleAugmentation.symbol.declarations.length > 1); + return; + } + if (ts.isGlobalScopeAugmentation(moduleAugmentation)) { + mergeSymbolTable(globals, moduleAugmentation.symbol.exports); + } + else { + // find a module that about to be augmented + var mainModule = resolveExternalModuleNameWorker(moduleName, moduleName, ts.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found); + if (!mainModule) { + return; + } + // if module symbol has already been merged - it is safe to use it. + // otherwise clone it + mainModule = mainModule.flags & 33554432 /* Merged */ ? mainModule : cloneSymbol(mainModule); + mergeSymbol(mainModule, moduleAugmentation.symbol); + } + } function addToSymbolTable(target, source, message) { for (var id in source) { if (ts.hasProperty(source, id)) { @@ -14585,18 +14824,8 @@ var ts; var nodeId = getNodeId(node); return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } - function getSourceFile(node) { - return ts.getAncestor(node, 250 /* SourceFile */); - } function isGlobalSourceFile(node) { - return node.kind === 250 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); - } - /** Is this type one of the apparent types created from the primitive types. */ - function isPrimitiveApparentType(type) { - return type === globalStringType || - type === globalNumberType || - type === globalBooleanType || - type === globalESSymbolType; + return node.kind === 251 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -14645,7 +14874,7 @@ var ts; if (declaration.pos <= usage.pos) { // declaration is before usage // still might be illegal if usage is in the initializer of the variable declaration - return declaration.kind !== 213 /* VariableDeclaration */ || + return declaration.kind !== 214 /* VariableDeclaration */ || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } // declaration is after usage @@ -14653,14 +14882,14 @@ var ts; return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 195 /* VariableStatement */ || - declaration.parent.parent.kind === 201 /* ForStatement */) { + if (declaration.parent.parent.kind === 196 /* VariableStatement */ || + declaration.parent.parent.kind === 202 /* ForStatement */) { // variable statement/for statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 203 /* ForOfStatement */ || - declaration.parent.parent.kind === 202 /* ForInStatement */) { + else if (declaration.parent.parent.kind === 204 /* ForOfStatement */ || + declaration.parent.parent.kind === 203 /* ForInStatement */) { // ForIn/ForOf case - use site should not be used in expression part var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); @@ -14677,7 +14906,7 @@ var ts; return true; } var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 141 /* PropertyDeclaration */ && + current.parent.kind === 142 /* PropertyDeclaration */ && (current.parent.flags & 64 /* Static */) === 0 && current.parent.initializer === current; if (initializerOfNonStaticProperty) { @@ -14710,8 +14939,8 @@ var ts; if (meaning & result.flags & 793056 /* Type */) { useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || - lastLocation.kind === 138 /* Parameter */ || - lastLocation.kind === 137 /* TypeParameter */ + lastLocation.kind === 139 /* Parameter */ || + lastLocation.kind === 138 /* TypeParameter */ : false; } if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { @@ -14720,9 +14949,9 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 138 /* Parameter */ || + lastLocation.kind === 139 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 138 /* Parameter */); + result.valueDeclaration.kind === 139 /* Parameter */); } } if (useResult) { @@ -14734,13 +14963,12 @@ var ts; } } switch (location.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 250 /* SourceFile */ || - (location.kind === 220 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { + if (location.kind === 251 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports["default"]) { @@ -14763,7 +14991,7 @@ var ts; // which is not the desired behavior. if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 /* Alias */ && - ts.getDeclarationOfKind(moduleExports[name], 232 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExports[name], 233 /* ExportSpecifier */)) { break; } } @@ -14771,13 +14999,13 @@ var ts; break loop; } break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -14794,9 +15022,9 @@ var ts; } } break; - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { if (lastLocation && lastLocation.flags & 64 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 @@ -14807,7 +15035,7 @@ var ts; } break loop; } - if (location.kind === 188 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 189 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -14823,9 +15051,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 217 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 218 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -14833,19 +15061,19 @@ var ts; } } break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 175 /* FunctionExpression */: + case 176 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -14858,7 +15086,7 @@ var ts; } } break; - case 139 /* Decorator */: + case 140 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -14867,7 +15095,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 138 /* Parameter */) { + if (location.parent && location.parent.kind === 139 /* Parameter */) { location = location.parent; } // @@ -14889,7 +15117,9 @@ var ts; } if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + if (!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg)) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + } } return undefined; } @@ -14922,12 +15152,44 @@ var ts; } return result; } + function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { + if (!errorLocation || (errorLocation.kind === 69 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + return false; + } + var container = ts.getThisContainer(errorLocation, /* includeArrowFunctions */ true); + var location = container; + while (location) { + if (ts.isClassLike(location.parent)) { + var classSymbol = getSymbolOfNode(location.parent); + if (!classSymbol) { + break; + } + // Check to see if a static member exists. + var constructorType = getTypeOfSymbol(classSymbol); + if (getPropertyOfType(constructorType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg), symbolToString(classSymbol)); + return true; + } + // No static member is present. + // Check if we're in an instance method and look for a relevant instance member. + if (location === container && !(location.flags & 64 /* Static */)) { + var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; + if (getPropertyOfType(instanceType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + return true; + } + } + } + location = location.parent; + } + return false; + } function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); // Block-scoped variables cannot be used before their definition var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213 /* VariableDeclaration */), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 214 /* VariableDeclaration */), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -14948,10 +15210,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 223 /* ImportEqualsDeclaration */) { + if (node.kind === 224 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 224 /* ImportDeclaration */) { + while (node && node.kind !== 225 /* ImportDeclaration */) { node = node.parent; } return node; @@ -14961,7 +15223,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 234 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 235 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -15063,17 +15325,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 225 /* ImportClause */: + case 226 /* ImportClause */: return getTargetOfImportClause(node); - case 226 /* NamespaceImport */: + case 227 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 228 /* ImportSpecifier */: + case 229 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 232 /* ExportSpecifier */: + case 233 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } @@ -15118,11 +15380,11 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 229 /* ExportAssignment */) { + if (node.kind === 230 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 232 /* ExportSpecifier */) { + else if (node.kind === 233 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -15135,7 +15397,7 @@ var ts; // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 223 /* ImportEqualsDeclaration */); + importDeclaration = ts.getAncestor(entityName, 224 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, @@ -15148,13 +15410,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 69 /* Identifier */ || entityName.parent.kind === 135 /* QualifiedName */) { + if (entityName.kind === 69 /* Identifier */ || entityName.parent.kind === 136 /* QualifiedName */) { return resolveEntityName(entityName, 1536 /* Namespace */); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 223 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 224 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } @@ -15174,9 +15436,9 @@ var ts; return undefined; } } - else if (name.kind === 135 /* QualifiedName */ || name.kind === 168 /* PropertyAccessExpression */) { - var left = name.kind === 135 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 135 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 136 /* QualifiedName */ || name.kind === 169 /* PropertyAccessExpression */) { + var left = name.kind === 136 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 136 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1536 /* Namespace */, ignoreErrors); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -15196,6 +15458,9 @@ var ts; return symbol.flags & meaning ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + } + function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError) { if (moduleReferenceExpression.kind !== 9 /* StringLiteral */) { return; } @@ -15210,19 +15475,28 @@ var ts; if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512 /* ValueModule */); if (symbol) { - return symbol; + // merged symbol is module declaration symbol combined with all augmentations + return getMergedSymbol(symbol); } } - var resolvedModule = ts.getResolvedModule(getSourceFile(location), moduleReferenceLiteral.text); + var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReferenceLiteral.text); var sourceFile = resolvedModule && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - return sourceFile.symbol; + // merged symbol is module declaration symbol combined with all augmentations + return getMergedSymbol(sourceFile.symbol); } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); - return; + if (moduleNotFoundError) { + // report errors only if it was requested + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + } + return undefined; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); + if (moduleNotFoundError) { + // report errors only if it was requested + error(moduleReferenceLiteral, moduleNotFoundError, moduleName); + } + return undefined; } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. @@ -15350,7 +15624,7 @@ var ts; var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 144 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 145 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -15421,17 +15695,17 @@ var ts; } } switch (location_1.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -15472,7 +15746,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233 /* ExportSpecifier */)) { if (!useOnlyExternalAliasing || // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { @@ -15509,7 +15783,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -15582,8 +15856,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 220 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || - (declaration.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 251 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -15619,12 +15892,12 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 154 /* TypeQuery */) { + if (entityName.parent.kind === 155 /* TypeQuery */) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 135 /* QualifiedName */ || entityName.kind === 168 /* PropertyAccessExpression */ || - entityName.parent.kind === 223 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 136 /* QualifiedName */ || entityName.kind === 169 /* PropertyAccessExpression */ || + entityName.parent.kind === 224 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1536 /* Namespace */; @@ -15679,15 +15952,20 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 160 /* ParenthesizedType */) { + while (node.kind === 161 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 218 /* TypeAliasDeclaration */) { + if (node.kind === 219 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } return undefined; } + function isTopLevelInExternalModuleAugmentation(node) { + return node && node.parent && + node.parent.kind === 222 /* ModuleBlock */ && + ts.isExternalModuleAugmentation(node.parent.parent); + } function getSymbolDisplayBuilder() { function getNameOfSymbol(symbol) { if (symbol.declarations && symbol.declarations.length) { @@ -15696,10 +15974,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return "(Anonymous class)"; - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return "(Anonymous function)"; } } @@ -15954,7 +16232,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 250 /* SourceFile */ || declaration.parent.kind === 221 /* ModuleBlock */; + return declaration.parent.kind === 251 /* SourceFile */ || declaration.parent.kind === 222 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -16215,70 +16493,74 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 165 /* BindingElement */: + case 166 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // Otherwise fall through - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 215 /* FunctionDeclaration */: - case 219 /* EnumDeclaration */: - case 223 /* ImportEqualsDeclaration */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 216 /* FunctionDeclaration */: + case 220 /* EnumDeclaration */: + case 224 /* ImportEqualsDeclaration */: + // external module augmentation is always visible + if (ts.isExternalModuleAugmentation(node)) { + return true; + } var parent_4 = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedNodeFlags(node) & 2 /* Export */) && - !(node.kind !== 223 /* ImportEqualsDeclaration */ && parent_4.kind !== 250 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 224 /* ImportEqualsDeclaration */ && parent_4.kind !== 251 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent_4); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.flags & (16 /* Private */ | 32 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so const it fall into next case statement - case 144 /* Constructor */: - case 148 /* ConstructSignature */: - case 147 /* CallSignature */: - case 149 /* IndexSignature */: - case 138 /* Parameter */: - case 221 /* ModuleBlock */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 155 /* TypeLiteral */: - case 151 /* TypeReference */: - case 156 /* ArrayType */: - case 157 /* TupleType */: - case 158 /* UnionType */: - case 159 /* IntersectionType */: - case 160 /* ParenthesizedType */: + case 145 /* Constructor */: + case 149 /* ConstructSignature */: + case 148 /* CallSignature */: + case 150 /* IndexSignature */: + case 139 /* Parameter */: + case 222 /* ModuleBlock */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 156 /* TypeLiteral */: + case 152 /* TypeReference */: + case 157 /* ArrayType */: + case 158 /* TupleType */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: + case 161 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: - case 228 /* ImportSpecifier */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: + case 229 /* ImportSpecifier */: return false; // Type parameters are always visible - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: // Source file is always visible - case 250 /* SourceFile */: + case 251 /* SourceFile */: return true; // Export assignments do not create name bindings outside the module - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -16287,10 +16569,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 229 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 230 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 232 /* ExportSpecifier */) { + else if (node.parent.kind === 233 /* ExportSpecifier */) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -16313,7 +16595,9 @@ var ts; var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); - buildVisibleNodeList(importSymbol.declarations); + if (importSymbol) { + buildVisibleNodeList(importSymbol.declarations); + } } }); } @@ -16382,14 +16666,14 @@ var ts; node = ts.getRootDeclaration(node); // Parent chain: // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' - return node.kind === 213 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; + return node.kind === 214 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 // Every class automatically contains a static property member named 'prototype', // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. // It is an error to explicitly declare a static property member with the name 'prototype'. - var classType = getDeclaredTypeOfSymbol(prototype.parent); + var classType = getDeclaredTypeOfSymbol(getMergedSymbol(prototype.parent)); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } // Return the type of the given property in the given type, or undefined if no such property exists @@ -16413,7 +16697,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return name.text; - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: if (ts.isStringOrNumericLiteral(name.expression.kind)) { return name.expression.text; } @@ -16421,7 +16705,7 @@ var ts; return undefined; } function isComputedNonLiteralName(name) { - return name.kind === 136 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression.kind); + return name.kind === 137 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression.kind); } // Return the inferred type for a binding element function getTypeForBindingElement(declaration) { @@ -16441,7 +16725,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 163 /* ObjectBindingPattern */) { + if (pattern.kind === 164 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_10 = declaration.propertyName || declaration.name; if (isComputedNonLiteralName(name_10)) { @@ -16489,11 +16773,11 @@ var ts; } // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration) { - // A variable declared in a for..in statement is always of type any - if (declaration.parent.parent.kind === 202 /* ForInStatement */) { - return anyType; + // A variable declared in a for..in statement is always of type string + if (declaration.parent.parent.kind === 203 /* ForInStatement */) { + return stringType; } - if (declaration.parent.parent.kind === 203 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 204 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -16507,11 +16791,11 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138 /* Parameter */) { + if (declaration.kind === 139 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 146 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 145 /* GetAccessor */); + if (func.kind === 147 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 146 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -16527,7 +16811,7 @@ var ts; return checkExpressionCached(declaration.initializer); } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 248 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 249 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // If the declaration specifies a binding pattern, use the type implied by the binding pattern @@ -16583,7 +16867,7 @@ var ts; return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType; } // If the pattern has at least one element, and no rest element, then it should imply a tuple type. - var elementTypes = ts.map(elements, function (e) { return e.kind === 189 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 190 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -16599,7 +16883,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 163 /* ObjectBindingPattern */ + return pattern.kind === 164 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -16621,10 +16905,10 @@ var ts; // During a normal type check we'll never get to here with a property assignment (the check of the containing // object literal uses a different path). We exclude widening only so that language services and type verification // tools see the actual type. - if (declaration.kind === 247 /* PropertyAssignment */) { + if (declaration.kind === 248 /* PropertyAssignment */) { return type; } - if (type.flags & 134217728 /* PredicateType */ && (declaration.kind === 141 /* PropertyDeclaration */ || declaration.kind === 140 /* PropertySignature */)) { + if (type.flags & 134217728 /* PredicateType */ && (declaration.kind === 142 /* PropertyDeclaration */ || declaration.kind === 141 /* PropertySignature */)) { return type; } return getWidenedType(type); @@ -16634,7 +16918,7 @@ var ts; // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && compilerOptions.noImplicitAny) { var root = ts.getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 138 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 139 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -16649,21 +16933,21 @@ var ts; } // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 246 /* CatchClause */) { + if (declaration.parent.kind === 247 /* CatchClause */) { return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 229 /* ExportAssignment */) { + if (declaration.kind === 230 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } // Handle module.exports = expr - if (declaration.kind === 183 /* BinaryExpression */) { + if (declaration.kind === 184 /* BinaryExpression */) { return links.type = checkExpression(declaration.right); } - if (declaration.kind === 168 /* PropertyAccessExpression */) { + if (declaration.kind === 169 /* PropertyAccessExpression */) { // Declarations only exist for property access expressions for certain // special assignment kinds - if (declaration.parent.kind === 183 /* BinaryExpression */) { + if (declaration.parent.kind === 184 /* BinaryExpression */) { // Handle exports.p = expr or this.p = expr or className.prototype.method = expr return links.type = checkExpressionCached(declaration.parent.right); } @@ -16693,7 +16977,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 145 /* GetAccessor */) { + if (accessor.kind === 146 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -16709,8 +16993,8 @@ var ts; if (!pushTypeResolution(symbol, 0 /* Type */)) { return unknownType; } - var getter = ts.getDeclarationOfKind(symbol, 145 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 146 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 146 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 147 /* SetAccessor */); var type; // First try to see if the user specified a return type on the get-accessor. var getterReturnType = getAnnotatedAccessorType(getter); @@ -16739,7 +17023,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 145 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 146 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -16839,9 +17123,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */ || - node.kind === 215 /* FunctionDeclaration */ || node.kind === 175 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */ || node.kind === 176 /* ArrowFunction */) { + if (node.kind === 217 /* ClassDeclaration */ || node.kind === 189 /* ClassExpression */ || + node.kind === 216 /* FunctionDeclaration */ || node.kind === 176 /* FunctionExpression */ || + node.kind === 144 /* MethodDeclaration */ || node.kind === 177 /* ArrowFunction */) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -16851,7 +17135,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 218 /* InterfaceDeclaration */); return appendOuterTypeParameters(undefined, declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -16860,8 +17144,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 216 /* ClassDeclaration */ || - node.kind === 188 /* ClassExpression */ || node.kind === 218 /* TypeAliasDeclaration */) { + if (node.kind === 218 /* InterfaceDeclaration */ || node.kind === 217 /* ClassDeclaration */ || + node.kind === 189 /* ClassExpression */ || node.kind === 219 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -17001,7 +17285,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 218 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -17033,7 +17317,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217 /* InterfaceDeclaration */) { + if (declaration.kind === 218 /* InterfaceDeclaration */) { if (declaration.flags & 262144 /* ContainsThis */) { return false; } @@ -17089,7 +17373,7 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 218 /* TypeAliasDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 219 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -17122,7 +17406,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */).constraint) { + if (!ts.getDeclarationOfKind(symbol, 138 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -17178,11 +17462,11 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: return true; - case 156 /* ArrayType */: + case 157 /* ArrayType */: return isIndependentType(node.elementType); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return isIndependentTypeReference(node); } return false; @@ -17195,7 +17479,7 @@ var ts; // A function-like declaration is considered independent (free of this references) if it has a return type // annotation that is considered independent and if each parameter is considered independent. function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 144 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 145 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -17216,12 +17500,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return isIndependentVariableLikeDeclaration(declaration); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -17783,7 +18067,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 144 /* Constructor */ ? + var classType = declaration.kind === 145 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : @@ -17800,7 +18084,7 @@ var ts; paramSymbol = resolvedSymbol; } parameters.push(paramSymbol); - if (param.type && param.type.kind === 162 /* StringLiteralType */) { + if (param.type && param.type.kind === 163 /* StringLiteralType */) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -17826,8 +18110,8 @@ var ts; else { // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 145 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 146 /* SetAccessor */); + if (declaration.kind === 146 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 147 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -17845,19 +18129,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -17944,7 +18228,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 144 /* Constructor */ || signature.declaration.kind === 148 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 145 /* Constructor */ || signature.declaration.kind === 149 /* ConstructSignature */; var type = createObjectType(65536 /* Anonymous */ | 262144 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -17981,7 +18265,7 @@ var ts; : undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 137 /* TypeParameter */).constraint; + return ts.getDeclarationOfKind(type.symbol, 138 /* TypeParameter */).constraint; } function hasConstraintReferenceTo(type, target) { var checked; @@ -18014,7 +18298,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 138 /* TypeParameter */).parent); } function getTypeListId(types) { if (types) { @@ -18113,7 +18397,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { // We only support expressions that are simple qualified names. For other expressions this produces undefined. - var typeNameOrExpression = node.kind === 151 /* TypeReference */ ? node.typeName : + var typeNameOrExpression = node.kind === 152 /* TypeReference */ ? node.typeName : ts.isSupportedExpressionWithTypeArguments(node) ? node.expression : undefined; var symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, 793056 /* Type */) || unknownSymbol; @@ -18145,9 +18429,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: return declaration; } } @@ -18388,9 +18672,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 217 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 218 /* InterfaceDeclaration */)) { if (!(container.flags & 64 /* Static */) && - (container.kind !== 144 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) { + (container.kind !== 145 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -18434,36 +18718,36 @@ var ts; return esSymbolType; case 103 /* VoidKeyword */: return voidType; - case 161 /* ThisType */: + case 162 /* ThisType */: return getTypeFromThisTypeNode(node); - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: return getTypeFromStringLiteralTypeNode(node); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return getTypeFromTypeReference(node); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return getTypeFromPredicateTypeNode(node); - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 157 /* TupleType */: + case 158 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 158 /* UnionType */: + case 159 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 159 /* IntersectionType */: + case 160 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return getTypeFromTypeNode(node.type); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 155 /* TypeLiteral */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 156 /* TypeLiteral */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 69 /* Identifier */: - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -18654,27 +18938,27 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return node.operatorToken.kind === 52 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 247 /* PropertyAssignment */: + case 248 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -18703,6 +18987,9 @@ var ts; function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? -1 /* True */ : 0 /* False */; } + function compareTypesAssignable(source, target) { + return checkTypeRelatedTo(source, target, assignableRelation, /*errorNode*/ undefined) ? -1 /* True */ : 0 /* False */; + } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined); } @@ -18715,47 +19002,60 @@ var ts; function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + return compareSignaturesRelated(source, target, ignoreReturnTypes, /*reportErrors*/ false, /*errorReporter*/ undefined, compareTypesAssignable) !== 0 /* False */; + } /** * See signatureRelatedTo, compareSignaturesIdentical */ - function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { // TODO (drosen): De-duplicate code between related functions. if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } // Spec 1.0 Section 3.8.3 & 3.8.4: // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; var sourceMax = getNumNonRestParameters(source); var targetMax = getNumNonRestParameters(target); var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + var sourceParams = source.parameters; + var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + var s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); + var related = compareTypes(t, s, /*reportErrors*/ false) || compareTypes(s, t, reportErrors); if (!related) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); + } + return 0 /* False */; } + result &= related; } if (!ignoreReturnTypes) { var targetReturnType = getReturnTypeOfSignature(target); if (targetReturnType === voidType) { - return true; + return result; } var sourceReturnType = getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); + } + return 0 /* False */; } } - return isTypeAssignableTo(sourceReturnType, targetReturnType); + result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); } - return true; + return result; } function isImplementationCompatibleWithOverload(implementation, overload) { var erasedSource = getErasedSignature(implementation); @@ -18812,22 +19112,12 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; - var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); + var result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { - // If we already computed this relation, but in a context where we didn't want to report errors (e.g. overload resolution), - // then we'll only have a top-level error (e.g. 'Class X does not implement interface Y') without any details. If this happened, - // request a recompuation to get a complete error message. This will be skipped if we've already done this computation in a context - // where errors were being reported. - if (errorInfo.next === undefined) { - errorInfo = undefined; - elaborateErrors = true; - isRelatedTo(source, target, errorNode !== undefined, headMessage); - } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); } @@ -18835,6 +19125,7 @@ var ts; } return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { + ts.Debug.assert(!!errorNode); errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } function reportRelationError(message, source, target) { @@ -18973,14 +19264,14 @@ var ts; } // Even if relationship doesn't hold for unions, intersections, or generic type references, // it may hold in a structural comparison. - var apparentType = getApparentType(source); + var apparentSource = getApparentType(source); // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates // to X. Failing both of those we want to check if the aggregation of A and B's members structurally // relates to X. Thus, we include intersection types on the source side here. - if (apparentType.flags & (80896 /* ObjectType */ | 32768 /* Intersection */) && target.flags & 80896 /* ObjectType */) { + if (apparentSource.flags & (80896 /* ObjectType */ | 32768 /* Intersection */) && target.flags & 80896 /* ObjectType */) { // Report structural errors only if we haven't reported any errors yet - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 16777726 /* Primitive */); + if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } @@ -19043,6 +19334,7 @@ var ts; // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. + ts.Debug.assert(!!errorNode); errorNode = prop.valueDeclaration; reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); } @@ -19140,7 +19432,7 @@ var ts; var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - if (elaborateErrors && related === 2 /* Failed */) { + if (reportErrors && related === 2 /* Failed */) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. relation[id] = 3 /* FailedAndReported */; @@ -19354,7 +19646,7 @@ var ts; } // don't elaborate the primitive apparent types (like Number) // because the actual primitives will have already been reported. - if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + if (shouldElaborateErrors) { reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); } return 0 /* False */; @@ -19363,72 +19655,10 @@ var ts; return result; } /** - * See signatureAssignableTo, signatureAssignableTo + * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, reportErrors) { - // TODO (drosen): De-duplicate code between related functions. - if (source === target) { - return -1 /* True */; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return 0 /* False */; - } - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var checkCount; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - // Spec 1.0 Section 3.8.3 & 3.8.4: - // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N - source = getErasedSignature(source); - target = getErasedSignature(target); - var result = -1 /* True */; - for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); - if (!related) { - related = isRelatedTo(t, s, /*reportErrors*/ false); - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); - } - return 0 /* False */; - } - errorInfo = saveErrorInfo; - } - result &= related; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) { - return result; - } - var sourceReturnType = getReturnTypeOfSignature(source); - // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions - if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { - if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0 /* False */; - } - } - return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); + return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -19844,22 +20074,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 138 /* Parameter */: + case 139 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -20196,10 +20426,10 @@ var ts; // The expression is restricted to a single identifier or a sequence of identifiers separated by periods while (node) { switch (node.kind) { - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return true; case 69 /* Identifier */: - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: node = node.parent; continue; default: @@ -20241,55 +20471,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: - case 166 /* ArrayLiteralExpression */: - case 167 /* ObjectLiteralExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: - case 174 /* ParenthesizedExpression */: - case 181 /* PrefixUnaryExpression */: - case 177 /* DeleteExpression */: - case 180 /* AwaitExpression */: - case 178 /* TypeOfExpression */: - case 179 /* VoidExpression */: - case 182 /* PostfixUnaryExpression */: - case 186 /* YieldExpression */: - case 184 /* ConditionalExpression */: - case 187 /* SpreadElementExpression */: - case 194 /* Block */: - case 195 /* VariableStatement */: - case 197 /* ExpressionStatement */: - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 206 /* ReturnStatement */: - case 207 /* WithStatement */: - case 208 /* SwitchStatement */: - case 243 /* CaseClause */: - case 244 /* DefaultClause */: - case 209 /* LabeledStatement */: - case 210 /* ThrowStatement */: - case 211 /* TryStatement */: - case 246 /* CatchClause */: - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: - case 240 /* JsxAttribute */: - case 241 /* JsxSpreadAttribute */: - case 237 /* JsxOpeningElement */: - case 242 /* JsxExpression */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: + case 167 /* ArrayLiteralExpression */: + case 168 /* ObjectLiteralExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: + case 175 /* ParenthesizedExpression */: + case 182 /* PrefixUnaryExpression */: + case 178 /* DeleteExpression */: + case 181 /* AwaitExpression */: + case 179 /* TypeOfExpression */: + case 180 /* VoidExpression */: + case 183 /* PostfixUnaryExpression */: + case 187 /* YieldExpression */: + case 185 /* ConditionalExpression */: + case 188 /* SpreadElementExpression */: + case 195 /* Block */: + case 196 /* VariableStatement */: + case 198 /* ExpressionStatement */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 207 /* ReturnStatement */: + case 208 /* WithStatement */: + case 209 /* SwitchStatement */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: + case 210 /* LabeledStatement */: + case 211 /* ThrowStatement */: + case 212 /* TryStatement */: + case 247 /* CatchClause */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: + case 241 /* JsxAttribute */: + case 242 /* JsxSpreadAttribute */: + case 238 /* JsxOpeningElement */: + case 243 /* JsxExpression */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -20301,7 +20531,7 @@ var ts; // Only narrow when symbol is variable of type any or an object, union, or type parameter type if (node && symbol.flags & 3 /* Variable */) { if (isTypeAny(type) || type.flags & (80896 /* ObjectType */ | 16384 /* Union */ | 512 /* TypeParameter */)) { - var declaration = ts.getDeclarationOfKind(symbol, 213 /* VariableDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 214 /* VariableDeclaration */); var top_1 = declaration && getDeclarationContainer(declaration); var originalType = type; var nodeStack = []; @@ -20309,13 +20539,13 @@ var ts; var child = node; node = node.parent; switch (node.kind) { - case 198 /* IfStatement */: - case 184 /* ConditionalExpression */: - case 183 /* BinaryExpression */: + case 199 /* IfStatement */: + case 185 /* ConditionalExpression */: + case 184 /* BinaryExpression */: nodeStack.push({ node: node, child: child }); break; - case 250 /* SourceFile */: - case 220 /* ModuleDeclaration */: + case 251 /* SourceFile */: + case 221 /* ModuleDeclaration */: // Stop at the first containing file or module declaration break loop; } @@ -20327,19 +20557,19 @@ var ts; while (nodes = nodeStack.pop()) { var node_1 = nodes.node, child = nodes.child; switch (node_1.kind) { - case 198 /* IfStatement */: + case 199 /* IfStatement */: // In a branch of an if statement, narrow based on controlling expression if (child !== node_1.expression) { type = narrowType(type, node_1.expression, /*assumeTrue*/ child === node_1.thenStatement); } break; - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: // In a branch of a conditional expression, narrow based on controlling condition if (child !== node_1.condition) { type = narrowType(type, node_1.condition, /*assumeTrue*/ child === node_1.whenTrue); } break; - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: // In the right operand of an && or ||, narrow based on left operand if (child === node_1.right) { if (node_1.operatorToken.kind === 51 /* AmpersandAmpersandToken */) { @@ -20367,7 +20597,7 @@ var ts; return type; function narrowTypeByEquality(type, expr, assumeTrue) { // Check that we have 'typeof ' on the left and string literal on the right - if (expr.left.kind !== 178 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { + if (expr.left.kind !== 179 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { return type; } var left = expr.left; @@ -20383,10 +20613,6 @@ var ts; if (typeInfo && typeInfo.type === undefinedType) { return type; } - // If the type to be narrowed is any and we're checking a primitive with assumeTrue=true, return the primitive - if (!!(type.flags & 1 /* Any */) && typeInfo && assumeTrue) { - return typeInfo.type; - } var flags; if (typeInfo) { flags = typeInfo.flags; @@ -20397,6 +20623,10 @@ var ts; } // At this point we can bail if it's not a union if (!(type.flags & 16384 /* Union */)) { + // If we're on the true branch and the type is a subtype, we should return the primitive type + if (assumeTrue && typeInfo && isTypeSubtypeOf(typeInfo.type, type)) { + return typeInfo.type; + } // If the active non-union type would be removed from a union by this type guard, return an empty union return filterUnion(type) ? type : emptyUnionType; } @@ -20525,7 +20755,7 @@ var ts; return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); } function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { - if (expression.kind === 169 /* ElementAccessExpression */ || expression.kind === 168 /* PropertyAccessExpression */) { + if (expression.kind === 170 /* ElementAccessExpression */ || expression.kind === 169 /* PropertyAccessExpression */) { var accessExpression = expression; var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); if (possibleIdentifier.kind === 69 /* Identifier */ && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { @@ -20538,8 +20768,8 @@ var ts; expr = skipParenthesizedNodes(expr); switch (expr.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(expr); } } @@ -20547,11 +20777,11 @@ var ts; // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 170 /* CallExpression */: + case 171 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: var operator = expr.operatorToken.kind; if (operator === 32 /* EqualsEqualsEqualsToken */ || operator === 33 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -20566,20 +20796,20 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: if (expr.operator === 49 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; - case 169 /* ElementAccessExpression */: - case 168 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 169 /* PropertyAccessExpression */: return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } function skipParenthesizedNodes(expression) { - while (expression.kind === 174 /* ParenthesizedExpression */) { + while (expression.kind === 175 /* ParenthesizedExpression */) { expression = expression.expression; } return expression; @@ -20594,7 +20824,7 @@ var ts; // can explicitly bound arguments objects if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 176 /* ArrowFunction */) { + if (container.kind === 177 /* ArrowFunction */) { if (languageVersion < 2 /* ES6 */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -20625,7 +20855,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 /* ES6 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 246 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 247 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -20641,12 +20871,12 @@ var ts; // nesting structure: // (variable declaration or binding element) -> variable declaration list -> container container = symbol.valueDeclaration; - while (container.kind !== 214 /* VariableDeclarationList */) { + while (container.kind !== 215 /* VariableDeclarationList */) { container = container.parent; } // get the parent of variable declaration list container = container.parent; - if (container.kind === 195 /* VariableStatement */) { + if (container.kind === 196 /* VariableStatement */) { // if parent is variable statement - get its parent container = container.parent; } @@ -20667,7 +20897,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 141 /* PropertyDeclaration */ || container.kind === 144 /* Constructor */) { + if (container.kind === 142 /* PropertyDeclaration */ || container.kind === 145 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -20681,32 +20911,32 @@ var ts; var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 176 /* ArrowFunction */) { + if (container.kind === 177 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES6 */); } switch (container.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 144 /* Constructor */: + case 145 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: if (container.flags & 64 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -20719,7 +20949,7 @@ var ts; } // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (ts.isInJavaScriptFile(node) && container.kind === 175 /* FunctionExpression */) { + if (ts.isInJavaScriptFile(node) && container.kind === 176 /* FunctionExpression */) { if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.protoype.y = f @@ -20736,19 +20966,19 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 138 /* Parameter */) { + if (n.kind === 139 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 171 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; if (!isCallExpression) { // adjust the container reference in case if super is used inside arrow functions with arbitrary deep nesting - while (container && container.kind === 176 /* ArrowFunction */) { + while (container && container.kind === 177 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } @@ -20762,16 +20992,16 @@ var ts; // [super.foo()]() {} // } var current = node; - while (current && current !== container && current.kind !== 136 /* ComputedPropertyName */) { + while (current && current !== container && current.kind !== 137 /* ComputedPropertyName */) { current = current.parent; } - if (current && current.kind === 136 /* ComputedPropertyName */) { + if (current && current.kind === 137 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 168 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -20792,7 +21022,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 167 /* ObjectLiteralExpression */) { + if (container.parent.kind === 168 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES6 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -20812,7 +21042,7 @@ var ts; } return unknownType; } - if (container.kind === 144 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 145 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -20827,7 +21057,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 144 /* Constructor */; + return container.kind === 145 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -20835,21 +21065,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 168 /* ObjectLiteralExpression */) { if (container.flags & 64 /* Static */) { - return container.kind === 143 /* MethodDeclaration */ || - container.kind === 142 /* MethodSignature */ || - container.kind === 145 /* GetAccessor */ || - container.kind === 146 /* SetAccessor */; + return container.kind === 144 /* MethodDeclaration */ || + container.kind === 143 /* MethodSignature */ || + container.kind === 146 /* GetAccessor */ || + container.kind === 147 /* SetAccessor */; } else { - return container.kind === 143 /* MethodDeclaration */ || - container.kind === 142 /* MethodSignature */ || - container.kind === 145 /* GetAccessor */ || - container.kind === 146 /* SetAccessor */ || - container.kind === 141 /* PropertyDeclaration */ || - container.kind === 140 /* PropertySignature */ || - container.kind === 144 /* Constructor */; + return container.kind === 144 /* MethodDeclaration */ || + container.kind === 143 /* MethodSignature */ || + container.kind === 146 /* GetAccessor */ || + container.kind === 147 /* SetAccessor */ || + container.kind === 142 /* PropertyDeclaration */ || + container.kind === 141 /* PropertySignature */ || + container.kind === 145 /* Constructor */; } } } @@ -20891,7 +21121,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138 /* Parameter */) { + if (declaration.kind === 139 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -20924,7 +21154,7 @@ var ts; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 138 /* Parameter */ && node.parent.initializer === node) { + if (node.parent.kind === 139 /* Parameter */ && node.parent.initializer === node) { return true; } node = node.parent; @@ -20935,8 +21165,8 @@ var ts; // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed if (functionDecl.type || - functionDecl.kind === 144 /* Constructor */ || - functionDecl.kind === 145 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 146 /* SetAccessor */))) { + functionDecl.kind === 145 /* Constructor */ || + functionDecl.kind === 146 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 147 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature @@ -20958,7 +21188,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 172 /* TaggedTemplateExpression */) { + if (template.parent.kind === 173 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -21089,13 +21319,13 @@ var ts; var kind = attribute.kind; var jsxElement = attribute.parent; var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 240 /* JsxAttribute */) { + if (attribute.kind === 241 /* JsxAttribute */) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - else if (attribute.kind === 241 /* JsxSpreadAttribute */) { + else if (attribute.kind === 242 /* JsxSpreadAttribute */) { return attrsType; } ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); @@ -21133,40 +21363,40 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 213 /* VariableDeclaration */: - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 139 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 166 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 176 /* ArrowFunction */: - case 206 /* ReturnStatement */: + case 177 /* ArrowFunction */: + case 207 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 247 /* PropertyAssignment */: + case 248 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 192 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 185 /* TemplateExpression */); + case 193 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 186 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return getContextualType(parent); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return getContextualType(parent); - case 240 /* JsxAttribute */: - case 241 /* JsxSpreadAttribute */: + case 241 /* JsxAttribute */: + case 242 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); } return undefined; @@ -21183,7 +21413,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 175 /* FunctionExpression */ || node.kind === 176 /* ArrowFunction */; + return node.kind === 176 /* FunctionExpression */ || node.kind === 177 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -21197,7 +21427,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getApparentTypeOfContextualType(node); @@ -21260,13 +21490,13 @@ var ts; // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 183 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { + if (parent.kind === 184 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 247 /* PropertyAssignment */) { + if (parent.kind === 248 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 166 /* ArrayLiteralExpression */) { + if (parent.kind === 167 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; @@ -21282,8 +21512,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); } function hasDefaultValue(node) { - return (node.kind === 165 /* BindingElement */ && !!node.initializer) || - (node.kind === 183 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); + return (node.kind === 166 /* BindingElement */ && !!node.initializer) || + (node.kind === 184 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -21292,7 +21522,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 187 /* SpreadElementExpression */) { + if (inDestructuringPattern && e.kind === 188 /* SpreadElementExpression */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -21316,7 +21546,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 187 /* SpreadElementExpression */; + hasSpreadElement = hasSpreadElement || e.kind === 188 /* SpreadElementExpression */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -21331,7 +21561,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 164 /* ArrayBindingPattern */ || pattern.kind === 166 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 165 /* ArrayBindingPattern */ || pattern.kind === 167 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -21339,7 +21569,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 189 /* OmittedExpression */) { + if (patternElement.kind !== 190 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -21354,7 +21584,7 @@ var ts; return createArrayType(elementTypes.length ? getUnionType(elementTypes) : undefinedType); } function isNumericName(name) { - return name.kind === 136 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 137 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { // It seems odd to consider an expression of type Any to result in a numeric name, @@ -21411,24 +21641,24 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 163 /* ObjectBindingPattern */ || contextualType.pattern.kind === 167 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 164 /* ObjectBindingPattern */ || contextualType.pattern.kind === 168 /* ObjectLiteralExpression */); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 247 /* PropertyAssignment */ || - memberDecl.kind === 248 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 248 /* PropertyAssignment */ || + memberDecl.kind === 249 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 247 /* PropertyAssignment */) { + if (memberDecl.kind === 248 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 143 /* MethodDeclaration */) { + else if (memberDecl.kind === 144 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 248 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 249 /* ShorthandPropertyAssignment */); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -21436,8 +21666,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 247 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 248 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 248 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 249 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912 /* Optional */; } @@ -21471,7 +21701,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 145 /* GetAccessor */ || memberDecl.kind === 146 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 146 /* GetAccessor */ || memberDecl.kind === 147 /* SetAccessor */); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -21538,13 +21768,13 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: checkJsxExpression(child); break; - case 235 /* JsxElement */: + case 236 /* JsxElement */: checkJsxElement(child); break; - case 236 /* JsxSelfClosingElement */: + case 237 /* JsxSelfClosingElement */: checkJsxSelfClosingElement(child); break; } @@ -21562,7 +21792,7 @@ var ts; * Returns true iff React would emit this tag name as a string rather than an identifier or qualified name */ function isJsxIntrinsicIdentifier(tagName) { - if (tagName.kind === 135 /* QualifiedName */) { + if (tagName.kind === 136 /* QualifiedName */) { return false; } else { @@ -21672,6 +21902,7 @@ var ts; if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } + return unknownSymbol; } } function lookupClassTag(node) { @@ -21771,21 +22002,25 @@ var ts; if (links.jsxFlags & 4 /* ValueElement */) { // Get the element instance type (the result of newing or invoking this tag) var elemInstanceType = getJsxElementInstanceType(node); - // Is this is a stateless function component? See if its single signature is - // assignable to the JSX Element Type - var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896 /* ObjectType */)) { - // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); + var elemClassType = getJsxGlobalElementClassType(); + if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { + // Is this is a stateless function component? See if its single signature's return type is + // assignable to the JSX Element Type + var elemType = getTypeOfSymbol(sym); + var callSignatures = elemType && getSignaturesOfType(elemType, 0 /* Call */); + var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return links.resolvedJsxType = paramType; } - return paramType; } // Issue an error if this return type isn't assignable to JSX.ElementClass - var elemClassType = getJsxGlobalElementClassType(); if (elemClassType) { checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } @@ -21902,11 +22137,11 @@ var ts; // thus should have their types ignored var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 240 /* JsxAttribute */) { + if (node.attributes[i].kind === 241 /* JsxAttribute */) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 241 /* JsxSpreadAttribute */); + ts.Debug.assert(node.attributes[i].kind === 242 /* JsxSpreadAttribute */); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -21936,7 +22171,7 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 141 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 142 /* PropertyDeclaration */; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 8 /* Public */ | 64 /* Static */ : 0; @@ -21953,7 +22188,7 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95 /* SuperKeyword */) { - var errorNode = node.kind === 168 /* PropertyAccessExpression */ ? + var errorNode = node.kind === 169 /* PropertyAccessExpression */ ? node.name : node.right; // TS 1.0 spec (April 2014): 4.8.2 @@ -21963,7 +22198,7 @@ var ts; // - In a static member function or static member accessor // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. - if (languageVersion < 2 /* ES6 */ && getDeclarationKindFromSymbol(prop) !== 143 /* MethodDeclaration */) { + if (languageVersion < 2 /* ES6 */ && getDeclarationKindFromSymbol(prop) !== 144 /* MethodDeclaration */) { // `prop` refers to a *property* declared in the super class // rather than a *method*, so it does not satisfy the above criteria. error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); @@ -22050,7 +22285,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 168 /* PropertyAccessExpression */ + var left = node.kind === 169 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpression(left); @@ -22062,11 +22297,58 @@ var ts; } return true; } + /** + * Return the symbol of the for-in variable declared or referenced by the given for-in statement. + */ + function getForInVariableSymbol(node) { + var initializer = node.initializer; + if (initializer.kind === 215 /* VariableDeclarationList */) { + var variable = initializer.declarations[0]; + if (variable && !ts.isBindingPattern(variable.name)) { + return getSymbolOfNode(variable); + } + } + else if (initializer.kind === 69 /* Identifier */) { + return getResolvedSymbol(initializer); + } + return undefined; + } + /** + * Return true if the given type is considered to have numeric property names. + */ + function hasNumericPropertyNames(type) { + return getIndexTypeOfType(type, 1 /* Number */) && !getIndexTypeOfType(type, 0 /* String */); + } + /** + * Return true if given node is an expression consisting of an identifier (possibly parenthesized) + * that references a for-in variable for an object with numeric property names. + */ + function isForInVariableForNumericPropertyNames(expr) { + var e = skipParenthesizedNodes(expr); + if (e.kind === 69 /* Identifier */) { + var symbol = getResolvedSymbol(e); + if (symbol.flags & 3 /* Variable */) { + var child = expr; + var node = expr.parent; + while (node) { + if (node.kind === 203 /* ForInStatement */ && + child === node.statement && + getForInVariableSymbol(node) === symbol && + hasNumericPropertyNames(checkExpression(node.expression))) { + return true; + } + child = node; + node = node.parent; + } + } + } + return false; + } function checkIndexedAccess(node) { // Grammar checking if (!node.argumentExpression) { - var sourceFile = getSourceFile(node); - if (node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node) { + var sourceFile = ts.getSourceFileOfNode(node); + if (node.parent.kind === 172 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -22115,7 +22397,7 @@ var ts; // Check for compatible indexer types. if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 258 /* StringLike */ | 132 /* NumberLike */ | 16777216 /* ESSymbol */)) { // Try to use a number indexer. - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132 /* NumberLike */)) { + if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132 /* NumberLike */) || isForInVariableForNumericPropertyNames(node.argumentExpression)) { var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; @@ -22128,7 +22410,9 @@ var ts; } // Fall back to any. if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !isTypeAny(objectType)) { - error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + error(node, getIndexTypeOfType(objectType, 1 /* Number */) ? + ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number : + ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; } @@ -22147,7 +22431,7 @@ var ts; if (indexArgumentExpression.kind === 9 /* StringLiteral */ || indexArgumentExpression.kind === 8 /* NumericLiteral */) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 169 /* ElementAccessExpression */ || indexArgumentExpression.kind === 168 /* PropertyAccessExpression */) { + if (indexArgumentExpression.kind === 170 /* ElementAccessExpression */ || indexArgumentExpression.kind === 169 /* PropertyAccessExpression */) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -22202,10 +22486,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 139 /* Decorator */) { + else if (node.kind !== 140 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -22271,7 +22555,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 187 /* SpreadElementExpression */) { + if (arg && arg.kind === 188 /* SpreadElementExpression */) { return i; } } @@ -22283,13 +22567,13 @@ var ts; var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments var isDecorator; var spreadArgIndex = -1; - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { var tagExpression = node; // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 185 /* TemplateExpression */) { + if (tagExpression.template.kind === 186 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; @@ -22306,7 +22590,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 139 /* Decorator */) { + else if (node.kind === 140 /* Decorator */) { isDecorator = true; typeArguments = undefined; adjustedArgCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); @@ -22315,7 +22599,7 @@ var ts; var callExpression = node; if (!callExpression.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 171 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 172 /* NewExpression */); return signature.minArgumentCount === 0; } // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. @@ -22394,7 +22678,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 190 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); // If the effective argument type is 'undefined', there is no synthetic type @@ -22454,7 +22738,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 190 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); @@ -22486,16 +22770,16 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { var template = node.template; args = [undefined]; - if (template.kind === 185 /* TemplateExpression */) { + if (template.kind === 186 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 139 /* Decorator */) { + else if (node.kind === 140 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. @@ -22520,19 +22804,19 @@ var ts; * Otherwise, the argument count is the length of the 'args' array. */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 139 /* Decorator */) { + if (node.kind === 140 /* Decorator */) { switch (node.parent.kind) { - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -22542,7 +22826,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 138 /* Parameter */: + case 139 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -22566,25 +22850,25 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 138 /* Parameter */) { + if (node.kind === 139 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 144 /* Constructor */) { + if (node.kind === 145 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 141 /* PropertyDeclaration */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 142 /* PropertyDeclaration */ || + node.kind === 144 /* MethodDeclaration */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -22611,21 +22895,21 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 138 /* Parameter */) { + if (node.kind === 139 /* Parameter */) { node = node.parent; - if (node.kind === 144 /* Constructor */) { + if (node.kind === 145 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } } - if (node.kind === 141 /* PropertyDeclaration */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 142 /* PropertyDeclaration */ || + node.kind === 144 /* MethodDeclaration */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -22636,7 +22920,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getStringLiteralTypeForText(element.name.text); - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) { return nameType; @@ -22662,21 +22946,21 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a paramter decorator - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 138 /* Parameter */) { + if (node.kind === 139 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 141 /* PropertyDeclaration */) { + if (node.kind === 142 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 143 /* MethodDeclaration */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 144 /* MethodDeclaration */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -22708,10 +22992,10 @@ var ts; // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 139 /* Decorator */) { + if (node.kind === 140 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 173 /* TaggedTemplateExpression */) { return globalTemplateStringsArrayType; } // This is not a synthetic argument, so we return 'undefined' @@ -22723,8 +23007,8 @@ var ts; */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 139 /* Decorator */ || - (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */)) { + if (node.kind === 140 /* Decorator */ || + (argIndex === 0 && node.kind === 173 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -22733,11 +23017,11 @@ var ts; * Gets the error node to use when reporting errors for an effective argument. */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 139 /* Decorator */) { + if (node.kind === 140 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 173 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -22746,8 +23030,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 172 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 139 /* Decorator */; + var isTaggedTemplate = node.kind === 173 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 140 /* Decorator */; var typeArguments; if (!isTaggedTemplate && !isDecorator) { typeArguments = node.typeArguments; @@ -23093,16 +23377,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 138 /* Parameter */: + case 139 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -23139,16 +23423,16 @@ var ts; // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 170 /* CallExpression */) { + if (node.kind === 171 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 171 /* NewExpression */) { + else if (node.kind === 172 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 172 /* TaggedTemplateExpression */) { + else if (node.kind === 173 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } - else if (node.kind === 139 /* Decorator */) { + else if (node.kind === 140 /* Decorator */) { links.resolvedSignature = resolveDecorator(node, candidatesOutArray); } else { @@ -23176,12 +23460,12 @@ var ts; if (node.expression.kind === 95 /* SuperKeyword */) { return voidType; } - if (node.kind === 171 /* NewExpression */) { + if (node.kind === 172 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 144 /* Constructor */ && - declaration.kind !== 148 /* ConstructSignature */ && - declaration.kind !== 153 /* ConstructorType */) { + declaration.kind !== 145 /* Constructor */ && + declaration.kind !== 149 /* ConstructSignature */ && + declaration.kind !== 154 /* ConstructorType */) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations // in a JS file @@ -23242,7 +23526,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189 /* OmittedExpression */) { + if (element.kind !== 190 /* OmittedExpression */) { if (element.name.kind === 69 /* Identifier */) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -23307,7 +23591,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 194 /* Block */) { + if (func.body.kind !== 195 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -23437,7 +23721,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 195 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { return; } var hasExplicitReturn = func.flags & 1048576 /* HasExplicitReturn */; @@ -23463,20 +23747,16 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 175 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 176 /* FunctionExpression */) { checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards if (contextualMapper === identityMapper && isContextSensitive(node)) { return anyFunctionType; } - var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); @@ -23510,18 +23790,15 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 143 /* MethodDeclaration */ && node.kind !== 142 /* MethodSignature */) { + if (produceDiagnostics && node.kind !== 144 /* MethodDeclaration */ && node.kind !== 143 /* MethodSignature */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); if (!node.asteriskToken) { // return is not necessary in the body of generators @@ -23536,7 +23813,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 194 /* Block */) { + if (node.body.kind === 195 /* Block */) { checkSourceElement(node.body); } else { @@ -23588,17 +23865,17 @@ var ts; // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; } - case 168 /* PropertyAccessExpression */: { + case 169 /* PropertyAccessExpression */: { var symbol = findSymbol(n); // TypeScript 1.0 spec (April 2014): 4.10 // A property access expression is always classified as a reference. // NOTE (not in spec): assignment to enum members should not be allowed return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; } - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: // old compiler doesn't check indexed access return true; - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -23607,11 +23884,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: { + case 169 /* PropertyAccessExpression */: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384 /* Const */) !== 0; } - case 169 /* ElementAccessExpression */: { + case 170 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9 /* StringLiteral */) { @@ -23621,7 +23898,7 @@ var ts; } return false; } - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -23767,9 +24044,9 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { + if (p.kind === 248 /* PropertyAssignment */ || p.kind === 249 /* ShorthandPropertyAssignment */) { var name_13 = p.name; - if (name_13.kind === 136 /* ComputedPropertyName */) { + if (name_13.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(name_13); } if (isComputedNonLiteralName(name_13)) { @@ -23782,7 +24059,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1 /* Number */) || getIndexTypeOfType(sourceType, 0 /* String */); if (type) { - if (p.kind === 248 /* ShorthandPropertyAssignment */) { + if (p.kind === 249 /* ShorthandPropertyAssignment */) { checkDestructuringAssignment(p, type); } else { @@ -23808,8 +24085,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189 /* OmittedExpression */) { - if (e.kind !== 187 /* SpreadElementExpression */) { + if (e.kind !== 190 /* OmittedExpression */) { + if (e.kind !== 188 /* SpreadElementExpression */) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -23834,7 +24111,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 183 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { + if (restExpression.kind === 184 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -23848,7 +24125,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 248 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 249 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -23858,14 +24135,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + if (target.kind === 184 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 167 /* ObjectLiteralExpression */) { + if (target.kind === 168 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 166 /* ArrayLiteralExpression */) { + if (target.kind === 167 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -23882,7 +24159,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 /* EqualsToken */ && (left.kind === 167 /* ObjectLiteralExpression */ || left.kind === 166 /* ArrayLiteralExpression */)) { + if (operator === 56 /* EqualsToken */ && (left.kind === 168 /* ObjectLiteralExpression */ || left.kind === 167 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -24151,7 +24428,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); @@ -24162,7 +24439,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -24192,7 +24469,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpression(node, contextualMapper) { var type; - if (node.kind === 135 /* QualifiedName */) { + if (node.kind === 136 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -24204,9 +24481,9 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 170 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 69 /* Identifier */ || node.kind === 136 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } @@ -24233,7 +24510,7 @@ var ts; return booleanType; case 8 /* NumericLiteral */: return checkNumericLiteral(node); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: return checkTemplateExpression(node); case 9 /* StringLiteral */: return checkStringLiteralExpression(node); @@ -24241,58 +24518,58 @@ var ts; return stringType; case 10 /* RegularExpressionLiteral */: return globalRegExpType; - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return checkCallExpression(node); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return checkClassExpression(node); - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 178 /* TypeOfExpression */: + case 179 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: return checkAssertion(node); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return checkDeleteExpression(node); - case 179 /* VoidExpression */: + case 180 /* VoidExpression */: return checkVoidExpression(node); - case 180 /* AwaitExpression */: + case 181 /* AwaitExpression */: return checkAwaitExpression(node); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 187 /* SpreadElementExpression */: + case 188 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 189 /* OmittedExpression */: + case 190 /* OmittedExpression */: return undefinedType; - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return checkYieldExpression(node); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return checkJsxExpression(node); - case 235 /* JsxElement */: + case 236 /* JsxElement */: return checkJsxElement(node); - case 236 /* JsxSelfClosingElement */: + case 237 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node); - case 237 /* JsxOpeningElement */: + case 238 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -24320,7 +24597,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 56 /* AccessibilityModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 144 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 145 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -24337,9 +24614,9 @@ var ts; if (!node.asteriskToken || !node.body) { return false; } - return node.kind === 143 /* MethodDeclaration */ || - node.kind === 215 /* FunctionDeclaration */ || - node.kind === 175 /* FunctionExpression */; + return node.kind === 144 /* MethodDeclaration */ || + node.kind === 216 /* FunctionDeclaration */ || + node.kind === 176 /* FunctionExpression */; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -24353,105 +24630,98 @@ var ts; } return -1; } - function isInLegalParameterTypePredicatePosition(node) { - switch (node.parent.kind) { - case 176 /* ArrowFunction */: - case 147 /* CallSignature */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 152 /* FunctionType */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - return node === node.parent.type; + function checkTypePredicate(node) { + var parent = getTypePredicateParent(node); + if (!parent) { + return; + } + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(parent)); + if (!returnType || !(returnType.flags & 134217728 /* PredicateType */)) { + return; + } + var parameterName = node.parameterName; + if (parameterName.kind === 162 /* ThisType */) { + getTypeFromThisTypeNode(parameterName); + } + else { + var typePredicate = returnType.predicate; + if (typePredicate.parameterIndex >= 0) { + if (parent.parameters[typePredicate.parameterIndex].dotDotDotToken) { + error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + } + else { + checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type); + } + } + else if (parameterName) { + var hasReportedError = false; + for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { + var name_14 = _a[_i].name; + if ((name_14.kind === 164 /* ObjectBindingPattern */ || + name_14.kind === 165 /* ArrayBindingPattern */) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_14, parameterName, typePredicate.parameterName)) { + hasReportedError = true; + break; + } + } + if (!hasReportedError) { + error(node.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + } + } } - return false; } - function isInLegalThisTypePredicatePosition(node) { - if (isInLegalParameterTypePredicatePosition(node)) { - return true; - } + function getTypePredicateParent(node) { switch (node.parent.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 145 /* GetAccessor */: - return node === node.parent.type; + case 177 /* ArrowFunction */: + case 148 /* CallSignature */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 153 /* FunctionType */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + var parent_6 = node.parent; + if (node === parent_6.type) { + return parent_6; + } + } + } + function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern, predicateVariableNode, predicateVariableName) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var name_15 = _a[_i].name; + if (name_15.kind === 69 /* Identifier */ && + name_15.text === predicateVariableName) { + error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); + return true; + } + else if (name_15.kind === 165 /* ArrayBindingPattern */ || + name_15.kind === 164 /* ObjectBindingPattern */) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_15, predicateVariableNode, predicateVariableName)) { + return true; + } + } } - return false; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 149 /* IndexSignature */) { + if (node.kind === 150 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 /* FunctionType */ || node.kind === 215 /* FunctionDeclaration */ || node.kind === 153 /* ConstructorType */ || - node.kind === 147 /* CallSignature */ || node.kind === 144 /* Constructor */ || - node.kind === 148 /* ConstructSignature */) { + else if (node.kind === 153 /* FunctionType */ || node.kind === 216 /* FunctionDeclaration */ || node.kind === 154 /* ConstructorType */ || + node.kind === 148 /* CallSignature */ || node.kind === 145 /* Constructor */ || + node.kind === 149 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); - if (node.type) { - if (node.type.kind === 150 /* TypePredicate */) { - var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - if (!returnType || !(returnType.flags & 134217728 /* PredicateType */)) { - return; - } - var typePredicate = returnType.predicate; - var typePredicateNode = node.type; - checkSourceElement(typePredicateNode); - if (ts.isIdentifierTypePredicate(typePredicate)) { - if (typePredicate.parameterIndex >= 0) { - if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); - } - else { - checkTypeAssignableTo(typePredicate.type, getTypeOfNode(node.parameters[typePredicate.parameterIndex]), typePredicateNode.type); - } - } - else if (typePredicateNode.parameterName) { - var hasReportedError = false; - for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { - var param = _a[_i]; - if (hasReportedError) { - break; - } - if (param.name.kind === 163 /* ObjectBindingPattern */ || - param.name.kind === 164 /* ArrayBindingPattern */) { - (function checkBindingPattern(pattern) { - for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (element.name.kind === 69 /* Identifier */ && - element.name.text === typePredicate.parameterName) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, typePredicate.parameterName); - hasReportedError = true; - break; - } - else if (element.name.kind === 164 /* ArrayBindingPattern */ || - element.name.kind === 163 /* ObjectBindingPattern */) { - checkBindingPattern(element.name); - } - } - })(param.name); - } - } - if (!hasReportedError) { - error(typePredicateNode.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); - } - } - } - } - else { - checkSourceElement(node.type); - } - } + checkSourceElement(node.type); if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 147 /* CallSignature */: + case 148 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -24479,7 +24749,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 217 /* InterfaceDeclaration */) { + if (node.kind === 218 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -24556,7 +24826,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 170 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; + return n.kind === 171 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -24577,12 +24847,12 @@ var ts; if (n.kind === 97 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 175 /* FunctionExpression */ && n.kind !== 215 /* FunctionDeclaration */) { + else if (n.kind !== 176 /* FunctionExpression */ && n.kind !== 216 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 141 /* PropertyDeclaration */ && + return n.kind === 142 /* PropertyDeclaration */ && !(n.flags & 64 /* Static */) && !!n.initializer; } @@ -24612,7 +24882,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 197 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { + if (statement.kind === 198 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -24640,7 +24910,7 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 145 /* GetAccessor */) { + if (node.kind === 146 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288 /* HasImplicitReturn */)) { if (node.flags & 1048576 /* HasExplicitReturn */) { if (compilerOptions.noImplicitReturns) { @@ -24655,13 +24925,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 145 /* GetAccessor */ ? 146 /* SetAccessor */ : 145 /* GetAccessor */; + var otherKind = node.kind === 146 /* GetAccessor */ ? 147 /* SetAccessor */ : 146 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 56 /* AccessibilityModifier */) !== (otherAccessor.flags & 56 /* AccessibilityModifier */))) { @@ -24680,7 +24950,7 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - if (node.parent.kind !== 167 /* ObjectLiteralExpression */) { + if (node.parent.kind !== 168 /* ObjectLiteralExpression */) { checkSourceElement(node.body); } else { @@ -24771,9 +25041,9 @@ var ts; var signaturesToCheck; // Unnamed (call\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer. // Use declaring type to obtain full list of signatures. - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 147 /* CallSignature */ || signatureDeclarationNode.kind === 148 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 147 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 218 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 148 /* CallSignature */ || signatureDeclarationNode.kind === 149 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 148 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -24793,9 +25063,9 @@ var ts; var flags = ts.getCombinedNodeFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 217 /* InterfaceDeclaration */ && - n.parent.kind !== 216 /* ClassDeclaration */ && - n.parent.kind !== 188 /* ClassExpression */ && + if (n.parent.kind !== 218 /* InterfaceDeclaration */ && + n.parent.kind !== 217 /* ClassDeclaration */ && + n.parent.kind !== 189 /* ClassExpression */ && ts.isInAmbientContext(n)) { if (!(flags & 4 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -24883,7 +25153,7 @@ var ts; var errorNode_1 = subsequentNode.name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) && + var reportError = (node.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */) && (node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -24925,7 +25195,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 217 /* InterfaceDeclaration */ || node.parent.kind === 155 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 218 /* InterfaceDeclaration */ || node.parent.kind === 156 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -24936,7 +25206,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 215 /* FunctionDeclaration */ || node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */ || node.kind === 144 /* Constructor */) { + if (node.kind === 216 /* FunctionDeclaration */ || node.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */ || node.kind === 145 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -25076,16 +25346,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 220 /* ModuleDeclaration */: - return d.name.kind === 9 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ + case 221 /* ModuleDeclaration */: + return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -25335,22 +25605,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 138 /* Parameter */: + case 139 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -25363,9 +25633,9 @@ var ts; // When we are emitting type metadata for decorators, we need to try to check the type // as if it were an expression so that we can emit the type in a value position when we // serialize the type metadata. - if (node && node.kind === 151 /* TypeReference */) { + if (node && node.kind === 152 /* TypeReference */) { var root = getFirstIdentifier(node.typeName); - var meaning = root.parent.kind === 151 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = root.parent.kind === 152 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; // Resolve type so we know which symbol is referenced var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); // Resolved symbol is alias @@ -25412,28 +25682,24 @@ var ts; if (compilerOptions.emitDecoratorMetadata) { // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: checkParameterTypeAnnotationsAsExpressions(node); checkReturnTypeAnnotationAsExpression(node); break; - case 141 /* PropertyDeclaration */: - case 138 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 139 /* Parameter */: checkTypeAnnotationAsExpression(node); break; } } - emitDecorate = true; - if (node.kind === 138 /* Parameter */) { - emitParam = true; - } ts.forEach(node.decorators, checkDecorator); } function checkFunctionDeclaration(node) { @@ -25448,13 +25714,10 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 137 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -25470,7 +25733,7 @@ var ts; // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. var firstDeclaration = ts.forEach(localSymbol.declarations, // Get first non javascript function declaration - function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)) ? declaration : undefined; }); // Only type check the symbol once if (node === firstDeclaration) { @@ -25505,7 +25768,7 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 194 /* Block */) { + if (node.kind === 195 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -25525,12 +25788,12 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 141 /* PropertyDeclaration */ || - node.kind === 140 /* PropertySignature */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 142 /* MethodSignature */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 142 /* PropertyDeclaration */ || + node.kind === 141 /* PropertySignature */ || + node.kind === 144 /* MethodDeclaration */ || + node.kind === 143 /* MethodSignature */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -25539,7 +25802,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 138 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 139 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -25592,12 +25855,12 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 220 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 221 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 251 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -25632,7 +25895,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 213 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 214 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -25642,24 +25905,24 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 195 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 215 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 196 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 194 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 221 /* ModuleBlock */ || - container.kind === 220 /* ModuleDeclaration */ || - container.kind === 250 /* SourceFile */); + (container.kind === 195 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 222 /* ModuleBlock */ || + container.kind === 221 /* ModuleDeclaration */ || + container.kind === 251 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail // since LHS will be block scoped name instead of function scoped if (!namesShareScope) { - var name_14 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_14, name_14); + var name_16 = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_16, name_16); } } } @@ -25667,7 +25930,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 138 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 139 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -25678,7 +25941,7 @@ var ts; // check FunctionLikeDeclaration.locals (stores parameters\function local variable) // if it contains entry with a specified name and if this entry matches the resolved symbol if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 138 /* Parameter */) { + if (referencedSymbol.valueDeclaration.kind === 139 /* Parameter */) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -25704,15 +25967,15 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 165 /* BindingElement */) { + if (node.kind === 166 /* BindingElement */) { // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 136 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } } @@ -25721,13 +25984,14 @@ var ts; ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 138 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 139 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - if (node.initializer) { + // Don't validate for-in initializer as it is already an error + if (node.initializer && node.parent.parent.kind !== 203 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -25737,7 +26001,8 @@ var ts; var type = getTypeOfVariableOrParameterOrProperty(symbol); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer - if (node.initializer) { + // Don't validate for-in initializer as it is already an error + if (node.initializer && node.parent.parent.kind !== 203 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -25753,10 +26018,10 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined); } } - if (node.kind !== 141 /* PropertyDeclaration */ && node.kind !== 140 /* PropertySignature */) { + if (node.kind !== 142 /* PropertyDeclaration */ && node.kind !== 141 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { + if (node.kind === 214 /* VariableDeclaration */ || node.kind === 166 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -25779,7 +26044,7 @@ var ts; } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 167 /* ObjectLiteralExpression */) { + if (node.modifiers && node.parent.kind === 168 /* ObjectLiteralExpression */) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -25800,7 +26065,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 196 /* EmptyStatement */) { + if (node.thenStatement.kind === 197 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -25820,12 +26085,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 215 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -25845,14 +26110,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); // There may be a destructuring assignment on the left side - if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { + if (varExpr.kind === 167 /* ArrayLiteralExpression */ || varExpr.kind === 168 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -25881,7 +26146,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -25895,7 +26160,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { + if (varExpr.kind === 167 /* ArrayLiteralExpression */ || varExpr.kind === 168 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258 /* StringLike */)) { @@ -26140,7 +26405,7 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 145 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 146 /* SetAccessor */))); + return !!(node.kind === 146 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 147 /* SetAccessor */))); } function checkReturnStatement(node) { // Grammar checking @@ -26163,10 +26428,10 @@ var ts; // for generators. return; } - if (func.kind === 146 /* SetAccessor */) { + if (func.kind === 147 /* SetAccessor */) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } - else if (func.kind === 144 /* Constructor */) { + else if (func.kind === 145 /* Constructor */) { if (!checkTypeAssignableTo(exprType, returnType, node.expression)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -26208,7 +26473,7 @@ var ts; var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258 /* StringLike */); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 244 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 245 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -26220,7 +26485,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 243 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 244 /* CaseClause */) { var caseClause = clause; // TypeScript 1.0 spec (April 2014):5.9 // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. @@ -26245,7 +26510,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 209 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 210 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -26350,7 +26615,7 @@ var ts; // perform property check if property or indexer is declared in 'type' // this allows to rule out cases when both property and indexer are inherited from the base class var errorNode; - if (prop.valueDeclaration.name.kind === 136 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 137 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -26431,7 +26696,6 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitExtends = emitExtends || !ts.isInAmbientContext(node); var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType = baseTypes[0]; @@ -26532,7 +26796,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(derivedClassDecl.flags & 128 /* Abstract */))) { - if (derivedClassDecl.kind === 188 /* ClassExpression */) { + if (derivedClassDecl.kind === 189 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -26580,7 +26844,7 @@ var ts; } } function isAccessor(kind) { - return kind === 145 /* GetAccessor */ || kind === 146 /* SetAccessor */; + return kind === 146 /* GetAccessor */ || kind === 147 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -26650,7 +26914,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 218 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -26760,7 +27024,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -26771,7 +27035,7 @@ var ts; case 50 /* TildeToken */: return ~value_1; } return undefined; - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -26796,11 +27060,11 @@ var ts; return undefined; case 8 /* NumericLiteral */: return +e.text; - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return evalConstant(e.expression); case 69 /* Identifier */: - case 169 /* ElementAccessExpression */: - case 168 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 169 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -26813,7 +27077,7 @@ var ts; } else { var expression; - if (e.kind === 169 /* ElementAccessExpression */) { + if (e.kind === 170 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9 /* StringLiteral */) { return undefined; @@ -26831,7 +27095,7 @@ var ts; if (current.kind === 69 /* Identifier */) { break; } - else if (current.kind === 168 /* PropertyAccessExpression */) { + else if (current.kind === 169 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -26902,7 +27166,7 @@ var ts; var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 219 /* EnumDeclaration */) { + if (declaration.kind !== 220 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -26925,8 +27189,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 216 /* ClassDeclaration */ || - (declaration.kind === 215 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 217 /* ClassDeclaration */ || + (declaration.kind === 216 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -26949,7 +27213,12 @@ var ts; function checkModuleDeclaration(node) { if (produceDiagnostics) { // Grammar checking - var isAmbientExternalModule = node.name.kind === 9 /* StringLiteral */; + var isGlobalAugmentation = ts.isGlobalScopeAugmentation(node); + var inAmbientContext = ts.isInAmbientContext(node); + if (isGlobalAugmentation && !inAmbientContext) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + } + var isAmbientExternalModule = ts.isAmbientModule(node); var contextErrorMessage = isAmbientExternalModule ? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : ts.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module; @@ -26958,7 +27227,7 @@ var ts; return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!ts.isInAmbientContext(node) && node.name.kind === 9 /* StringLiteral */) { + if (!inAmbientContext && node.name.kind === 9 /* StringLiteral */) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } } @@ -26969,7 +27238,7 @@ var ts; // The following checks only apply on a non-ambient instantiated module declaration. if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) + && !inAmbientContext && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) { var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { @@ -26982,30 +27251,120 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 216 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 217 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; } } - // Checks for ambient external modules. if (isAmbientExternalModule) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + if (ts.isExternalModuleAugmentation(node)) { + // body of the augmentation should be checked for consistency only if augmentation was applied to its target (either global scope or module) + // otherwise we'll be swamped in cascading errors. + // We can detect if augmentation was applied using following rules: + // - augmentation for a global scope is always applied + // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module). + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432 /* Merged */); + if (checkBody) { + // body of ambient external module is always a module block + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + checkModuleAugmentationElement(statement, isGlobalAugmentation); + } + } } - if (ts.isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + else if (isGlobalSourceFile(node.parent)) { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else if (ts.isExternalModuleNameRelative(node.name.text)) { + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + } + } + else { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else { + // Node is not an augmentation and is not located on the script level. + // This means that this is declaration of ambient module that is located in other module or namespace which is prohibited. + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + } } } } checkSourceElement(node.body); } + function checkModuleAugmentationElement(node, isGlobalAugmentation) { + switch (node.kind) { + case 196 /* VariableStatement */: + // error each individual name in variable statement instead of marking the entire variable statement + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + checkModuleAugmentationElement(decl, isGlobalAugmentation); + } + break; + case 230 /* ExportAssignment */: + case 231 /* ExportDeclaration */: + grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); + break; + case 224 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind !== 9 /* StringLiteral */) { + error(node.name, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + break; + } + // fallthrough + case 225 /* ImportDeclaration */: + grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); + break; + case 166 /* BindingElement */: + case 214 /* VariableDeclaration */: + var name_17 = node.name; + if (ts.isBindingPattern(name_17)) { + for (var _b = 0, _c = name_17.elements; _b < _c.length; _b++) { + var el = _c[_b]; + // mark individual names in binding pattern + checkModuleAugmentationElement(el, isGlobalAugmentation); + } + break; + } + // fallthrough + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 216 /* FunctionDeclaration */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 219 /* TypeAliasDeclaration */: + var symbol = getSymbolOfNode(node); + if (symbol) { + // module augmentations cannot introduce new names on the top level scope of the module + // this is done it two steps + // 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error + // 2. main check - report error if value declaration of the parent symbol is module augmentation) + var reportError = !(symbol.flags & 33554432 /* Merged */); + if (!reportError) { + if (isGlobalAugmentation) { + // global symbol should not have parent since it is not explicitly exported + reportError = symbol.parent !== undefined; + } + else { + // symbol should not originate in augmentation + reportError = ts.isExternalModuleAugmentation(symbol.parent.valueDeclaration); + } + } + if (reportError) { + error(node, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + } + } + break; + } + } function getFirstIdentifier(node) { while (true) { - if (node.kind === 135 /* QualifiedName */) { + if (node.kind === 136 /* QualifiedName */) { node = node.left; } - else if (node.kind === 168 /* PropertyAccessExpression */) { + else if (node.kind === 169 /* PropertyAccessExpression */) { node = node.expression; } else { @@ -27021,20 +27380,24 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 230 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 222 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 231 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } if (inAmbientExternalModule && ts.isExternalModuleNameRelative(moduleName.text)) { - // TypeScript 1.0 spec (April 2013): 12.1.6 - // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference - // other external modules only through top - level external module names. - // Relative external module names are not permitted. - error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); - return false; + // we have already reported errors on top level imports\exports in external module augmentations in checkModuleDeclaration + // no need to do this again. + if (!isTopLevelInExternalModuleAugmentation(node)) { + // TypeScript 1.0 spec (April 2013): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference + // other external modules only through top - level external module names. + // Relative external module names are not permitted. + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + return false; + } } return true; } @@ -27046,7 +27409,7 @@ var ts; (symbol.flags & 793056 /* Type */ ? 793056 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 232 /* ExportSpecifier */ ? + var message = node.kind === 233 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -27073,7 +27436,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 227 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -27130,8 +27493,8 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 222 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 /* SourceFile */ && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -27145,14 +27508,23 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 250 /* SourceFile */ && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 220 /* ModuleDeclaration */) { + if (node.parent.kind !== 251 /* SourceFile */ && node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 221 /* ModuleDeclaration */) { return grammarErrorOnFirstToken(node, errorMessage); } } function checkExportSpecifier(node) { checkAliasSymbol(node); if (!node.parent.parent.moduleSpecifier) { - markExportAsReferenced(node); + var exportedName = node.propertyName || node.name; + // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases) + var symbol = resolveName(exportedName, exportedName.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */, + /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + if (symbol && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0]))) { + error(exportedName, ts.Diagnostics.Cannot_re_export_name_that_is_not_defined_in_the_module); + } + else { + markExportAsReferenced(node); + } } } function checkExportAssignment(node) { @@ -27160,8 +27532,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 250 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 220 /* ModuleDeclaration */ && container.name.kind === 69 /* Identifier */) { + var container = node.parent.kind === 251 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 221 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -27202,7 +27574,9 @@ var ts; var exportEqualsSymbol = moduleSymbol.exports["export="]; if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + if (!isTopLevelInExternalModuleAugmentation(declaration)) { + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } } // Checks for export * conflicts var exports = getExportsOfModule(moduleSymbol); @@ -27225,21 +27599,7 @@ var ts; links.exportsChecked = true; } function isNotOverload(declaration) { - return declaration.kind !== 215 /* FunctionDeclaration */ || !!declaration.body; - } - } - function checkTypePredicate(node) { - var parameterName = node.parameterName; - if (parameterName.kind === 69 /* Identifier */ && !isInLegalParameterTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } - else if (parameterName.kind === 161 /* ThisType */) { - if (!isInLegalThisTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); - } - else { - getTypeFromThisTypeNode(parameterName); - } + return declaration.kind !== 216 /* FunctionDeclaration */ || !!declaration.body; } } function checkSourceElement(node) { @@ -27251,118 +27611,118 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessivly // hitting the cancellation token on every node we check. switch (kind) { - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return checkTypeParameter(node); - case 138 /* Parameter */: + case 139 /* Parameter */: return checkParameter(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return checkPropertyDeclaration(node); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: return checkSignatureDeclaration(node); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return checkMethodDeclaration(node); - case 144 /* Constructor */: + case 145 /* Constructor */: return checkConstructorDeclaration(node); - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return checkAccessorDeclaration(node); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return checkTypeReferenceNode(node); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return checkTypePredicate(node); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return checkTypeQuery(node); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return checkTypeLiteral(node); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return checkArrayType(node); - case 157 /* TupleType */: + case 158 /* TupleType */: return checkTupleType(node); - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return checkSourceElement(node.type); - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return checkBlock(node); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return checkVariableStatement(node); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return checkExpressionStatement(node); - case 198 /* IfStatement */: + case 199 /* IfStatement */: return checkIfStatement(node); - case 199 /* DoStatement */: + case 200 /* DoStatement */: return checkDoStatement(node); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: return checkWhileStatement(node); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return checkForStatement(node); - case 202 /* ForInStatement */: + case 203 /* ForInStatement */: return checkForInStatement(node); - case 203 /* ForOfStatement */: + case 204 /* ForOfStatement */: return checkForOfStatement(node); - case 204 /* ContinueStatement */: - case 205 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 206 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return checkReturnStatement(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return checkWithStatement(node); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return checkSwitchStatement(node); - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return checkLabeledStatement(node); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: return checkThrowStatement(node); - case 211 /* TryStatement */: + case 212 /* TryStatement */: return checkTryStatement(node); - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 165 /* BindingElement */: + case 166 /* BindingElement */: return checkBindingElement(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return checkClassDeclaration(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return checkImportDeclaration(node); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return checkExportDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return checkExportAssignment(node); - case 196 /* EmptyStatement */: + case 197 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 212 /* DebuggerStatement */: + case 213 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 233 /* MissingDeclaration */: + case 234 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -27384,17 +27744,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: checkAccessorDeferred(node); break; - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -27420,10 +27780,6 @@ var ts; } // Grammar checking checkGrammarSourceFile(node); - emitExtends = false; - emitDecorate = false; - emitParam = false; - emitAwaiter = false; potentialThisCollisions.length = 0; deferredNodes = []; ts.forEach(node.statements, checkSourceElement); @@ -27436,21 +27792,6 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } - if (emitExtends) { - links.flags |= 8 /* EmitExtends */; - } - if (emitDecorate) { - links.flags |= 16 /* EmitDecorate */; - } - if (emitParam) { - links.flags |= 32 /* EmitParam */; - } - if (emitAwaiter) { - links.flags |= 64 /* EmitAwaiter */; - } - if (emitGenerator || (emitAwaiter && languageVersion < 2 /* ES6 */)) { - links.flags |= 128 /* EmitGenerator */; - } links.flags |= 1 /* TypeChecked */; } } @@ -27488,7 +27829,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 207 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 208 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -27511,25 +27852,25 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } // fall through; this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -27538,7 +27879,7 @@ var ts; copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 175 /* FunctionExpression */: + case 176 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -27587,37 +27928,37 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 137 /* TypeParameter */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 219 /* EnumDeclaration */: + case 138 /* TypeParameter */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 220 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 135 /* QualifiedName */) { + while (node.parent && node.parent.kind === 136 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 151 /* TypeReference */; + return node.parent && node.parent.kind === 152 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 168 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 169 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 190 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 191 /* ExpressionWithTypeArguments */; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 135 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 136 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 223 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 224 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 229 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 230 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -27629,11 +27970,11 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 229 /* ExportAssignment */) { + if (entityName.parent.kind === 230 /* ExportAssignment */) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 168 /* PropertyAccessExpression */) { + if (entityName.kind !== 169 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); @@ -27645,7 +27986,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 190 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 191 /* ExpressionWithTypeArguments */) { meaning = 793056 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -27658,9 +27999,9 @@ var ts; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 237 /* JsxOpeningElement */) || - (entityName.parent.kind === 236 /* JsxSelfClosingElement */) || - (entityName.parent.kind === 239 /* JsxClosingElement */)) { + else if ((entityName.parent.kind === 238 /* JsxOpeningElement */) || + (entityName.parent.kind === 237 /* JsxSelfClosingElement */) || + (entityName.parent.kind === 240 /* JsxClosingElement */)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -27674,14 +28015,14 @@ var ts; var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 168 /* PropertyAccessExpression */) { + else if (entityName.kind === 169 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 135 /* QualifiedName */) { + else if (entityName.kind === 136 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -27690,16 +28031,16 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 151 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = entityName.parent.kind === 152 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead // return the alias symbol. meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 240 /* JsxAttribute */) { + else if (entityName.parent.kind === 241 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 150 /* TypePredicate */) { + if (entityName.parent.kind === 151 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? @@ -27716,12 +28057,12 @@ var ts; } if (node.kind === 69 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 229 /* ExportAssignment */ + return node.parent.kind === 230 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 165 /* BindingElement */ && - node.parent.parent.kind === 163 /* ObjectBindingPattern */ && + else if (node.parent.kind === 166 /* BindingElement */ && + node.parent.parent.kind === 164 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -27732,19 +28073,19 @@ var ts; } switch (node.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97 /* ThisKeyword */: case 95 /* SuperKeyword */: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 161 /* ThisType */: + case 162 /* ThisType */: return getTypeFromTypeNode(node).symbol; case 121 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 144 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 145 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -27752,14 +28093,14 @@ var ts; // External module name in an import declaration if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 224 /* ImportDeclaration */ || node.parent.kind === 230 /* ExportDeclaration */) && + ((node.parent.kind === 225 /* ImportDeclaration */ || node.parent.kind === 231 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } // Fall through case 8 /* NumericLiteral */: // index access - if (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind === 170 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -27776,11 +28117,17 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 248 /* ShorthandPropertyAssignment */) { - return resolveEntityName(location.name, 107455 /* Value */); + if (location && location.kind === 249 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location.name, 107455 /* Value */ | 8388608 /* Alias */); } return undefined; } + /** Returns the target of an export specifier without following aliases */ + function getExportSpecifierLocalTargetSymbol(node) { + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); + } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { // We cannot answer semantic questions within a with block, do not proceed any further @@ -27858,9 +28205,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456 /* SyntheticProperty */) { var symbols = []; - var name_15 = symbol.name; + var name_18 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_15); + var symbol = getPropertyOfType(t, name_18); if (symbol) { symbols.push(symbol); } @@ -27920,11 +28267,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 250 /* SourceFile */) { + if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 251 /* SourceFile */) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 220 /* ModuleDeclaration */ || n.kind === 219 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 221 /* ModuleDeclaration */ || n.kind === 220 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -27939,11 +28286,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 194 /* Block */: - case 222 /* CaseBlock */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 195 /* Block */: + case 223 /* CaseBlock */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: return true; } return false; @@ -27973,22 +28320,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 223 /* ImportEqualsDeclaration */: - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return node.expression && node.expression.kind === 69 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 250 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 251 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -28050,7 +28397,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 249 /* EnumMember */) { + if (node.kind === 250 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -28172,23 +28519,38 @@ var ts; } function getExternalModuleFileFromDeclaration(declaration) { var specifier = ts.getExternalModuleName(declaration); - var moduleSymbol = getSymbolAtLocation(specifier); + var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 250 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 251 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file, compilerOptions); }); + var augmentations; // Initialize global symbol table ts.forEach(host.getSourceFiles(), function (file) { if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } + if (file.moduleAugmentations) { + (augmentations || (augmentations = [])).push(file.moduleAugmentations); + } }); + if (augmentations) { + // merge module augmentations. + // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed + for (var _i = 0, augmentations_1 = augmentations; _i < augmentations_1.length; _i++) { + var list = augmentations_1[_i]; + for (var _a = 0, list_2 = list; _a < list_2.length; _a++) { + var augmentation = list_2[_a]; + mergeModuleAugmentation(augmentation); + } + } + } // Setup global builtins addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; @@ -28262,14 +28624,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 143 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 144 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 145 /* GetAccessor */ || node.kind === 146 /* SetAccessor */) { + else if (node.kind === 146 /* GetAccessor */ || node.kind === 147 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -28279,38 +28641,38 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 149 /* IndexSignature */: - case 220 /* ModuleDeclaration */: - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 230 /* ExportDeclaration */: - case 229 /* ExportAssignment */: - case 138 /* Parameter */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 145 /* Constructor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 150 /* IndexSignature */: + case 221 /* ModuleDeclaration */: + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 231 /* ExportDeclaration */: + case 230 /* ExportAssignment */: + case 139 /* Parameter */: break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118 /* AsyncKeyword */) && - node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { + node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 251 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 195 /* VariableStatement */: - case 218 /* TypeAliasDeclaration */: - if (node.modifiers && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 196 /* VariableStatement */: + case 219 /* TypeAliasDeclaration */: + if (node.modifiers && node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 251 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74 /* ConstKeyword */) && - node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { + node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 251 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -28326,7 +28688,7 @@ var ts; var modifier = _a[_i]; switch (modifier.kind) { case 74 /* ConstKeyword */: - if (node.kind !== 219 /* EnumDeclaration */ && node.parent.kind === 216 /* ClassDeclaration */) { + if (node.kind !== 220 /* EnumDeclaration */ && node.parent.kind === 217 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74 /* ConstKeyword */)); } break; @@ -28354,7 +28716,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { + else if (node.parent.kind === 222 /* ModuleBlock */ || node.parent.kind === 251 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128 /* Abstract */) { @@ -28374,10 +28736,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { + else if (node.parent.kind === 222 /* ModuleBlock */ || node.parent.kind === 251 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -28399,10 +28761,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 2 /* Export */; @@ -28414,13 +28776,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 222 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4 /* Ambient */; @@ -28430,11 +28792,11 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 216 /* ClassDeclaration */) { - if (node.kind !== 143 /* MethodDeclaration */) { + if (node.kind !== 217 /* ClassDeclaration */) { + if (node.kind !== 144 /* MethodDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 216 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { + if (!(node.parent.kind === 217 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64 /* Static */) { @@ -28453,7 +28815,7 @@ var ts; else if (flags & 4 /* Ambient */ || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -28461,7 +28823,7 @@ var ts; break; } } - if (node.kind === 144 /* Constructor */) { + if (node.kind === 145 /* Constructor */) { if (flags & 64 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -28479,10 +28841,10 @@ var ts; } return; } - else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { + else if ((node.kind === 225 /* ImportDeclaration */ || node.kind === 224 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 138 /* Parameter */ && (flags & 56 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 139 /* Parameter */ && (flags & 56 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } if (flags & 256 /* Async */) { @@ -28494,10 +28856,10 @@ var ts; return grammarErrorOnNode(asyncModifier, ts.Diagnostics.Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher); } switch (node.kind) { - case 143 /* MethodDeclaration */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: if (!node.asteriskToken) { return false; } @@ -28563,7 +28925,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 176 /* ArrowFunction */) { + if (node.kind === 177 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -28631,7 +28993,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 189 /* OmittedExpression */) { + if (arg.kind === 190 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -28705,19 +29067,19 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 136 /* ComputedPropertyName */) { + if (node.kind !== 137 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 183 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { + if (computedPropertyName.expression.kind === 184 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 215 /* FunctionDeclaration */ || - node.kind === 175 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 216 /* FunctionDeclaration */ || + node.kind === 176 /* FunctionExpression */ || + node.kind === 144 /* MethodDeclaration */); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -28741,21 +29103,21 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var _loop_1 = function(prop) { - var name_16 = prop.name; - if (prop.kind === 189 /* OmittedExpression */ || - name_16.kind === 136 /* ComputedPropertyName */) { + var name_19 = prop.name; + if (prop.kind === 190 /* OmittedExpression */ || + name_19.kind === 137 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it - checkGrammarComputedPropertyName(name_16); + checkGrammarComputedPropertyName(name_19); return "continue"; } - if (prop.kind === 248 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 249 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } // Modifiers are never allowed on properties except for 'async' on a method declaration ts.forEach(prop.modifiers, function (mod) { - if (mod.kind !== 118 /* AsyncKeyword */ || prop.kind !== 143 /* MethodDeclaration */) { + if (mod.kind !== 118 /* AsyncKeyword */ || prop.kind !== 144 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } }); @@ -28768,44 +29130,44 @@ var ts; // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */) { + if (prop.kind === 248 /* PropertyAssignment */ || prop.kind === 249 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_16.kind === 8 /* NumericLiteral */) { - checkGrammarNumericLiteral(name_16); + if (name_19.kind === 8 /* NumericLiteral */) { + checkGrammarNumericLiteral(name_19); } currentKind = Property; } - else if (prop.kind === 143 /* MethodDeclaration */) { + else if (prop.kind === 144 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 145 /* GetAccessor */) { + else if (prop.kind === 146 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 146 /* SetAccessor */) { + else if (prop.kind === 147 /* SetAccessor */) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_16.text)) { - seen[name_16.text] = currentKind; + if (!ts.hasProperty(seen, name_19.text)) { + seen[name_19.text] = currentKind; } else { - var existingKind = seen[name_16.text]; + var existingKind = seen[name_19.text]; if (currentKind === Property && existingKind === Property) { return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name_16.text] = currentKind | existingKind; + seen[name_19.text] = currentKind | existingKind; } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } }; @@ -28820,19 +29182,19 @@ var ts; var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 241 /* JsxSpreadAttribute */) { + if (attr.kind === 242 /* JsxSpreadAttribute */) { continue; } var jsxAttr = attr; - var name_17 = jsxAttr.name; - if (!ts.hasProperty(seen, name_17.text)) { - seen[name_17.text] = true; + var name_20 = jsxAttr.name; + if (!ts.hasProperty(seen, name_20.text)) { + seen[name_20.text] = true; } else { - return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name_20, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 242 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 243 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -28841,7 +29203,7 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 214 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 215 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -28856,20 +29218,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 203 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 203 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 203 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -28892,10 +29254,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 145 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 146 /* GetAccessor */ && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 146 /* SetAccessor */) { + else if (kind === 147 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -28930,12 +29292,12 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 167 /* ObjectLiteralExpression */) { + if (node.parent.kind === 168 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } else if (node.body === undefined) { - return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -28954,10 +29316,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 217 /* InterfaceDeclaration */) { + else if (node.parent.kind === 218 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 155 /* TypeLiteral */) { + else if (node.parent.kind === 156 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -28968,11 +29330,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 204 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 205 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -28980,8 +29342,8 @@ var ts; return false; } break; - case 208 /* SwitchStatement */: - if (node.kind === 205 /* BreakStatement */ && !node.label) { + case 209 /* SwitchStatement */: + if (node.kind === 206 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -28996,13 +29358,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 205 /* BreakStatement */ + var message = node.kind === 206 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 205 /* BreakStatement */ + var message = node.kind === 206 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -29014,7 +29376,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 164 /* ArrayBindingPattern */ || node.name.kind === 163 /* ObjectBindingPattern */) { + if (node.name.kind === 165 /* ArrayBindingPattern */ || node.name.kind === 164 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -29024,7 +29386,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 202 /* ForInStatement */ && node.parent.parent.kind !== 203 /* ForOfStatement */) { + if (node.parent.parent.kind !== 203 /* ForInStatement */ && node.parent.parent.kind !== 204 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { // Error on equals token which immediate precedes the initializer @@ -29060,7 +29422,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 189 /* OmittedExpression */) { + if (element.kind !== 190 /* OmittedExpression */) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -29077,15 +29439,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: return false; - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -29141,7 +29503,7 @@ var ts; return true; } } - else if (node.parent.kind === 217 /* InterfaceDeclaration */) { + else if (node.parent.kind === 218 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -29149,7 +29511,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 155 /* TypeLiteral */) { + else if (node.parent.kind === 156 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -29174,12 +29536,12 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 217 /* InterfaceDeclaration */ || - node.kind === 218 /* TypeAliasDeclaration */ || - node.kind === 224 /* ImportDeclaration */ || - node.kind === 223 /* ImportEqualsDeclaration */ || - node.kind === 230 /* ExportDeclaration */ || - node.kind === 229 /* ExportAssignment */ || + if (node.kind === 218 /* InterfaceDeclaration */ || + node.kind === 219 /* TypeAliasDeclaration */ || + node.kind === 225 /* ImportDeclaration */ || + node.kind === 224 /* ImportEqualsDeclaration */ || + node.kind === 231 /* ExportDeclaration */ || + node.kind === 230 /* ExportAssignment */ || (node.flags & 4 /* Ambient */) || (node.flags & (2 /* Export */ | 512 /* Default */))) { return false; @@ -29189,7 +29551,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 195 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 196 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -29215,7 +29577,7 @@ var ts; // to prevent noisyness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 194 /* Block */ || node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { + if (node.parent.kind === 195 /* Block */ || node.parent.kind === 222 /* ModuleBlock */ || node.parent.kind === 251 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -29255,8 +29617,9 @@ var ts; getSourceMapData: function () { return undefined; }, setSourceFile: function (sourceFile) { }, emitStart: function (range) { }, - emitEnd: function (range) { }, + emitEnd: function (range, stopOverridingSpan) { }, emitPos: function (pos) { }, + changeEmitSourcePos: function () { }, getText: function () { return undefined; }, getSourceMappingURL: function () { return undefined; }, initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, @@ -29270,6 +29633,8 @@ var ts; var compilerOptions = host.getCompilerOptions(); var currentSourceFile; var sourceMapDir; // The directory in which sourcemap will be + var stopOverridingSpan = false; + var modifyLastSourcePos = false; // Current source map file and its index in the sources list var sourceMapSourceIndex; // Last recorded and encoded spans @@ -29284,6 +29649,7 @@ var ts; emitPos: emitPos, emitStart: emitStart, emitEnd: emitEnd, + changeEmitSourcePos: changeEmitSourcePos, getText: getText, getSourceMappingURL: getSourceMappingURL, initialize: initialize, @@ -29358,6 +29724,39 @@ var ts; lastEncodedNameIndex = undefined; sourceMapData = undefined; } + function updateLastEncodedAndRecordedSpans() { + if (modifyLastSourcePos) { + // Reset the source pos + modifyLastSourcePos = false; + // Change Last recorded Map with last encoded emit line and character + lastRecordedSourceMapSpan.emittedLine = lastEncodedSourceMapSpan.emittedLine; + lastRecordedSourceMapSpan.emittedColumn = lastEncodedSourceMapSpan.emittedColumn; + // Pop sourceMapDecodedMappings to remove last entry + sourceMapData.sourceMapDecodedMappings.pop(); + // Change the last encoded source map + lastEncodedSourceMapSpan = sourceMapData.sourceMapDecodedMappings.length ? + sourceMapData.sourceMapDecodedMappings[sourceMapData.sourceMapDecodedMappings.length - 1] : + undefined; + // TODO: Update lastEncodedNameIndex + // Since we dont support this any more, lets not worry about it right now. + // When we start supporting nameIndex, we will get back to this + // Change the encoded source map + var sourceMapMappings = sourceMapData.sourceMapMappings; + var lenthToSet = sourceMapMappings.length - 1; + for (; lenthToSet >= 0; lenthToSet--) { + var currentChar = sourceMapMappings.charAt(lenthToSet); + if (currentChar === ",") { + // Separator for the entry found + break; + } + if (currentChar === ";" && lenthToSet !== 0 && sourceMapMappings.charAt(lenthToSet - 1) !== ";") { + // Last line separator found + break; + } + } + sourceMapData.sourceMapMappings = sourceMapMappings.substr(0, Math.max(0, lenthToSet)); + } + } // Encoding for sourcemap span function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { @@ -29388,6 +29787,7 @@ var ts; sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); // 5. Relative namePosition 0 based if (lastRecordedSourceMapSpan.nameIndex >= 0) { + ts.Debug.assert(false, "We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this"); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; } @@ -29421,20 +29821,30 @@ var ts; sourceColumn: sourceLinePos.character, sourceIndex: sourceMapSourceIndex }; + stopOverridingSpan = false; } - else { + else if (!stopOverridingSpan) { // Take the new pos instead since there is no change in emittedLine and column since last location lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } + updateLastEncodedAndRecordedSpans(); + } + function getStartPos(range) { + var rangeHasDecorators = !!range.decorators; + return range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1; } function emitStart(range) { - var rangeHasDecorators = !!range.decorators; - emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + emitPos(getStartPos(range)); } - function emitEnd(range) { + function emitEnd(range, stopOverridingEnd) { emitPos(range.end); + stopOverridingSpan = stopOverridingEnd; + } + function changeEmitSourcePos() { + ts.Debug.assert(!modifyLastSourcePos); + modifyLastSourcePos = true; } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -29536,6 +29946,7 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; + var resultHasExternalModuleIndicator; var currentText; var currentLineMap; var currentIdentifiers; @@ -29577,6 +29988,7 @@ var ts; } }); } + resultHasExternalModuleIndicator = false; if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { noDeclare = false; emitSourceFile(sourceFile); @@ -29596,7 +30008,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 224 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 225 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -29613,6 +30025,13 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } + if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { + // if file was external module with augmentations - this fact should be preserved in .d.ts as well. + // in case if we didn't write any external module specifiers in .d.ts we need to emit something + // that will force compiler to think that this file is an external module - 'export {}' is a reasonable choice here. + write("export {};"); + writeLine(); + } }); return { reportedDeclarationError: reportedDeclarationError, @@ -29659,10 +30078,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 213 /* VariableDeclaration */) { + if (declaration.kind === 214 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 227 /* NamedImports */ || declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 225 /* ImportClause */) { + else if (declaration.kind === 228 /* NamedImports */ || declaration.kind === 229 /* ImportSpecifier */ || declaration.kind === 226 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -29680,7 +30099,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 224 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 225 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -29690,12 +30109,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 221 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 221 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -29803,35 +30222,35 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 161 /* ThisType */: - case 162 /* StringLiteralType */: + case 162 /* ThisType */: + case 163 /* StringLiteralType */: return writeTextOfNode(currentText, type); - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return emitTypeReference(type); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return emitTypeQuery(type); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return emitArrayType(type); - case 157 /* TupleType */: + case 158 /* TupleType */: return emitTupleType(type); - case 158 /* UnionType */: + case 159 /* UnionType */: return emitUnionType(type); - case 159 /* IntersectionType */: + case 160 /* IntersectionType */: return emitIntersectionType(type); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return emitParenType(type); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return emitTypeLiteral(type); case 69 /* Identifier */: return emitEntityName(type); - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return emitEntityName(type); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -29839,8 +30258,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 135 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 135 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 136 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 136 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -29849,13 +30268,13 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 223 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 224 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 168 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 169 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -29934,9 +30353,9 @@ var ts; var count = 0; while (true) { count++; - var name_18 = baseName + "_" + count; - if (!ts.hasProperty(currentIdentifiers, name_18)) { - return name_18; + var name_21 = baseName + "_" + count; + if (!ts.hasProperty(currentIdentifiers, name_21)) { + return name_21; } } } @@ -29980,10 +30399,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 223 /* ImportEqualsDeclaration */ || - (node.parent.kind === 250 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 224 /* ImportEqualsDeclaration */ || + (node.parent.kind === 251 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 251 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -29993,7 +30412,7 @@ var ts; }); } else { - if (node.kind === 224 /* ImportDeclaration */) { + if (node.kind === 225 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -30011,23 +30430,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return writeVariableStatement(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return writeClassDeclaration(node); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -30035,7 +30454,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 250 /* SourceFile */) { + if (node.parent.kind === 251 /* SourceFile */) { // If the node is exported if (node.flags & 2 /* Export */) { write("export "); @@ -30043,7 +30462,7 @@ var ts; if (node.flags & 512 /* Default */) { write("default "); } - else if (node.kind !== 217 /* InterfaceDeclaration */ && !noDeclare) { + else if (node.kind !== 218 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -30092,7 +30511,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 226 /* NamespaceImport */) { + if (namedBindings.kind === 227 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -30120,7 +30539,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 227 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -30137,11 +30556,19 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { + // emitExternalModuleSpecifier is usually called when we emit something in the.d.ts file that will make it an external module (i.e. import/export declarations). + // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered + // external modules since they are indistingushable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' + // so compiler will treat them as external modules. + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 221 /* ModuleDeclaration */; var moduleSpecifier; - if (parent.kind === 223 /* ImportEqualsDeclaration */) { + if (parent.kind === 224 /* ImportEqualsDeclaration */) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } + else if (parent.kind === 221 /* ModuleDeclaration */) { + moduleSpecifier = parent.name; + } else { var node = parent; moduleSpecifier = node.moduleSpecifier; @@ -30192,14 +30619,24 @@ var ts; function writeModuleDeclaration(node) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); - if (node.flags & 65536 /* Namespace */) { - write("namespace "); + if (ts.isGlobalScopeAugmentation(node)) { + write("global "); } else { - write("module "); + if (node.flags & 65536 /* Namespace */) { + write("namespace "); + } + else { + write("module "); + } + if (ts.isExternalModuleAugmentation(node)) { + emitExternalModuleSpecifier(node); + } + else { + writeTextOfNode(currentText, node.name); + } } - writeTextOfNode(currentText, node.name); - while (node.body.kind !== 221 /* ModuleBlock */) { + while (node.body.kind !== 222 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -30264,7 +30701,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 143 /* MethodDeclaration */ && (node.parent.flags & 16 /* Private */); + return node.parent.kind === 144 /* MethodDeclaration */ && (node.parent.flags & 16 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -30275,15 +30712,15 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 152 /* FunctionType */ || - node.parent.kind === 153 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 155 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 143 /* MethodDeclaration */ || - node.parent.kind === 142 /* MethodSignature */ || - node.parent.kind === 152 /* FunctionType */ || - node.parent.kind === 153 /* ConstructorType */ || - node.parent.kind === 147 /* CallSignature */ || - node.parent.kind === 148 /* ConstructSignature */); + if (node.parent.kind === 153 /* FunctionType */ || + node.parent.kind === 154 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 156 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 144 /* MethodDeclaration */ || + node.parent.kind === 143 /* MethodSignature */ || + node.parent.kind === 153 /* FunctionType */ || + node.parent.kind === 154 /* ConstructorType */ || + node.parent.kind === 148 /* CallSignature */ || + node.parent.kind === 149 /* ConstructSignature */); emitType(node.constraint); } else { @@ -30294,31 +30731,31 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 147 /* CallSignature */: + case 148 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.parent.flags & 64 /* Static */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 217 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -30352,7 +30789,7 @@ var ts; function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 216 /* ClassDeclaration */) { + if (node.parent.parent.kind === 217 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -30436,7 +30873,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 213 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 214 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -30446,10 +30883,10 @@ var ts; // what we want, namely the name expression enclosed in brackets. writeTextOfNode(currentText, node.name); // If optional property emit ? - if ((node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) && ts.hasQuestionToken(node)) { + if ((node.kind === 142 /* PropertyDeclaration */ || node.kind === 141 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) && node.parent.kind === 155 /* TypeLiteral */) { + if ((node.kind === 142 /* PropertyDeclaration */ || node.kind === 141 /* PropertySignature */) && node.parent.kind === 156 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 16 /* Private */)) { @@ -30458,14 +30895,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 213 /* VariableDeclaration */) { + if (node.kind === 214 /* VariableDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) { + else if (node.kind === 142 /* PropertyDeclaration */ || node.kind === 141 /* PropertySignature */) { // TODO(jfreeman): Deal with computed properties in error reporting. if (node.flags & 64 /* Static */) { return symbolAccesibilityResult.errorModuleName ? @@ -30474,7 +30911,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -30506,7 +30943,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189 /* OmittedExpression */) { + if (element.kind !== 190 /* OmittedExpression */) { elements.push(element); } } @@ -30576,7 +31013,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 145 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 146 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -30589,7 +31026,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 145 /* GetAccessor */ + return accessor.kind === 146 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -30598,7 +31035,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 146 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 147 /* SetAccessor */) { // Setters have to have type named and cannot infer it so, the type should always be named if (accessorWithTypeAnnotation.parent.flags & 64 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? @@ -30648,17 +31085,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 143 /* MethodDeclaration */) { + else if (node.kind === 144 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 144 /* Constructor */) { + else if (node.kind === 145 /* Constructor */) { write("constructor"); } else { @@ -30678,11 +31115,11 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; // Construct signature or constructor type write new Signature - if (node.kind === 148 /* ConstructSignature */ || node.kind === 153 /* ConstructorType */) { + if (node.kind === 149 /* ConstructSignature */ || node.kind === 154 /* ConstructorType */) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 149 /* IndexSignature */) { + if (node.kind === 150 /* IndexSignature */) { write("["); } else { @@ -30690,22 +31127,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 149 /* IndexSignature */) { + if (node.kind === 150 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 152 /* FunctionType */ || node.kind === 153 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 155 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 153 /* FunctionType */ || node.kind === 154 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 156 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 144 /* Constructor */ && !(node.flags & 16 /* Private */)) { + else if (node.kind !== 145 /* Constructor */ && !(node.flags & 16 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -30716,26 +31153,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 147 /* CallSignature */: + case 148 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.flags & 64 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -30743,7 +31180,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -30757,7 +31194,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -30792,9 +31229,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 152 /* FunctionType */ || - node.parent.kind === 153 /* ConstructorType */ || - node.parent.parent.kind === 155 /* TypeLiteral */) { + if (node.parent.kind === 153 /* FunctionType */ || + node.parent.kind === 154 /* ConstructorType */ || + node.parent.parent.kind === 156 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 16 /* Private */)) { @@ -30810,24 +31247,24 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 144 /* Constructor */: + case 145 /* Constructor */: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 147 /* CallSignature */: + case 148 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.parent.flags & 64 /* Static */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -30835,7 +31272,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 217 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -30848,7 +31285,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -30860,12 +31297,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 163 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 164 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 164 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 165 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -30876,7 +31313,7 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 189 /* OmittedExpression */) { + if (bindingElement.kind === 190 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -30885,7 +31322,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 165 /* BindingElement */) { + else if (bindingElement.kind === 166 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -30924,40 +31361,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: - case 220 /* ModuleDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 217 /* InterfaceDeclaration */: - case 216 /* ClassDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 219 /* EnumDeclaration */: + case 216 /* FunctionDeclaration */: + case 221 /* ModuleDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 218 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 220 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return emitExportDeclaration(node); - case 144 /* Constructor */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 145 /* Constructor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return writeFunctionDeclaration(node); - case 148 /* ConstructSignature */: - case 147 /* CallSignature */: - case 149 /* IndexSignature */: + case 149 /* ConstructSignature */: + case 148 /* CallSignature */: + case 150 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return emitAccessorDeclaration(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return emitPropertyDeclaration(node); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return emitExportAssignment(node); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return emitSourceFile(node); } } @@ -31317,7 +31754,7 @@ var ts; var metadataHelper = "\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; // emit output for the __param helper function var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; - var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; + var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new P(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.call(thisArg, _arguments)).next());\n });\n};"; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); @@ -31415,6 +31852,7 @@ var ts; var isOwnFileEmit; /** If removeComments is true, no leading-comments needed to be emitted **/ var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; + var setSourceMapWriterEmit = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? changeSourceMapEmit : function (writer) { }; var moduleEmitDelegates = (_a = {}, _a[5 /* ES6 */] = emitES6Module, _a[2 /* AMD */] = emitAMDModule, @@ -31499,10 +31937,10 @@ var ts; // Note that names generated by makeTempVariableName and makeUniqueName will never conflict. function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_19 = flags === 268435456 /* _i */ ? "_i" : "_n"; - if (isUniqueName(name_19)) { + var name_22 = flags === 268435456 /* _i */ ? "_i" : "_n"; + if (isUniqueName(name_22)) { tempFlags |= flags; - return name_19; + return name_22; } } while (true) { @@ -31510,9 +31948,9 @@ var ts; tempFlags++; // Skip over 'i' and 'n' if (count !== 8 && count !== 13) { - var name_20 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - if (isUniqueName(name_20)) { - return name_20; + var name_23 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); + if (isUniqueName(name_23)) { + return name_23; } } } @@ -31556,17 +31994,17 @@ var ts; switch (node.kind) { case 69 /* Identifier */: return makeUniqueName(node.text); - case 220 /* ModuleDeclaration */: - case 219 /* EnumDeclaration */: + case 221 /* ModuleDeclaration */: + case 220 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 224 /* ImportDeclaration */: - case 230 /* ExportDeclaration */: + case 225 /* ImportDeclaration */: + case 231 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 215 /* FunctionDeclaration */: - case 216 /* ClassDeclaration */: - case 229 /* ExportAssignment */: + case 216 /* FunctionDeclaration */: + case 217 /* ClassDeclaration */: + case 230 /* ExportAssignment */: return generateNameForExportDefault(); - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return generateNameForClassExpression(); } } @@ -31836,10 +32274,10 @@ var ts; write("("); emit(tempVariable); // Now we emit the expressions - if (node.template.kind === 185 /* TemplateExpression */) { + if (node.template.kind === 186 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 183 /* BinaryExpression */ + var needsParens = templateSpan.expression.kind === 184 /* BinaryExpression */ && templateSpan.expression.operatorToken.kind === 24 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -31874,7 +32312,7 @@ var ts; // ("abc" + 1) << (2 + "") // rather than // "abc" + (1 << 2) + "" - var needsParens = templateSpan.expression.kind !== 174 /* ParenthesizedExpression */ + var needsParens = templateSpan.expression.kind !== 175 /* ParenthesizedExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; if (i > 0 || headEmitted) { // If this is the first span and the head was not emitted, then this templateSpan's @@ -31916,11 +32354,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return parent.expression === template; - case 172 /* TaggedTemplateExpression */: - case 174 /* ParenthesizedExpression */: + case 173 /* TaggedTemplateExpression */: + case 175 /* ParenthesizedExpression */: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; @@ -31941,7 +32379,7 @@ var ts; // TODO (drosen): Note that we need to account for the upcoming 'yield' and // spread ('...') unary operators that are anticipated for ES6. switch (expression.kind) { - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: switch (expression.operatorToken.kind) { case 37 /* AsteriskToken */: case 39 /* SlashToken */: @@ -31953,8 +32391,8 @@ var ts; default: return -1 /* LessThan */; } - case 186 /* YieldExpression */: - case 184 /* ConditionalExpression */: + case 187 /* YieldExpression */: + case 185 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -32021,38 +32459,38 @@ var ts; // Either emit one big object literal (no spread attribs), or // a call to React.__spread var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 241 /* JsxSpreadAttribute */; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 242 /* JsxSpreadAttribute */; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; - for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 241 /* JsxSpreadAttribute */) { + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].kind === 242 /* JsxSpreadAttribute */) { // If this is the first argument, we need to emit a {} as the first argument - if (i_1 === 0) { + if (i === 0) { write("{}, "); } if (haveOpenedObjectLiteral) { write("}"); haveOpenedObjectLiteral = false; } - if (i_1 > 0) { + if (i > 0) { write(", "); } - emit(attrs[i_1].expression); + emit(attrs[i].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 240 /* JsxAttribute */); + ts.Debug.assert(attrs[i].kind === 241 /* JsxAttribute */); if (haveOpenedObjectLiteral) { write(", "); } else { haveOpenedObjectLiteral = true; - if (i_1 > 0) { + if (i > 0) { write(", "); } write("{"); } - emitJsxAttribute(attrs[i_1]); + emitJsxAttribute(attrs[i]); } } if (haveOpenedObjectLiteral) @@ -32062,7 +32500,7 @@ var ts; else { // One object literal with all the attributes in them write("{"); - for (var i = 0; i < attrs.length; i++) { + for (var i = 0, n = attrs.length; i < n; i++) { if (i > 0) { write(", "); } @@ -32075,11 +32513,11 @@ var ts; if (children) { for (var i = 0; i < children.length; i++) { // Don't emit empty expressions - if (children[i].kind === 242 /* JsxExpression */ && !(children[i].expression)) { + if (children[i].kind === 243 /* JsxExpression */ && !(children[i].expression)) { continue; } // Don't emit empty strings - if (children[i].kind === 238 /* JsxText */) { + if (children[i].kind === 239 /* JsxText */) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -32097,11 +32535,11 @@ var ts; write(")"); // closes "React.createElement(" emitTrailingComments(openingNode); } - if (node.kind === 235 /* JsxElement */) { + if (node.kind === 236 /* JsxElement */) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 237 /* JsxSelfClosingElement */); emitJsxElement(node); } } @@ -32123,11 +32561,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 241 /* JsxSpreadAttribute */) { + if (attribs[i].kind === 242 /* JsxSpreadAttribute */) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 240 /* JsxAttribute */); + ts.Debug.assert(attribs[i].kind === 241 /* JsxAttribute */); emitJsxAttribute(attribs[i]); } } @@ -32135,11 +32573,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 236 /* JsxSelfClosingElement */)) { + if (node.attributes.length > 0 || (node.kind === 237 /* JsxSelfClosingElement */)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 236 /* JsxSelfClosingElement */) { + if (node.kind === 237 /* JsxSelfClosingElement */) { write("/>"); } else { @@ -32158,11 +32596,11 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 235 /* JsxElement */) { + if (node.kind === 236 /* JsxElement */) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 237 /* JsxSelfClosingElement */); emitJsxOpeningOrSelfClosingElement(node); } } @@ -32170,11 +32608,11 @@ var ts; // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. // For example, this is utilized when feeding in a result to Object.defineProperty. function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 165 /* BindingElement */); + ts.Debug.assert(node.kind !== 166 /* BindingElement */); if (node.kind === 9 /* StringLiteral */) { emitLiteral(node); } - else if (node.kind === 136 /* ComputedPropertyName */) { + else if (node.kind === 137 /* ComputedPropertyName */) { // if this is a decorated computed property, we will need to capture the result // of the property expression so that we can apply decorators later. This is to ensure // we don't introduce unintended side effects: @@ -32218,62 +32656,62 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 166 /* ArrayLiteralExpression */: - case 191 /* AsExpression */: - case 183 /* BinaryExpression */: - case 170 /* CallExpression */: - case 243 /* CaseClause */: - case 136 /* ComputedPropertyName */: - case 184 /* ConditionalExpression */: - case 139 /* Decorator */: - case 177 /* DeleteExpression */: - case 199 /* DoStatement */: - case 169 /* ElementAccessExpression */: - case 229 /* ExportAssignment */: - case 197 /* ExpressionStatement */: - case 190 /* ExpressionWithTypeArguments */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 198 /* IfStatement */: - case 239 /* JsxClosingElement */: - case 236 /* JsxSelfClosingElement */: - case 237 /* JsxOpeningElement */: - case 241 /* JsxSpreadAttribute */: - case 242 /* JsxExpression */: - case 171 /* NewExpression */: - case 174 /* ParenthesizedExpression */: - case 182 /* PostfixUnaryExpression */: - case 181 /* PrefixUnaryExpression */: - case 206 /* ReturnStatement */: - case 248 /* ShorthandPropertyAssignment */: - case 187 /* SpreadElementExpression */: - case 208 /* SwitchStatement */: - case 172 /* TaggedTemplateExpression */: - case 192 /* TemplateSpan */: - case 210 /* ThrowStatement */: - case 173 /* TypeAssertionExpression */: - case 178 /* TypeOfExpression */: - case 179 /* VoidExpression */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 186 /* YieldExpression */: + case 167 /* ArrayLiteralExpression */: + case 192 /* AsExpression */: + case 184 /* BinaryExpression */: + case 171 /* CallExpression */: + case 244 /* CaseClause */: + case 137 /* ComputedPropertyName */: + case 185 /* ConditionalExpression */: + case 140 /* Decorator */: + case 178 /* DeleteExpression */: + case 200 /* DoStatement */: + case 170 /* ElementAccessExpression */: + case 230 /* ExportAssignment */: + case 198 /* ExpressionStatement */: + case 191 /* ExpressionWithTypeArguments */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 199 /* IfStatement */: + case 240 /* JsxClosingElement */: + case 237 /* JsxSelfClosingElement */: + case 238 /* JsxOpeningElement */: + case 242 /* JsxSpreadAttribute */: + case 243 /* JsxExpression */: + case 172 /* NewExpression */: + case 175 /* ParenthesizedExpression */: + case 183 /* PostfixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: + case 207 /* ReturnStatement */: + case 249 /* ShorthandPropertyAssignment */: + case 188 /* SpreadElementExpression */: + case 209 /* SwitchStatement */: + case 173 /* TaggedTemplateExpression */: + case 193 /* TemplateSpan */: + case 211 /* ThrowStatement */: + case 174 /* TypeAssertionExpression */: + case 179 /* TypeOfExpression */: + case 180 /* VoidExpression */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 187 /* YieldExpression */: return true; - case 165 /* BindingElement */: - case 249 /* EnumMember */: - case 138 /* Parameter */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 213 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 250 /* EnumMember */: + case 139 /* Parameter */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 214 /* VariableDeclaration */: return parent.initializer === node; - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return parent.expression === node; - case 176 /* ArrowFunction */: - case 175 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 176 /* FunctionExpression */: return parent.body === node; - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return parent.moduleReference === node; - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return parent.left === node; } return false; @@ -32285,7 +32723,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 250 /* SourceFile */) { + if (container.kind === 251 /* SourceFile */) { // Identifier references module export if (modulekind !== 5 /* ES6 */ && modulekind !== 4 /* System */) { write("exports."); @@ -32301,17 +32739,17 @@ var ts; if (modulekind !== 5 /* ES6 */) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 225 /* ImportClause */) { + if (declaration.kind === 226 /* ImportClause */) { // Identifier references default import write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 /* ES3 */ ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 228 /* ImportSpecifier */) { + else if (declaration.kind === 229 /* ImportSpecifier */) { // Identifier references named import write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_21 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); + var name_24 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_24); if (languageVersion === 0 /* ES3 */ && identifier === "default") { write("[\"default\"]"); } @@ -32340,13 +32778,13 @@ var ts; } function isNameOfNestedRedeclaration(node) { if (languageVersion < 2 /* ES6 */) { - var parent_6 = node.parent; - switch (parent_6.kind) { - case 165 /* BindingElement */: - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 213 /* VariableDeclaration */: - return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); + var parent_7 = node.parent; + switch (parent_7.kind) { + case 166 /* BindingElement */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 214 /* VariableDeclaration */: + return parent_7.name === node && resolver.isNestedRedeclaration(parent_7); } } return false; @@ -32355,8 +32793,8 @@ var ts; if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { // in converted loop body arguments cannot be used directly. - var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_22); + var name_25 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_25); return; } } @@ -32456,10 +32894,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 183 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 184 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 184 /* ConditionalExpression */ && node.parent.condition === node) { + else if (node.parent.kind === 185 /* ConditionalExpression */ && node.parent.condition === node) { return true; } return false; @@ -32467,11 +32905,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69 /* Identifier */: - case 166 /* ArrayLiteralExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 170 /* CallExpression */: - case 174 /* ParenthesizedExpression */: + case 167 /* ArrayLiteralExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 175 /* ParenthesizedExpression */: // This list is not exhaustive and only includes those cases that are relevant // to the check in emitArrayLiteral. More cases can be added as needed. return false; @@ -32491,17 +32929,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 187 /* SpreadElementExpression */) { + if (e.kind === 188 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166 /* ArrayLiteralExpression */) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 167 /* ArrayLiteralExpression */) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 187 /* SpreadElementExpression */) { + while (i < length && elements[i].kind !== 188 /* SpreadElementExpression */) { i++; } write("["); @@ -32524,7 +32962,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 187 /* SpreadElementExpression */; + return node.kind === 188 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; @@ -32594,7 +33032,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 145 /* GetAccessor */ || property.kind === 146 /* SetAccessor */) { + if (property.kind === 146 /* GetAccessor */ || property.kind === 147 /* SetAccessor */) { // TODO (drosen): Reconcile with 'emitMemberFunctions'. var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { @@ -32646,13 +33084,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 247 /* PropertyAssignment */) { + if (property.kind === 248 /* PropertyAssignment */) { emit(property.initializer); } - else if (property.kind === 248 /* ShorthandPropertyAssignment */) { + else if (property.kind === 249 /* ShorthandPropertyAssignment */) { emitExpressionIdentifier(property.name); } - else if (property.kind === 143 /* MethodDeclaration */) { + else if (property.kind === 144 /* MethodDeclaration */) { emitFunctionDeclaration(property); } else { @@ -32686,7 +33124,7 @@ var ts; // Everything until that point can be emitted as part of the initial object literal. var numInitialNonComputedProperties = numProperties; for (var i = 0, n = properties.length; i < n; i++) { - if (properties[i].name.kind === 136 /* ComputedPropertyName */) { + if (properties[i].name.kind === 137 /* ComputedPropertyName */) { numInitialNonComputedProperties = i; break; } @@ -32702,21 +33140,21 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(183 /* BinaryExpression */, startsOnNewLine); + var result = ts.createSynthesizedNode(184 /* BinaryExpression */, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(168 /* PropertyAccessExpression */); + var result = ts.createSynthesizedNode(169 /* PropertyAccessExpression */); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21 /* DotToken */); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(169 /* ElementAccessExpression */); + var result = ts.createSynthesizedNode(170 /* ElementAccessExpression */); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; @@ -32724,7 +33162,7 @@ var ts; function parenthesizeForAccess(expr) { // When diagnosing whether the expression needs parentheses, the decision should be based // on the innermost expression in a chain of nested type assertions. - while (expr.kind === 173 /* TypeAssertionExpression */ || expr.kind === 191 /* AsExpression */) { + while (expr.kind === 174 /* TypeAssertionExpression */ || expr.kind === 192 /* AsExpression */) { expr = expr.expression; } // isLeftHandSideExpression is almost the correct criterion for when it is not necessary @@ -32736,11 +33174,11 @@ var ts; // 1.x -> not the same as (1).x // if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 171 /* NewExpression */ && + expr.kind !== 172 /* NewExpression */ && expr.kind !== 8 /* NumericLiteral */) { return expr; } - var node = ts.createSynthesizedNode(174 /* ParenthesizedExpression */); + var node = ts.createSynthesizedNode(175 /* ParenthesizedExpression */); node.expression = expr; return node; } @@ -32775,7 +33213,7 @@ var ts; // Return true if identifier resolves to an exported member of a namespace function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 250 /* SourceFile */; + return container && container.kind !== 251 /* SourceFile */; } function emitShorthandPropertyAssignment(node) { // The name property of a short-hand property assignment is considered an expression position, so here @@ -32805,7 +33243,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 168 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 169 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -32816,7 +33254,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 168 /* PropertyAccessExpression */ || node.kind === 169 /* ElementAccessExpression */ + return node.kind === 169 /* PropertyAccessExpression */ || node.kind === 170 /* ElementAccessExpression */ ? resolver.getConstantValue(node) : undefined; } @@ -32905,7 +33343,7 @@ var ts; } emitExpressionIdentifier(node); break; - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: emitQualifiedNameAsExpression(node, useFallback); break; default: @@ -32923,10 +33361,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 187 /* SpreadElementExpression */; }); + return ts.forEach(elements, function (e) { return e.kind === 188 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 174 /* ParenthesizedExpression */ || node.kind === 173 /* TypeAssertionExpression */ || node.kind === 191 /* AsExpression */) { + while (node.kind === 175 /* ParenthesizedExpression */ || node.kind === 174 /* TypeAssertionExpression */ || node.kind === 192 /* AsExpression */) { node = node.expression; } return node; @@ -32947,13 +33385,13 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 168 /* PropertyAccessExpression */) { + if (expr.kind === 169 /* PropertyAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 169 /* ElementAccessExpression */) { + else if (expr.kind === 170 /* ElementAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); @@ -32998,7 +33436,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 168 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; + superCall = node.expression.kind === 169 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; } if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); @@ -33067,12 +33505,12 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176 /* ArrowFunction */) { - if (node.expression.kind === 173 /* TypeAssertionExpression */ || node.expression.kind === 191 /* AsExpression */) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 177 /* ArrowFunction */) { + if (node.expression.kind === 174 /* TypeAssertionExpression */ || node.expression.kind === 192 /* AsExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: // (-A).x; - while (operand.kind === 173 /* TypeAssertionExpression */ || operand.kind === 191 /* AsExpression */) { + while (operand.kind === 174 /* TypeAssertionExpression */ || operand.kind === 192 /* AsExpression */) { operand = operand.expression; } // We have an expression of the form: (SubExpr) @@ -33083,15 +33521,15 @@ var ts; // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() // new (A()) should be emitted as new (A()) and not new A() // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () - if (operand.kind !== 181 /* PrefixUnaryExpression */ && - operand.kind !== 179 /* VoidExpression */ && - operand.kind !== 178 /* TypeOfExpression */ && - operand.kind !== 177 /* DeleteExpression */ && - operand.kind !== 182 /* PostfixUnaryExpression */ && - operand.kind !== 171 /* NewExpression */ && - !(operand.kind === 170 /* CallExpression */ && node.parent.kind === 171 /* NewExpression */) && - !(operand.kind === 175 /* FunctionExpression */ && node.parent.kind === 170 /* CallExpression */) && - !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 168 /* PropertyAccessExpression */)) { + if (operand.kind !== 182 /* PrefixUnaryExpression */ && + operand.kind !== 180 /* VoidExpression */ && + operand.kind !== 179 /* TypeOfExpression */ && + operand.kind !== 178 /* DeleteExpression */ && + operand.kind !== 183 /* PostfixUnaryExpression */ && + operand.kind !== 172 /* NewExpression */ && + !(operand.kind === 171 /* CallExpression */ && node.parent.kind === 172 /* NewExpression */) && + !(operand.kind === 176 /* FunctionExpression */ && node.parent.kind === 171 /* CallExpression */) && + !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 169 /* PropertyAccessExpression */)) { emit(operand); return; } @@ -33120,7 +33558,7 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 /* Identifier */ || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 /* VariableDeclaration */ || node.parent.kind === 165 /* BindingElement */); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 214 /* VariableDeclaration */ || node.parent.kind === 166 /* BindingElement */); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); @@ -33151,7 +33589,7 @@ var ts; // the resulting expression a prefix increment operation. And in the second, it will make the resulting // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. - if (node.operand.kind === 181 /* PrefixUnaryExpression */) { + if (node.operand.kind === 182 /* PrefixUnaryExpression */) { var operand = node.operand; if (node.operator === 35 /* PlusToken */ && (operand.operator === 35 /* PlusToken */ || operand.operator === 41 /* PlusPlusToken */)) { write(" "); @@ -33207,10 +33645,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 250 /* SourceFile */) { + if (current.kind === 251 /* SourceFile */) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2 /* Export */) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 221 /* ModuleBlock */) { + else if (ts.isFunctionLike(current) || current.kind === 222 /* ModuleBlock */) { return false; } else { @@ -33230,14 +33668,14 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(169 /* ElementAccessExpression */, /*startsOnNewLine*/ false); + synthesizedLHS = ts.createSynthesizedNode(170 /* ElementAccessExpression */, /*startsOnNewLine*/ false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 /* NumericLiteral */ && leftHandSideExpression.argumentExpression.kind !== 9 /* StringLiteral */) { var tempArgumentExpression = createAndRecordTempVariable(268435456 /* _i */); synthesizedLHS.argumentExpression = tempArgumentExpression; - emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true); + emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true, leftHandSideExpression.expression); } else { synthesizedLHS.argumentExpression = leftHandSideExpression.argumentExpression; @@ -33247,7 +33685,7 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(168 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); + synthesizedLHS = ts.createSynthesizedNode(169 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; @@ -33275,8 +33713,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 56 /* EqualsToken */ && - (node.left.kind === 167 /* ObjectLiteralExpression */ || node.left.kind === 166 /* ArrayLiteralExpression */)) { - emitDestructuring(node, node.parent.kind === 197 /* ExpressionStatement */); + (node.left.kind === 168 /* ObjectLiteralExpression */ || node.left.kind === 167 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 198 /* ExpressionStatement */); } else { var exportChanged = node.operatorToken.kind >= 56 /* FirstAssignment */ && @@ -33341,7 +33779,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 194 /* Block */) { + if (node && node.kind === 195 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -33355,12 +33793,12 @@ var ts; } emitToken(15 /* OpenBraceToken */, node.pos); increaseIndent(); - if (node.kind === 221 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 220 /* ModuleDeclaration */); + if (node.kind === 222 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 221 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 221 /* ModuleBlock */) { + if (node.kind === 222 /* ModuleBlock */) { emitTempDeclarations(/*newLine*/ true); } decreaseIndent(); @@ -33368,7 +33806,7 @@ var ts; emitToken(16 /* CloseBraceToken */, node.statements.end); } function emitEmbeddedStatement(node) { - if (node.kind === 194 /* Block */) { + if (node.kind === 195 /* Block */) { write(" "); emit(node); } @@ -33380,7 +33818,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 176 /* ArrowFunction */); + emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 177 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { @@ -33393,7 +33831,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 198 /* IfStatement */) { + if (node.elseStatement.kind === 199 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -33413,7 +33851,7 @@ var ts; else { emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } - if (node.statement.kind === 194 /* Block */) { + if (node.statement.kind === 195 /* Block */) { write(" "); } else { @@ -33442,7 +33880,7 @@ var ts; * Returns false if nothing was written - this can happen for source file level variable declarations * in system modules where such variable declarations are hoisted. */ - function tryEmitStartOfVariableDeclarationList(decl, startPos) { + function tryEmitStartOfVariableDeclarationList(decl) { if (shouldHoistVariable(decl, /*checkIfSourceFileLevelDecl*/ true)) { // variables in variable declaration list were already hoisted return false; @@ -33456,32 +33894,23 @@ var ts; } return false; } - var tokenKind = 102 /* VarKeyword */; + emitStart(decl); if (decl && languageVersion >= 2 /* ES6 */) { if (ts.isLet(decl)) { - tokenKind = 108 /* LetKeyword */; + write("let "); } else if (ts.isConst(decl)) { - tokenKind = 74 /* ConstKeyword */; + write("const "); + } + else { + write("var "); } - } - if (startPos !== undefined) { - emitToken(tokenKind, startPos); - write(" "); } else { - switch (tokenKind) { - case 102 /* VarKeyword */: - write("var "); - break; - case 108 /* LetKeyword */: - write("let "); - break; - case 74 /* ConstKeyword */: - write("const "); - break; - } + write("var "); } + // Note here we specifically dont emit end so that if we are going to emit binding pattern + // we can alter the source map correctly return true; } function emitVariableDeclarationListSkippingUninitializedEntries(list) { @@ -33512,7 +33941,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 209 /* LabeledStatement */) { + if (node.parent.kind === 210 /* LabeledStatement */) { // if parent of the loop was labeled statement - attach the label to loop skipping converted loop body emitLabelAndColon(node.parent); } @@ -33523,10 +33952,11 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + var initializer = node.initializer; + if (initializer && initializer.kind === 215 /* VariableDeclarationList */) { loopInitializer = node.initializer; } break; @@ -33540,7 +33970,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 194 /* Block */; + var bodyIsBlock = node.statement.kind === 195 /* Block */; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -33661,7 +34091,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 194 /* Block */) { + else if (node.statement.kind === 195 /* Block */) { emitLines(node.statement.statements); } else { @@ -33771,9 +34201,9 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 215 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; - var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList); if (startIsEmitted) { emitCommaList(variableDeclarationList.declarations); } @@ -33797,7 +34227,7 @@ var ts; } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 /* ES6 */ && node.kind === 203 /* ForOfStatement */) { + if (languageVersion < 2 /* ES6 */ && node.kind === 204 /* ForOfStatement */) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -33808,17 +34238,17 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + tryEmitStartOfVariableDeclarationList(variableDeclarationList); emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 202 /* ForInStatement */) { + if (node.kind === 203 /* ForInStatement */) { write(" in "); } else { @@ -33887,18 +34317,18 @@ var ts; emitEnd(node.expression); write("; "); // _i < _a.length; - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write(" < "); emitNodeWithCommentsAndWithoutSourcemap(rhsReference); write(".length"); - emitEnd(node.initializer); + emitEnd(node.expression); write("; "); // _i++) - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write("++"); - emitEnd(node.initializer); + emitEnd(node.expression); emitToken(18 /* CloseParenToken */, node.expression.end); // Body write(" {"); @@ -33908,7 +34338,7 @@ var ts; // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -33938,7 +34368,7 @@ var ts; // Initializer is an expression. Emit the expression in the body, so that it's // evaluated on every iteration. var assignmentExpression = createBinaryExpression(node.initializer, 56 /* EqualsToken */, rhsIterationValue, /*startsOnNewLine*/ false); - if (node.initializer.kind === 166 /* ArrayLiteralExpression */ || node.initializer.kind === 167 /* ObjectLiteralExpression */) { + if (node.initializer.kind === 167 /* ArrayLiteralExpression */ || node.initializer.kind === 168 /* ObjectLiteralExpression */) { // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined); @@ -33966,12 +34396,12 @@ var ts; // it is possible if either // - break\continue is statement labeled and label is located inside the converted loop // - break\continue is non-labeled and located in non-converted loop\switch statement - var jump = node.kind === 205 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 206 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 205 /* BreakStatement */) { + if (node.kind === 206 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; write("return \"break\";"); } @@ -33982,7 +34412,7 @@ var ts; } else { var labelMarker; - if (node.kind === 205 /* BreakStatement */) { + if (node.kind === 206 /* BreakStatement */) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } @@ -33995,7 +34425,7 @@ var ts; return; } } - emitToken(node.kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 206 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -34061,7 +34491,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 243 /* CaseClause */) { + if (node.kind === 244 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -34130,7 +34560,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 220 /* ModuleDeclaration */); + } while (node && node.kind !== 221 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -34155,13 +34585,13 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(179 /* VoidExpression */); + var result = ts.createSynthesizedNode(180 /* VoidExpression */); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 250 /* SourceFile */) { - ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 229 /* ExportAssignment */); + if (node.parent.kind === 251 /* SourceFile */) { + ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 230 /* ExportAssignment */); // only allow export default at a source file level if (modulekind === 1 /* CommonJS */ || modulekind === 2 /* AMD */ || modulekind === 3 /* UMD */) { if (!isEs6Module) { @@ -34257,7 +34687,7 @@ var ts; * @param value an expression as a right-hand-side operand of the assignment * @param shouldEmitCommaBeforeAssignment a boolean indicating whether to prefix an assignment with comma */ - function emitAssignment(name, value, shouldEmitCommaBeforeAssignment) { + function emitAssignment(name, value, shouldEmitCommaBeforeAssignment, nodeForSourceMap) { if (shouldEmitCommaBeforeAssignment) { write(", "); } @@ -34267,15 +34697,21 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 /* VariableDeclaration */ || name.parent.kind === 165 /* BindingElement */); - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } - write(" = "); - emit(value); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 214 /* VariableDeclaration */ || name.parent.kind === 166 /* BindingElement */); + // If this is first var declaration, we need to start at var/let/const keyword instead + // otherwise use nodeForSourceMap as the start position + emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap); + withTemporaryNoSourceMap(function () { + if (isVariableDeclarationOrBindingElement) { + emitModuleMemberName(name.parent); + } + else { + emit(name); + } + write(" = "); + emit(value); + }); + emitEnd(nodeForSourceMap, /*stopOverridingSpan*/ true); if (exportChanged) { write(")"); } @@ -34286,14 +34722,19 @@ var ts; * @param canDefineTempVariablesInPlace a boolean indicating whether you can define the temporary variable at an assignment location * @param shouldEmitCommaBeforeAssignment a boolean indicating whether an assignment should prefix with comma */ - function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment) { + function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment, sourceMapNode) { var identifier = createTempVariable(0 /* Auto */); if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); + emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment, sourceMapNode || expression.parent); return identifier; } + function isFirstVariableDeclaration(root) { + return root.kind === 214 /* VariableDeclaration */ && + root.parent.kind === 215 /* VariableDeclarationList */ && + root.parent.declarations[0] === root; + } function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; // An exported declaration is actually emitted as an assignment (to a property on the module object), so @@ -34301,19 +34742,24 @@ var ts; // Also temporary variables should be explicitly allocated for source level declarations when module target is system // because actual variable declarations are hoisted var canDefineTempVariablesInPlace = false; - if (root.kind === 213 /* VariableDeclaration */) { + if (root.kind === 214 /* VariableDeclaration */) { var isExported = ts.getCombinedNodeFlags(root) & 2 /* Export */; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; } - else if (root.kind === 138 /* Parameter */) { + else if (root.kind === 139 /* Parameter */) { canDefineTempVariablesInPlace = true; } - if (root.kind === 183 /* BinaryExpression */) { + if (root.kind === 184 /* BinaryExpression */) { emitAssignmentExpression(root); } else { ts.Debug.assert(!isAssignmentExpressionStatement); + // If first variable declaration of variable statement correct the start location + if (isFirstVariableDeclaration(root)) { + // Use emit location of "var " as next emit start entry + sourceMap.changeEmitSourcePos(); + } emitBindingElement(root, value); } /** @@ -34325,27 +34771,28 @@ var ts; * @param reuseIdentifierExpressions true if identifier expressions can simply be returned; * false if it is necessary to always emit an identifier. */ - function ensureIdentifier(expr, reuseIdentifierExpressions) { + function ensureIdentifier(expr, reuseIdentifierExpressions, sourceMapNode) { if (expr.kind === 69 /* Identifier */ && reuseIdentifierExpressions) { return expr; } - var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0); + var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0, sourceMapNode); emitCount++; return identifier; } - function createDefaultValueCheck(value, defaultValue) { + function createDefaultValueCheck(value, defaultValue, sourceMapNode) { // The value expression will be evaluated twice, so for anything but a simple identifier // we need to generate a temporary variable - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // If the temporary variable needs to be emitted use the source Map node for assignment of that statement + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); // Return the expression 'value === void 0 ? defaultValue : value' - var equals = ts.createSynthesizedNode(183 /* BinaryExpression */); + var equals = ts.createSynthesizedNode(184 /* BinaryExpression */); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(184 /* ConditionalExpression */); + var cond = ts.createSynthesizedNode(185 /* ConditionalExpression */); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53 /* QuestionToken */); cond.whenTrue = whenTrue; @@ -34360,9 +34807,10 @@ var ts; } function createPropertyAccessForDestructuringProperty(object, propName) { var index; - var nameIsComputed = propName.kind === 136 /* ComputedPropertyName */; + var nameIsComputed = propName.kind === 137 /* ComputedPropertyName */; if (nameIsComputed) { - index = ensureIdentifier(propName.expression, /*reuseIdentifierExpressions*/ false); + // TODO to handle when we look into sourcemaps for computed properties, for now use propName + index = ensureIdentifier(propName.expression, /*reuseIdentifierExpressions*/ false, propName); } else { // We create a synthetic copy of the identifier in order to avoid the rewriting that might @@ -34375,7 +34823,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(170 /* CallExpression */); + var call = ts.createSynthesizedNode(171 /* CallExpression */); var sliceIdentifier = ts.createSynthesizedNode(69 /* Identifier */); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -34383,60 +34831,65 @@ var ts; call.arguments[0] = createNumericLiteral(sliceIndex); return call; } - function emitObjectLiteralAssignment(target, value) { + function emitObjectLiteralAssignment(target, value, sourceMapNode) { var properties = target.properties; if (properties.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { + if (p.kind === 248 /* PropertyAssignment */ || p.kind === 249 /* ShorthandPropertyAssignment */) { var propName = p.name; - var target_1 = p.kind === 248 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; - emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); + var target_1 = p.kind === 249 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; + // Assignment for target = value.propName should highligh whole property, hence use p as source map node + emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName), p); } } } - function emitArrayLiteralAssignment(target, value) { + function emitArrayLiteralAssignment(target, value, sourceMapNode) { var elements = target.elements; if (elements.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189 /* OmittedExpression */) { - if (e.kind !== 187 /* SpreadElementExpression */) { - emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); + if (e.kind !== 190 /* OmittedExpression */) { + // Assignment for target = value.propName should highligh whole property, hence use e as source map node + if (e.kind !== 188 /* SpreadElementExpression */) { + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)), e); } else if (i === elements.length - 1) { - emitDestructuringAssignment(e.expression, createSliceCall(value, i)); + emitDestructuringAssignment(e.expression, createSliceCall(value, i), e); } } } } - function emitDestructuringAssignment(target, value) { - if (target.kind === 248 /* ShorthandPropertyAssignment */) { + function emitDestructuringAssignment(target, value, sourceMapNode) { + // When emitting target = value use source map node to highlight, including any temporary assignments needed for this + if (target.kind === 249 /* ShorthandPropertyAssignment */) { if (target.objectAssignmentInitializer) { - value = createDefaultValueCheck(value, target.objectAssignmentInitializer); + value = createDefaultValueCheck(value, target.objectAssignmentInitializer, sourceMapNode); } target = target.name; } - else if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { - value = createDefaultValueCheck(value, target.right); + else if (target.kind === 184 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + value = createDefaultValueCheck(value, target.right, sourceMapNode); target = target.left; } - if (target.kind === 167 /* ObjectLiteralExpression */) { - emitObjectLiteralAssignment(target, value); + if (target.kind === 168 /* ObjectLiteralExpression */) { + emitObjectLiteralAssignment(target, value, sourceMapNode); } - else if (target.kind === 166 /* ArrayLiteralExpression */) { - emitArrayLiteralAssignment(target, value); + else if (target.kind === 167 /* ArrayLiteralExpression */) { + emitArrayLiteralAssignment(target, value, sourceMapNode); } else { - emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, sourceMapNode); emitCount++; } } @@ -34447,25 +34900,32 @@ var ts; emit(value); } else if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + // Source map node for root.left = root.right is root + // but if root is synthetic, which could be in below case, use the target which is { a } + // for ({a} of {a: string}) { + // } + emitDestructuringAssignment(target, value, ts.nodeIsSynthesized(root) ? target : root); } else { - if (root.parent.kind !== 174 /* ParenthesizedExpression */) { + if (root.parent.kind !== 175 /* ParenthesizedExpression */) { write("("); } - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); - emitDestructuringAssignment(target, value); + // Temporary assignment needed to emit root should highlight whole binary expression + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, root); + // Source map node for root.left = root.right is root + emitDestructuringAssignment(target, value, root); write(", "); emit(value); - if (root.parent.kind !== 174 /* ParenthesizedExpression */) { + if (root.parent.kind !== 175 /* ParenthesizedExpression */) { write(")"); } } } function emitBindingElement(target, value) { + // Any temporary assignments needed to emit target = value should point to target if (target.initializer) { // Combine value and initializer - value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; + value = value ? createDefaultValueCheck(value, target.initializer, target) : target.initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer @@ -34480,16 +34940,16 @@ var ts; // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, // so in that case, we'll intentionally create that temporary. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0); + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0, target); } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 163 /* ObjectBindingPattern */) { + if (pattern.kind === 164 /* ObjectBindingPattern */) { // Rewrite element to a declaration with an initializer that fetches property var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 189 /* OmittedExpression */) { + else if (element.kind !== 190 /* OmittedExpression */) { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); @@ -34501,7 +34961,7 @@ var ts; } } else { - emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, target); emitCount++; } } @@ -34529,8 +34989,8 @@ var ts; (getCombinedFlagsForIdentifier(node.name) & 8192 /* Let */); // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isLetDefinedInLoop && - node.parent.parent.kind !== 202 /* ForInStatement */ && - node.parent.parent.kind !== 203 /* ForOfStatement */) { + node.parent.parent.kind !== 203 /* ForInStatement */ && + node.parent.parent.kind !== 204 /* ForOfStatement */) { initializer = createVoidZero(); } } @@ -34548,7 +35008,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 189 /* OmittedExpression */) { + if (node.kind === 190 /* OmittedExpression */) { return; } var name = node.name; @@ -34560,7 +35020,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 213 /* VariableDeclaration */ && node.parent.kind !== 165 /* BindingElement */)) { + if (!node.parent || (node.parent.kind !== 214 /* VariableDeclaration */ && node.parent.kind !== 166 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -34568,7 +35028,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2 /* Export */) && modulekind === 5 /* ES6 */ && - node.parent.kind === 250 /* SourceFile */; + node.parent.kind === 251 /* SourceFile */; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -34619,12 +35079,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2 /* ES6 */) { if (ts.isBindingPattern(node.name)) { - var name_23 = createTempVariable(0 /* Auto */); + var name_26 = createTempVariable(0 /* Auto */); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_23); - emit(name_23); + tempParameters.push(name_26); + emit(name_26); } else { emit(node.name); @@ -34729,12 +35189,12 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 145 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 146 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 176 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; + return node.kind === 177 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } function emitDeclarationName(node) { if (node.name) { @@ -34745,11 +35205,11 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 175 /* FunctionExpression */) { + if (node.kind === 176 /* FunctionExpression */) { // Emit name if one is present return !!node.name; } - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { // Emit name if one is present, or emit generated name in down-level case (for export default case) return !!node.name || modulekind !== 5 /* ES6 */; } @@ -34761,12 +35221,12 @@ var ts; // TODO (yuisu) : we should not have special cases to condition emitting comments // but have one place to fix check for these conditions. var kind = node.kind, parent = node.parent; - if (kind !== 143 /* MethodDeclaration */ && - kind !== 142 /* MethodSignature */ && + if (kind !== 144 /* MethodDeclaration */ && + kind !== 143 /* MethodSignature */ && parent && - parent.kind !== 247 /* PropertyAssignment */ && - parent.kind !== 170 /* CallExpression */ && - parent.kind !== 166 /* ArrayLiteralExpression */) { + parent.kind !== 248 /* PropertyAssignment */ && + parent.kind !== 171 /* CallExpression */ && + parent.kind !== 167 /* ArrayLiteralExpression */) { // 1. Methods will emit comments at their assignment declaration sites. // // 2. If the function is a property of object literal, emitting leading-comments @@ -34805,11 +35265,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 /* ES6 */ && kind === 215 /* FunctionDeclaration */ && parent === currentSourceFile && node.name) { + if (modulekind !== 5 /* ES6 */ && kind === 216 /* FunctionDeclaration */ && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (kind !== 143 /* MethodDeclaration */ && kind !== 142 /* MethodSignature */) { + if (kind !== 144 /* MethodDeclaration */ && kind !== 143 /* MethodSignature */) { emitTrailingComments(node); } } @@ -34842,7 +35302,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 176 /* ArrowFunction */; + var isArrowFunction = node.kind === 177 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -34961,7 +35421,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 194 /* Block */) { + if (node.body.kind === 195 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -35020,10 +35480,10 @@ var ts; write(" "); // Unwrap all type assertions. var current = body; - while (current.kind === 173 /* TypeAssertionExpression */) { + while (current.kind === 174 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 167 /* ObjectLiteralExpression */); + emitParenthesizedIf(body, current.kind === 168 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -35097,9 +35557,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 197 /* ExpressionStatement */) { + if (statement && statement.kind === 198 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 170 /* CallExpression */) { + if (expr && expr.kind === 171 /* CallExpression */) { var func = expr.expression; if (func && func.kind === 95 /* SuperKeyword */) { return statement; @@ -35133,7 +35593,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(memberName); write("]"); } - else if (memberName.kind === 136 /* ComputedPropertyName */) { + else if (memberName.kind === 137 /* ComputedPropertyName */) { emitComputedPropertyName(memberName); } else { @@ -35145,7 +35605,7 @@ var ts; var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 141 /* PropertyDeclaration */ && isStatic === ((member.flags & 64 /* Static */) !== 0) && member.initializer) { + if (member.kind === 142 /* PropertyDeclaration */ && isStatic === ((member.flags & 64 /* Static */) !== 0) && member.initializer) { properties.push(member); } } @@ -35185,11 +35645,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 193 /* SemicolonClassElement */) { + if (member.kind === 194 /* SemicolonClassElement */) { writeLine(); write(";"); } - else if (member.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) { + else if (member.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */) { if (!member.body) { return emitCommentsOnNotEmittedNode(member); } @@ -35206,7 +35666,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 145 /* GetAccessor */ || member.kind === 146 /* SetAccessor */) { + else if (member.kind === 146 /* GetAccessor */ || member.kind === 147 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -35256,22 +35716,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) && !member.body) { + if ((member.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */) && !member.body) { emitCommentsOnNotEmittedNode(member); } - else if (member.kind === 143 /* MethodDeclaration */ || - member.kind === 145 /* GetAccessor */ || - member.kind === 146 /* SetAccessor */) { + else if (member.kind === 144 /* MethodDeclaration */ || + member.kind === 146 /* GetAccessor */ || + member.kind === 147 /* SetAccessor */) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 64 /* Static */) { write("static "); } - if (member.kind === 145 /* GetAccessor */) { + if (member.kind === 146 /* GetAccessor */) { write("get "); } - else if (member.kind === 146 /* SetAccessor */) { + else if (member.kind === 147 /* SetAccessor */) { write("set "); } if (member.asteriskToken) { @@ -35282,7 +35742,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 193 /* SemicolonClassElement */) { + else if (member.kind === 194 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -35311,11 +35771,11 @@ var ts; var hasInstancePropertyWithInitializer = false; // Emit the constructor overload pinned comments ts.forEach(node.members, function (member) { - if (member.kind === 144 /* Constructor */ && !member.body) { + if (member.kind === 145 /* Constructor */ && !member.body) { emitCommentsOnNotEmittedNode(member); } // Check if there is any non-static property assignment - if (member.kind === 141 /* PropertyDeclaration */ && member.initializer && (member.flags & 64 /* Static */) === 0) { + if (member.kind === 142 /* PropertyDeclaration */ && member.initializer && (member.flags & 64 /* Static */) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -35429,7 +35889,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { if (thisNodeIsDecorated) { // To preserve the correct runtime semantics when decorators are applied to the class, // the emit needs to follow one of the following rules: @@ -35506,7 +35966,7 @@ var ts; // This keeps the expression as an expression, while ensuring that the static parts // of it have been initialized by the time it is used. var staticProperties = getInitializedProperties(node, /*isStatic*/ true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188 /* ClassExpression */; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 189 /* ClassExpression */; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0 /* Auto */); @@ -35588,7 +36048,7 @@ var ts; write(";"); } } - else if (node.parent.kind !== 250 /* SourceFile */) { + else if (node.parent.kind !== 251 /* SourceFile */) { writeLine(); emitStart(node); emitModuleMemberName(node); @@ -35600,7 +36060,7 @@ var ts; } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { // source file level classes in system modules are hoisted so 'var's for them are already defined if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); @@ -35661,11 +36121,11 @@ var ts; emit(baseTypeNode.expression); } write("))"); - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { emitExportMemberAssignment(node); } } @@ -35749,7 +36209,7 @@ var ts; else { decorators = member.decorators; // we only decorate the parameters here if this is a method - if (member.kind === 143 /* MethodDeclaration */) { + if (member.kind === 144 /* MethodDeclaration */) { functionLikeMember = member; } } @@ -35806,7 +36266,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); if (languageVersion > 0 /* ES3 */) { - if (member.kind !== 141 /* PropertyDeclaration */) { + if (member.kind !== 142 /* PropertyDeclaration */) { // We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly. // We have this extra argument here so that we can inject an explicit property descriptor at a later date. write(", null"); @@ -35848,10 +36308,10 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 141 /* PropertyDeclaration */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 142 /* PropertyDeclaration */: return true; } return false; @@ -35861,7 +36321,7 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 143 /* MethodDeclaration */: + case 144 /* MethodDeclaration */: return true; } return false; @@ -35871,9 +36331,9 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 216 /* ClassDeclaration */: - case 143 /* MethodDeclaration */: - case 146 /* SetAccessor */: + case 217 /* ClassDeclaration */: + case 144 /* MethodDeclaration */: + case 147 /* SetAccessor */: return true; } return false; @@ -35891,19 +36351,19 @@ var ts; // // For rules on serializing type annotations, see `serializeTypeNode`. switch (node.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: write("Function"); return; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: emitSerializedTypeNode(node.type); return; - case 138 /* Parameter */: + case 139 /* Parameter */: emitSerializedTypeNode(node.type); return; - case 145 /* GetAccessor */: + case 146 /* GetAccessor */: emitSerializedTypeNode(node.type); return; - case 146 /* SetAccessor */: + case 147 /* SetAccessor */: emitSerializedTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); return; } @@ -35919,23 +36379,23 @@ var ts; case 103 /* VoidKeyword */: write("void 0"); return; - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: emitSerializedTypeNode(node.type); return; - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: write("Function"); return; - case 156 /* ArrayType */: - case 157 /* TupleType */: + case 157 /* ArrayType */: + case 158 /* TupleType */: write("Array"); return; - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: case 120 /* BooleanKeyword */: write("Boolean"); return; case 130 /* StringKeyword */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: write("String"); return; case 128 /* NumberKeyword */: @@ -35944,15 +36404,15 @@ var ts; case 131 /* SymbolKeyword */: write("Symbol"); return; - case 151 /* TypeReference */: + case 152 /* TypeReference */: emitSerializedTypeReferenceNode(node); return; - case 154 /* TypeQuery */: - case 155 /* TypeLiteral */: - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 155 /* TypeQuery */: + case 156 /* TypeLiteral */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: case 117 /* AnyKeyword */: - case 161 /* ThisType */: + case 162 /* ThisType */: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -36025,7 +36485,7 @@ var ts; // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. if (node) { var valueDeclaration; - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -36041,10 +36501,10 @@ var ts; } if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 156 /* ArrayType */) { + if (parameterType.kind === 157 /* ArrayType */) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 151 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 152 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -36121,7 +36581,7 @@ var ts; if (!shouldHoistDeclarationInSystemJsModule(node)) { // do not emit var if variable was already hoisted var isES6ExportedEnum = isES6ExportedDeclaration(node); - if (!(node.flags & 2 /* Export */) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219 /* EnumDeclaration */))) { + if (!(node.flags & 2 /* Export */) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220 /* EnumDeclaration */))) { emitStart(node); if (isES6ExportedEnum) { write("export "); @@ -36203,7 +36663,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 221 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -36227,7 +36687,7 @@ var ts; var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { var isES6ExportedNamespace = isES6ExportedDeclaration(node); - if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220 /* ModuleDeclaration */)) { + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 221 /* ModuleDeclaration */)) { emitStart(node); if (isES6ExportedNamespace) { write("export "); @@ -36245,7 +36705,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 221 /* ModuleBlock */) { + if (node.body.kind === 222 /* ModuleBlock */) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -36321,16 +36781,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 223 /* ImportEqualsDeclaration */) { + if (node.kind === 224 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 227 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 224 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; + return node.kind === 225 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -36358,7 +36818,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 227 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -36384,7 +36844,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 223 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; + var isExportedImport = node.kind === 224 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2 /* AMD */) { emitLeadingComments(node); @@ -36403,7 +36863,7 @@ var ts; // import { x, y } from "foo" // import d, * as x from "foo" // import d, { x, y } from "foo" - var isNakedImport = 224 /* ImportDeclaration */ && !node.importClause; + var isNakedImport = 225 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -36582,8 +37042,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 215 /* FunctionDeclaration */ && - expression.kind !== 216 /* ClassDeclaration */) { + if (expression.kind !== 216 /* FunctionDeclaration */ && + expression.kind !== 217 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -36620,7 +37080,7 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, /*checkChildren*/ true)) { // import "mod" @@ -36630,13 +37090,13 @@ var ts; externalImports.push(node); } break; - case 223 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 234 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + case 224 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 235 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -36654,12 +37114,12 @@ var ts; // export { x, y } for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_24 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); + var name_27 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_27] || (exportSpecifiers[name_27] = [])).push(specifier); } } break; - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; @@ -36685,18 +37145,18 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 224 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 225 /* ImportDeclaration */ && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 230 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 231 /* ExportDeclaration */ && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { if (emitRelativePathAsModuleName) { - var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_25) { - return "\"" + name_25 + "\""; + var name_28 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_28) { + return "\"" + name_28 + "\""; } } var moduleName = ts.getExternalModuleName(importNode); @@ -36714,8 +37174,8 @@ var ts; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; // do not create variable declaration for exports and imports that lack import clause - var skipNode = importNode.kind === 230 /* ExportDeclaration */ || - (importNode.kind === 224 /* ImportDeclaration */ && !importNode.importClause); + var skipNode = importNode.kind === 231 /* ExportDeclaration */ || + (importNode.kind === 225 /* ImportDeclaration */ && !importNode.importClause); if (skipNode) { continue; } @@ -36748,7 +37208,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 230 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 231 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -36780,7 +37240,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 230 /* ExportDeclaration */) { + if (externalImport.kind !== 231 /* ExportDeclaration */) { continue; } var exportDecl = externalImport; @@ -36868,12 +37328,12 @@ var ts; var seen = {}; for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_26 = local.kind === 69 /* Identifier */ + var name_29 = local.kind === 69 /* Identifier */ ? local : local.name; - if (name_26) { + if (name_29) { // do not emit duplicate entries (in case of declaration merging) in the list of hoisted variables - var text = ts.unescapeIdentifier(name_26.text); + var text = ts.unescapeIdentifier(name_29.text); if (ts.hasProperty(seen, text)) { continue; } @@ -36884,7 +37344,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 216 /* ClassDeclaration */ || local.kind === 220 /* ModuleDeclaration */ || local.kind === 219 /* EnumDeclaration */) { + if (local.kind === 217 /* ClassDeclaration */ || local.kind === 221 /* ModuleDeclaration */ || local.kind === 220 /* EnumDeclaration */) { emitDeclarationName(local); } else { @@ -36918,21 +37378,21 @@ var ts; if (node.flags & 4 /* Ambient */) { return; } - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 219 /* EnumDeclaration */) { + if (node.kind === 220 /* EnumDeclaration */) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36941,7 +37401,7 @@ var ts; } return; } - if (node.kind === 220 /* ModuleDeclaration */) { + if (node.kind === 221 /* ModuleDeclaration */) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36950,17 +37410,17 @@ var ts; } return; } - if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { + if (node.kind === 214 /* VariableDeclaration */ || node.kind === 166 /* BindingElement */) { if (shouldHoistVariable(node, /*checkIfSourceFileLevelDecl*/ false)) { - var name_27 = node.name; - if (name_27.kind === 69 /* Identifier */) { + var name_30 = node.name; + if (name_30.kind === 69 /* Identifier */) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_27); + hoistedVars.push(name_30); } else { - ts.forEachChild(name_27, visit); + ts.forEachChild(name_30, visit); } } return; @@ -36991,7 +37451,7 @@ var ts; // if block scoped variables are nested in some another block then // no other functions can use them except ones that are defined at least in the same block return (ts.getCombinedNodeFlags(node) & 24576 /* BlockScoped */) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 250 /* SourceFile */; + ts.getEnclosingBlockScopeContainer(node).kind === 251 /* SourceFile */; } function isCurrentFileSystemExternalModule() { return modulekind === 4 /* System */ && isCurrentFileExternalModule; @@ -37066,21 +37526,21 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // fall-through - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== ""); writeLine(); // save import into the local write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -37093,12 +37553,12 @@ var ts; write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { - if (i_2 !== 0) { + for (var i_1 = 0, len = entry.exportClause.elements.length; i_1 < len; i_1++) { + if (i_1 !== 0) { write(","); writeLine(); } - var e = entry.exportClause.elements[i_2]; + var e = entry.exportClause.elements[i_1]; write("\""); emitNodeWithCommentsAndWithoutSourcemap(e.name); write("\": " + parameterName + "[\""); @@ -37139,10 +37599,10 @@ var ts; // - import declarations are not emitted since they are already handled in setters // - export declarations with module specifiers are not emitted since they were already written in setters // - export declarations without module specifiers are emitted preserving the order - case 215 /* FunctionDeclaration */: - case 224 /* ImportDeclaration */: + case 216 /* FunctionDeclaration */: + case 225 /* ImportDeclaration */: continue; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -37151,7 +37611,7 @@ var ts; } } continue; - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { // - import equals declarations that import external modules are not emitted continue; @@ -37510,22 +37970,22 @@ var ts; if (!compilerOptions.noEmitHelpers) { // Only Emit __extends function when target ES5. // For target ES6 and above, we can emit classDeclaration as is. - if ((languageVersion < 2 /* ES6 */) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */)) { + if ((languageVersion < 2 /* ES6 */) && (!extendsEmitted && node.flags & 4194304 /* HasClassExtends */)) { writeLines(extendsHelper); extendsEmitted = true; } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 16 /* EmitDecorate */) { + if (!decorateEmitted && node.flags & 8388608 /* HasDecorators */) { writeLines(decorateHelper); if (compilerOptions.emitDecoratorMetadata) { writeLines(metadataHelper); } decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 32 /* EmitParam */) { + if (!paramEmitted && node.flags & 16777216 /* HasParamDecorators */) { writeLines(paramHelper); paramEmitted = true; } - if (!awaiterEmitted && resolver.getNodeCheckFlags(node) & 64 /* EmitAwaiter */) { + if (!awaiterEmitted && node.flags & 33554432 /* HasAsyncFunctions */) { writeLines(awaiterHelper); awaiterEmitted = true; } @@ -37596,28 +38056,41 @@ var ts; emitJavaScriptWorker(node); } } + function changeSourceMapEmit(writer) { + sourceMap = writer; + emitStart = writer.emitStart; + emitEnd = writer.emitEnd; + emitPos = writer.emitPos; + setSourceFile = writer.setSourceFile; + } + function withTemporaryNoSourceMap(callback) { + var prevSourceMap = sourceMap; + setSourceMapWriterEmit(ts.getNullSourceMapWriter()); + callback(); + setSourceMapWriterEmit(prevSourceMap); + } function isSpecializedCommentHandling(node) { switch (node.kind) { // All of these entities are emitted in a specialized fashion. As such, we allow // the specialized methods for each to handle the comments on the nodes. - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 229 /* ExportAssignment */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 230 /* ExportAssignment */: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: // Only emit the leading/trailing comments for an enum if we're actually // emitting the module as well. return shouldEmitEnumDeclaration(node); @@ -37629,9 +38102,9 @@ var ts; // then we don't want to emit comments when we emit the body. It will have already // been taken care of when we emitted the 'return' statement for the function // expression body. - if (node.kind !== 194 /* Block */ && + if (node.kind !== 195 /* Block */ && node.parent && - node.parent.kind === 176 /* ArrowFunction */ && + node.parent.kind === 177 /* ArrowFunction */ && node.parent.body === node && compilerOptions.target <= 1 /* ES5 */) { return false; @@ -37644,13 +38117,13 @@ var ts; switch (node.kind) { case 69 /* Identifier */: return emitIdentifier(node); - case 138 /* Parameter */: + case 139 /* Parameter */: return emitParameter(node); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return emitMethod(node); - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return emitAccessor(node); case 97 /* ThisKeyword */: return emitThis(node); @@ -37670,142 +38143,142 @@ var ts; case 13 /* TemplateMiddle */: case 14 /* TemplateTail */: return emitLiteral(node); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: return emitTemplateExpression(node); - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return emitTemplateSpan(node); - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: return emitJsxElement(node); - case 238 /* JsxText */: + case 239 /* JsxText */: return emitJsxText(node); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return emitJsxExpression(node); - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return emitQualifiedName(node); - case 163 /* ObjectBindingPattern */: + case 164 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 164 /* ArrayBindingPattern */: + case 165 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 165 /* BindingElement */: + case 166 /* BindingElement */: return emitBindingElement(node); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 247 /* PropertyAssignment */: + case 248 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 248 /* ShorthandPropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 170 /* CallExpression */: + case 171 /* CallExpression */: return emitCallExpression(node); - case 171 /* NewExpression */: + case 172 /* NewExpression */: return emitNewExpression(node); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: return emit(node.expression); - case 191 /* AsExpression */: + case 192 /* AsExpression */: return emit(node.expression); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return emitParenExpression(node); - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return emitDeleteExpression(node); - case 178 /* TypeOfExpression */: + case 179 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 179 /* VoidExpression */: + case 180 /* VoidExpression */: return emitVoidExpression(node); - case 180 /* AwaitExpression */: + case 181 /* AwaitExpression */: return emitAwaitExpression(node); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return emitBinaryExpression(node); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return emitConditionalExpression(node); - case 187 /* SpreadElementExpression */: + case 188 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return emitYieldExpression(node); - case 189 /* OmittedExpression */: + case 190 /* OmittedExpression */: return; - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return emitBlock(node); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return emitVariableStatement(node); - case 196 /* EmptyStatement */: + case 197 /* EmptyStatement */: return write(";"); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return emitExpressionStatement(node); - case 198 /* IfStatement */: + case 199 /* IfStatement */: return emitIfStatement(node); - case 199 /* DoStatement */: + case 200 /* DoStatement */: return emitDoStatement(node); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: return emitWhileStatement(node); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return emitForStatement(node); - case 203 /* ForOfStatement */: - case 202 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 203 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 204 /* ContinueStatement */: - case 205 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 206 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return emitReturnStatement(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return emitWithStatement(node); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return emitSwitchStatement(node); - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return emitLabeledStatement(node); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: return emitThrowStatement(node); - case 211 /* TryStatement */: + case 212 /* TryStatement */: return emitTryStatement(node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return emitCatchClause(node); - case 212 /* DebuggerStatement */: + case 213 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return emitClassExpression(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return emitClassDeclaration(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return emitEnumMember(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return emitImportDeclaration(node); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return emitExportDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return emitExportAssignment(node); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return emitSourceFileNode(node); } } @@ -37844,7 +38317,7 @@ var ts; function getLeadingCommentsToEmit(node) { // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 250 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 251 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); @@ -37859,7 +38332,7 @@ var ts; function getTrailingCommentsToEmit(node) { // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 250 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 251 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -38290,7 +38763,25 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) - : (function (moduleNames, containingFile) { return ts.map(moduleNames, function (moduleName) { return resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }); }); + : (function (moduleNames, containingFile) { + var resolvedModuleNames = []; + // resolveModuleName does not store any results between calls. + // lookup is a local cache to avoid resolving the same module name several times + var lookup = {}; + for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { + var moduleName = moduleNames_1[_i]; + var resolvedName = void 0; + if (ts.hasProperty(lookup, moduleName)) { + resolvedName = lookup[moduleName]; + } + else { + resolvedName = resolveModuleName(moduleName, containingFile, options, host).resolvedModule; + lookup[moduleName] = resolvedName; + } + resolvedModuleNames.push(resolvedName); + } + return resolvedModuleNames; + }); var filesByName = ts.createFileMap(); // stores 'filename -> file association' ignoring case // used to track cases when two file names differ only in casing @@ -38408,14 +38899,18 @@ var ts; // tripleslash references has changed return false; } - // check imports + // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed return false; } + if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { + // moduleAugmentations has changed + return false; + } if (resolveModuleNamesWorker) { - var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); // ensure that module resolution results are still correct for (var i = 0; i < moduleNames.length; i++) { @@ -38580,44 +39075,44 @@ var ts; return false; } switch (node.kind) { - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return true; - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return true; - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var classDeclaration = node; if (checkModifiers(classDeclaration.modifiers) || checkTypeParameters(classDeclaration.typeParameters)) { return true; } break; - case 245 /* HeritageClause */: + case 246 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 106 /* ImplementsKeyword */) { diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return true; } break; - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return true; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return true; - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return true; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: - case 215 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: var functionDeclaration = node; if (checkModifiers(functionDeclaration.modifiers) || checkTypeParameters(functionDeclaration.typeParameters) || @@ -38625,20 +39120,20 @@ var ts; return true; } break; - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: var variableStatement = node; if (checkModifiers(variableStatement.modifiers)) { return true; } break; - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: var variableDeclaration = node; if (checkTypeAnnotation(variableDeclaration.type)) { return true; } break; - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: var expression = node; if (expression.typeArguments && expression.typeArguments.length > 0) { var start_2 = expression.typeArguments.pos; @@ -38646,7 +39141,7 @@ var ts; return true; } break; - case 138 /* Parameter */: + case 139 /* Parameter */: var parameter = node; if (parameter.modifiers) { var start_3 = parameter.modifiers.pos; @@ -38662,17 +39157,17 @@ var ts; return true; } break; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); return true; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return true; - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: var typeAssertionExpression = node; diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return true; - case 139 /* Decorator */: + case 140 /* Decorator */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); return true; } @@ -38750,59 +39245,77 @@ var ts; function moduleNameIsEqualTo(a, b) { return a.text === b.text; } + function getTextOfLiteral(literal) { + return literal.text; + } function collectExternalModuleReferences(file) { if (file.imports) { return; } var isJavaScriptFile = ts.isSourceFileJavaScript(file); + var isExternalModuleFile = ts.isExternalModule(file); var imports; + var moduleAugmentations; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, /*allowRelativeModuleNames*/ true, /*collectOnlyRequireCalls*/ false); + collectModuleReferences(node, /*inAmbientModule*/ false); + if (isJavaScriptFile) { + collectRequireCalls(node); + } } file.imports = imports || emptyArray; + file.moduleAugmentations = moduleAugmentations || emptyArray; return; - function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { - if (!collectOnlyRequireCalls) { - switch (node.kind) { - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 230 /* ExportDeclaration */: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { - break; - } - if (!moduleNameExpr.text) { - break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } + function collectModuleReferences(node, inAmbientModule) { + switch (node.kind) { + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 231 /* ExportDeclaration */: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { break; - case 220 /* ModuleDeclaration */: - if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { - // TypeScript 1.0 spec (April 2014): 12.1.6 + } + if (!moduleNameExpr.text) { + break; + } + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference other external modules + // only through top - level external module names. Relative external module names are not permitted. + if (!inAmbientModule || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } + break; + case 221 /* ModuleDeclaration */: + if (ts.isAmbientModule(node) && (inAmbientModule || node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { + var moduleName = node.name; + // Ambient module declarations can be interpreted as augmentations for some existing external modules. + // This will happen in two cases: + // - if current file is external module then module augmentation is a ambient module declaration defined in the top level scope + // - if current file is not external module then module augmentation is an ambient module declaration with non-relative module name + // immediately nested in top level ambient module declaration . + if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) { + (moduleAugmentations || (moduleAugmentations = [])).push(moduleName); + } + else if (!inAmbientModule) { // An AmbientExternalModuleDeclaration declares an external module. // This type of declaration is permitted only in the global module. // The StringLiteral must specify a top - level external module name. // Relative external module names are not permitted - ts.forEachChild(node.body, function (node) { - // TypeScript 1.0 spec (April 2014): 12.1.6 - // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules - // only through top - level external module names. Relative external module names are not permitted. - collect(node, /*allowRelativeModuleNames*/ false, collectOnlyRequireCalls); - }); + // NOTE: body of ambient module is always a module block + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + collectModuleReferences(statement, /*inAmbientModule*/ true); + } } - break; - } + } } - if (isJavaScriptFile) { - if (ts.isRequireCall(node)) { - (imports || (imports = [])).push(node.arguments[0]); - } - else { - ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /*collectOnlyRequireCalls*/ true); }); - } + } + function collectRequireCalls(node) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, collectRequireCalls); } } } @@ -38914,14 +39427,21 @@ var ts; } function processImportedModules(file, basePath) { collectExternalModuleReferences(file); - if (file.imports.length) { + if (file.imports.length || file.moduleAugmentations.length) { file.resolvedModules = {}; - var moduleNames = ts.map(file.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(file.imports, file.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; i++) { + for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); - if (resolution && !options.noResolve) { + // add file to program only if: + // - resolution was successfull + // - noResolve is falsy + // - module name come from the list fo imports + var shouldAddFile = resolution && + !options.noResolve && + i < file.imports.length; + if (shouldAddFile) { var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { // Since currently irrespective of allowJs, we only look for supportedTypeScript extension external module files, @@ -39786,7 +40306,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 176 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 177 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -39798,30 +40318,30 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 194 /* Block */: + case 195 /* Block */: if (!ts.isFunctionBlock(n)) { - var parent_7 = n.parent; + var parent_8 = n.parent; var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collaps the block, but consider its hint span // to be the entire span of the parent. - if (parent_7.kind === 199 /* DoStatement */ || - parent_7.kind === 202 /* ForInStatement */ || - parent_7.kind === 203 /* ForOfStatement */ || - parent_7.kind === 201 /* ForStatement */ || - parent_7.kind === 198 /* IfStatement */ || - parent_7.kind === 200 /* WhileStatement */ || - parent_7.kind === 207 /* WithStatement */ || - parent_7.kind === 246 /* CatchClause */) { - addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); + if (parent_8.kind === 200 /* DoStatement */ || + parent_8.kind === 203 /* ForInStatement */ || + parent_8.kind === 204 /* ForOfStatement */ || + parent_8.kind === 202 /* ForStatement */ || + parent_8.kind === 199 /* IfStatement */ || + parent_8.kind === 201 /* WhileStatement */ || + parent_8.kind === 208 /* WithStatement */ || + parent_8.kind === 247 /* CatchClause */) { + addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_7.kind === 211 /* TryStatement */) { + if (parent_8.kind === 212 /* TryStatement */) { // Could be the try-block, or the finally-block. - var tryStatement = parent_7; + var tryStatement = parent_8; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -39844,23 +40364,23 @@ var ts; break; } // Fallthrough. - case 221 /* ModuleBlock */: { + case 222 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 167 /* ObjectLiteralExpression */: - case 222 /* CaseBlock */: { + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 168 /* ObjectLiteralExpression */: + case 223 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 19 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -39890,12 +40410,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_28 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_28); + for (var name_31 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_31); if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_28); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_31); if (!matches) { continue; } @@ -39908,14 +40428,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_28); + matches = patternMatcher.getMatches(containers, name_31); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_28, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_31, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -39953,7 +40473,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 136 /* ComputedPropertyName */) { + else if (declaration.name.kind === 137 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ true); } else { @@ -39974,7 +40494,7 @@ var ts; } return true; } - if (expression.kind === 168 /* PropertyAccessExpression */) { + if (expression.kind === 169 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -39987,7 +40507,7 @@ var ts; var containers = []; // First, if we started with a computed property name, then add all but the last // portion into the container array. - if (declaration.name.kind === 136 /* ComputedPropertyName */) { + if (declaration.name.kind === 137 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -40061,17 +40581,17 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // If we have a module declared as A.B.C, it is more "intuitive" // to say it only has a single layer of depth do { current = current.parent; - } while (current.kind === 220 /* ModuleDeclaration */); + } while (current.kind === 221 /* ModuleDeclaration */); // fall through - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -40082,21 +40602,21 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -40108,7 +40628,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 227 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -40117,21 +40637,21 @@ var ts; } } break; - case 165 /* BindingElement */: - case 213 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 214 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } // Fall through - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: - case 220 /* ModuleDeclaration */: - case 215 /* FunctionDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 216 /* FunctionDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: childNodes.push(node); break; } @@ -40179,17 +40699,17 @@ var ts; for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { var node = nodes_4[_i]; switch (node.kind) { - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -40200,12 +40720,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 215 /* FunctionDeclaration */) { + if (functionDeclaration.kind === 216 /* FunctionDeclaration */) { // A function declaration is 'top level' if it contains any function declarations // within it. - if (functionDeclaration.body && functionDeclaration.body.kind === 194 /* Block */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 195 /* Block */) { // Proper function declarations can only have identifier names - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 215 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 216 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } // Or if it is not parented by another function. i.e all functions @@ -40265,7 +40785,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 138 /* Parameter */: + case 139 /* Parameter */: if (ts.isBindingPattern(node.name)) { break; } @@ -40273,36 +40793,36 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 145 /* GetAccessor */: + case 146 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 146 /* SetAccessor */: + case 147 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 147 /* CallSignature */: + case 148 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: var variableDeclarationNode; - var name_29; - if (node.kind === 165 /* BindingElement */) { - name_29 = node.name; + var name_32; + if (node.kind === 166 /* BindingElement */) { + name_32 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration - while (variableDeclarationNode && variableDeclarationNode.kind !== 213 /* VariableDeclaration */) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 214 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -40310,24 +40830,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_29 = node.name; + name_32 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.variableElement); } - case 144 /* Constructor */: + case 145 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 232 /* ExportSpecifier */: - case 228 /* ImportSpecifier */: - case 223 /* ImportEqualsDeclaration */: - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: + case 233 /* ExportSpecifier */: + case 229 /* ImportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -40357,29 +40877,29 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: return createSourceFileItem(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return createClassItem(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return createEnumItem(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return createModuleItem(node); - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; function getModuleName(moduleDeclaration) { // We want to maintain quotation marks. - if (moduleDeclaration.name.kind === 9 /* StringLiteral */) { + if (ts.isAmbientModule(moduleDeclaration)) { return getTextOfNode(moduleDeclaration.name); } // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 221 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -40391,7 +40911,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.body && node.body.kind === 194 /* Block */) { + if (node.body && node.body.kind === 195 /* Block */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -40412,7 +40932,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 144 /* Constructor */ && member; + return member.kind === 145 /* Constructor */ && member; }); // Add the constructor parameters in as children of the class (for property parameters). // Note that *all non-binding pattern named* parameters will be added to the nodes array, but parameters that @@ -40436,7 +40956,7 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 136 /* ComputedPropertyName */; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 137 /* ComputedPropertyName */; }); } /** * Like removeComputedProperties, but retains the properties with well known symbol names @@ -40445,13 +40965,13 @@ var ts; return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 220 /* ModuleDeclaration */) { + while (node.body.kind === 221 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 250 /* SourceFile */ + return node.kind === 251 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -41202,7 +41722,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 170 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 171 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -41210,7 +41730,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 69 /* Identifier */ ? expression - : expression.kind === 168 /* PropertyAccessExpression */ + : expression.kind === 169 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -41243,7 +41763,7 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 170 /* CallExpression */ || node.parent.kind === 171 /* NewExpression */) { + if (node.parent.kind === 171 /* CallExpression */ || node.parent.kind === 172 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: // 1. The token introduces a list, and should begin a sig help session @@ -41296,25 +41816,25 @@ var ts; }; } } - else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 172 /* TaggedTemplateExpression */) { + else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 173 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0); } } - else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 172 /* TaggedTemplateExpression */) { + else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 173 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 186 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 192 /* TemplateSpan */ && node.parent.parent.parent.kind === 172 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 193 /* TemplateSpan */ && node.parent.parent.parent.kind === 173 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 186 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 14 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -41432,7 +41952,7 @@ var ts; // // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 185 /* TemplateExpression */) { + if (template.kind === 186 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -41441,7 +41961,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 250 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 251 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -41641,40 +42161,40 @@ var ts; return false; } switch (n.kind) { - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 167 /* ObjectLiteralExpression */: - case 163 /* ObjectBindingPattern */: - case 155 /* TypeLiteral */: - case 194 /* Block */: - case 221 /* ModuleBlock */: - case 222 /* CaseBlock */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 168 /* ObjectLiteralExpression */: + case 164 /* ObjectBindingPattern */: + case 156 /* TypeLiteral */: + case 195 /* Block */: + case 222 /* ModuleBlock */: + case 223 /* CaseBlock */: return nodeEndsWith(n, 16 /* CloseBraceToken */, sourceFile); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 171 /* NewExpression */: + case 172 /* NewExpression */: if (!n.arguments) { return true; } // fall through - case 170 /* CallExpression */: - case 174 /* ParenthesizedExpression */: - case 160 /* ParenthesizedType */: + case 171 /* CallExpression */: + case 175 /* ParenthesizedExpression */: + case 161 /* ParenthesizedType */: return nodeEndsWith(n, 18 /* CloseParenToken */, sourceFile); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 148 /* ConstructSignature */: - case 147 /* CallSignature */: - case 176 /* ArrowFunction */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 149 /* ConstructSignature */: + case 148 /* CallSignature */: + case 177 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -41684,64 +42204,64 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 18 /* CloseParenToken */, sourceFile); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 198 /* IfStatement */: + case 199 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 23 /* SemicolonToken */); - case 166 /* ArrayLiteralExpression */: - case 164 /* ArrayBindingPattern */: - case 169 /* ElementAccessExpression */: - case 136 /* ComputedPropertyName */: - case 157 /* TupleType */: + case 167 /* ArrayLiteralExpression */: + case 165 /* ArrayBindingPattern */: + case 170 /* ElementAccessExpression */: + case 137 /* ComputedPropertyName */: + case 158 /* TupleType */: return nodeEndsWith(n, 20 /* CloseBracketToken */, sourceFile); - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 200 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 201 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 199 /* DoStatement */: + case 200 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; var hasWhileKeyword = findChildOfKind(n, 104 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 18 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 178 /* TypeOfExpression */: - case 177 /* DeleteExpression */: - case 179 /* VoidExpression */: - case 186 /* YieldExpression */: - case 187 /* SpreadElementExpression */: + case 179 /* TypeOfExpression */: + case 178 /* DeleteExpression */: + case 180 /* VoidExpression */: + case 187 /* YieldExpression */: + case 188 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -41797,7 +42317,7 @@ var ts; // for the position of the relevant node (or comma). var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { // find syntax list that covers the span of the node - if (c.kind === 273 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 274 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -41903,7 +42423,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n) || n.kind === 238 /* JsxText */) { + if (isToken(n) || n.kind === 239 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41911,7 +42431,7 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n) || n.kind === 238 /* JsxText */) { + if (isToken(n) || n.kind === 239 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41925,10 +42445,10 @@ var ts; // if no - position is in the node itself so we should recurse in it. // NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia). // if this is the case - then we should assume that token in question is located in previous child. - if (position < child.end && (nodeHasTokens(child) || child.kind === 238 /* JsxText */)) { + if (position < child.end && (nodeHasTokens(child) || child.kind === 239 /* JsxText */)) { var start = child.getStart(sourceFile); var lookInPreviousChild = (start >= position) || - (child.kind === 238 /* JsxText */ && start === child.end); // whitespace only JsxText + (child.kind === 239 /* JsxText */ && start === child.end); // whitespace only JsxText if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); @@ -41940,7 +42460,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 250 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 251 /* SourceFile */); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -41962,7 +42482,7 @@ var ts; ts.findPrecedingToken = findPrecedingToken; function isInString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); - return token && (token.kind === 9 /* StringLiteral */ || token.kind === 162 /* StringLiteralType */) && position > token.getStart(); + return token && (token.kind === 9 /* StringLiteral */ || token.kind === 163 /* StringLiteralType */) && position > token.getStart(); } ts.isInString = isInString; function isInComment(sourceFile, position) { @@ -42066,17 +42586,17 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 151 /* TypeReference */ || node.kind === 170 /* CallExpression */) { + if (node.kind === 152 /* TypeReference */ || node.kind === 171 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 216 /* ClassDeclaration */ || node.kind === 217 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 217 /* ClassDeclaration */ || node.kind === 218 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 134 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 135 /* LastToken */; } ts.isToken = isToken; function isWord(kind) { @@ -42092,7 +42612,7 @@ var ts; ts.isComment = isComment; function isStringOrRegularExpressionOrTemplateLiteral(kind) { if (kind === 9 /* StringLiteral */ - || kind === 162 /* StringLiteralType */ + || kind === 163 /* StringLiteralType */ || kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(kind)) { return true; @@ -42135,13 +42655,40 @@ var ts; return true; } ts.compareDataObjects = compareDataObjects; + function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { + if (node.kind === 167 /* ArrayLiteralExpression */ || + node.kind === 168 /* ObjectLiteralExpression */) { + // [a,b,c] from: + // [a, b, c] = someExpression; + if (node.parent.kind === 184 /* BinaryExpression */ && + node.parent.left === node && + node.parent.operatorToken.kind === 56 /* EqualsToken */) { + return true; + } + // [a, b, c] from: + // for([a, b, c] of expression) + if (node.parent.kind === 204 /* ForOfStatement */ && + node.parent.initializer === node) { + return true; + } + // [a, b, c] of + // [x, [a, b, c] ] = someExpression + // or + // {x, a: {a, b, c} } = someExpression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 248 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + return true; + } + } + return false; + } + ts.isArrayLiteralOrObjectLiteralDestructuringPattern = isArrayLiteralOrObjectLiteralDestructuringPattern; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 138 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 139 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -42329,7 +42876,7 @@ var ts; ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 228 /* ImportSpecifier */ || location.parent.kind === 232 /* ExportSpecifier */) && + (location.parent.kind === 229 /* ImportSpecifier */ || location.parent.kind === 233 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -42452,10 +42999,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 240 /* JsxAttribute */: - case 237 /* JsxOpeningElement */: - case 239 /* JsxClosingElement */: - case 236 /* JsxSelfClosingElement */: + case 241 /* JsxAttribute */: + case 238 /* JsxOpeningElement */: + case 240 /* JsxClosingElement */: + case 237 /* JsxSelfClosingElement */: return node.kind === 69 /* Identifier */; } } @@ -43059,9 +43606,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_30 in o) { - if (o[name_30] === rule) { - return name_30; + for (var name_33 in o) { + if (o[name_33] === rule) { + return name_33; } } throw new Error("Unknown rule"); @@ -43070,40 +43617,40 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 201 /* ForStatement */; + return context.contextNode.kind === 202 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 183 /* BinaryExpression */: - case 184 /* ConditionalExpression */: - case 191 /* AsExpression */: - case 150 /* TypePredicate */: - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 184 /* BinaryExpression */: + case 185 /* ConditionalExpression */: + case 192 /* AsExpression */: + case 151 /* TypePredicate */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 165 /* BindingElement */: + case 166 /* BindingElement */: // equals in type X = ... - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: // equal in p = 0; - case 138 /* Parameter */: - case 249 /* EnumMember */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 139 /* Parameter */: + case 250 /* EnumMember */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return context.currentTokenSpan.kind === 56 /* EqualsToken */ || context.nextTokenSpan.kind === 56 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 202 /* ForInStatement */: + case 203 /* ForInStatement */: return context.currentTokenSpan.kind === 90 /* InKeyword */ || context.nextTokenSpan.kind === 90 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 203 /* ForOfStatement */: - return context.currentTokenSpan.kind === 134 /* OfKeyword */ || context.nextTokenSpan.kind === 134 /* OfKeyword */; + case 204 /* ForOfStatement */: + return context.currentTokenSpan.kind === 135 /* OfKeyword */ || context.nextTokenSpan.kind === 135 /* OfKeyword */; } return false; }; @@ -43111,7 +43658,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 184 /* ConditionalExpression */; + return context.contextNode.kind === 185 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -43155,93 +43702,93 @@ var ts; return true; } switch (node.kind) { - case 194 /* Block */: - case 222 /* CaseBlock */: - case 167 /* ObjectLiteralExpression */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 223 /* CaseBlock */: + case 168 /* ObjectLiteralExpression */: + case 222 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: //case SyntaxKind.MemberFunctionDeclaration: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: ///case SyntaxKind.MethodSignature: - case 147 /* CallSignature */: - case 175 /* FunctionExpression */: - case 144 /* Constructor */: - case 176 /* ArrowFunction */: + case 148 /* CallSignature */: + case 176 /* FunctionExpression */: + case 145 /* Constructor */: + case 177 /* ArrowFunction */: //case SyntaxKind.ConstructorDeclaration: //case SyntaxKind.SimpleArrowFunctionExpression: //case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 215 /* FunctionDeclaration */ || context.contextNode.kind === 175 /* FunctionExpression */; + return context.contextNode.kind === 216 /* FunctionDeclaration */ || context.contextNode.kind === 176 /* FunctionExpression */; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 155 /* TypeLiteral */: - case 220 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 156 /* TypeLiteral */: + case 221 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 216 /* ClassDeclaration */: - case 220 /* ModuleDeclaration */: - case 219 /* EnumDeclaration */: - case 194 /* Block */: - case 246 /* CatchClause */: - case 221 /* ModuleBlock */: - case 208 /* SwitchStatement */: + case 217 /* ClassDeclaration */: + case 221 /* ModuleDeclaration */: + case 220 /* EnumDeclaration */: + case 195 /* Block */: + case 247 /* CatchClause */: + case 222 /* ModuleBlock */: + case 209 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 198 /* IfStatement */: - case 208 /* SwitchStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 200 /* WhileStatement */: - case 211 /* TryStatement */: - case 199 /* DoStatement */: - case 207 /* WithStatement */: + case 199 /* IfStatement */: + case 209 /* SwitchStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 201 /* WhileStatement */: + case 212 /* TryStatement */: + case 200 /* DoStatement */: + case 208 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 246 /* CatchClause */: + case 247 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 167 /* ObjectLiteralExpression */; + return context.contextNode.kind === 168 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 170 /* CallExpression */; + return context.contextNode.kind === 171 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 171 /* NewExpression */; + return context.contextNode.kind === 172 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -43253,7 +43800,7 @@ var ts; return context.nextTokenSpan.kind !== 20 /* CloseBracketToken */; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 176 /* ArrowFunction */; + return context.contextNode.kind === 177 /* ArrowFunction */; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); @@ -43271,41 +43818,41 @@ var ts; while (ts.isExpression(node)) { node = node.parent; } - return node.kind === 139 /* Decorator */; + return node.kind === 140 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 214 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 215 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 220 /* ModuleDeclaration */; + return context.contextNode.kind === 221 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 155 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 156 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { if (token.kind !== 25 /* LessThanToken */ && token.kind !== 27 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 151 /* TypeReference */: - case 173 /* TypeAssertionExpression */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 190 /* ExpressionWithTypeArguments */: + case 152 /* TypeReference */: + case 174 /* TypeAssertionExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 191 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -43316,13 +43863,13 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 173 /* TypeAssertionExpression */; + return context.contextNode.kind === 174 /* TypeAssertionExpression */; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 179 /* VoidExpression */; + return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 180 /* VoidExpression */; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 186 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 187 /* YieldExpression */ && context.contextNode.expression !== undefined; }; return Rules; }()); @@ -43346,7 +43893,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 134 /* LastToken */ + 1; + this.mapRowLength = 135 /* LastToken */ + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); //new Array(this.mapRowLength * this.mapRowLength); // This array is used only during construction of the rulesbucket in the map var rulesBucketConstructionStateList = new Array(this.map.length); //new Array(this.map.length); @@ -43541,7 +44088,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0 /* FirstToken */; token <= 134 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 135 /* LastToken */; token++) { result.push(token); } return result; @@ -43583,9 +44130,9 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(70 /* FirstKeyword */, 134 /* LastKeyword */); + TokenRange.Keywords = TokenRange.FromRange(70 /* FirstKeyword */, 135 /* LastKeyword */); TokenRange.BinaryOperators = TokenRange.FromRange(25 /* FirstBinaryOperator */, 68 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90 /* InKeyword */, 91 /* InstanceOfKeyword */, 134 /* OfKeyword */, 116 /* AsKeyword */, 124 /* IsKeyword */]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90 /* InKeyword */, 91 /* InstanceOfKeyword */, 135 /* OfKeyword */, 116 /* AsKeyword */, 124 /* IsKeyword */]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([41 /* PlusPlusToken */, 42 /* MinusMinusToken */, 50 /* TildeToken */, 49 /* ExclamationToken */]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8 /* NumericLiteral */, 69 /* Identifier */, 17 /* OpenParenToken */, 19 /* OpenBracketToken */, 15 /* OpenBraceToken */, 97 /* ThisKeyword */, 92 /* NewKeyword */]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([69 /* Identifier */, 17 /* OpenParenToken */, 97 /* ThisKeyword */, 92 /* NewKeyword */]); @@ -43815,17 +44362,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 194 /* Block */ && ts.rangeContainsRange(body.statements, node); - case 250 /* SourceFile */: - case 194 /* Block */: - case 221 /* ModuleBlock */: + return body && body.kind === 195 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 251 /* SourceFile */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -44027,19 +44574,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 216 /* ClassDeclaration */: return 73 /* ClassKeyword */; - case 217 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; - case 215 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; - case 219 /* EnumDeclaration */: return 219 /* EnumDeclaration */; - case 145 /* GetAccessor */: return 123 /* GetKeyword */; - case 146 /* SetAccessor */: return 129 /* SetKeyword */; - case 143 /* MethodDeclaration */: + case 217 /* ClassDeclaration */: return 73 /* ClassKeyword */; + case 218 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; + case 216 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; + case 220 /* EnumDeclaration */: return 220 /* EnumDeclaration */; + case 146 /* GetAccessor */: return 123 /* GetKeyword */; + case 147 /* SetAccessor */: return 129 /* SetKeyword */; + case 144 /* MethodDeclaration */: if (node.asteriskToken) { return 37 /* AsteriskToken */; } // fall-through - case 141 /* PropertyDeclaration */: - case 138 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 139 /* Parameter */: return node.name.kind; } } @@ -44179,7 +44726,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 139 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 140 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -44523,20 +45070,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 144 /* Constructor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 176 /* ArrowFunction */: + case 145 /* Constructor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 177 /* ArrowFunction */: if (node.typeParameters === list) { return 25 /* LessThanToken */; } @@ -44544,8 +45091,8 @@ var ts; return 17 /* OpenParenToken */; } break; - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: if (node.typeArguments === list) { return 25 /* LessThanToken */; } @@ -44553,7 +45100,7 @@ var ts; return 17 /* OpenParenToken */; } break; - case 151 /* TypeReference */: + case 152 /* TypeReference */: if (node.typeArguments === list) { return 25 /* LessThanToken */; } @@ -44669,7 +45216,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 183 /* BinaryExpression */) { + if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 184 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -44788,7 +45335,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 250 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 251 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -44821,7 +45368,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 198 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 199 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 80 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -44833,23 +45380,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 151 /* TypeReference */: + case 152 /* TypeReference */: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return node.parent.properties; - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return node.parent.elements; - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: { + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -44860,8 +45407,8 @@ var ts; } break; } - case 171 /* NewExpression */: - case 170 /* CallExpression */: { + case 172 /* NewExpression */: + case 171 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -44891,8 +45438,8 @@ var ts; if (node.kind === 18 /* CloseParenToken */) { return -1 /* Unknown */; } - if (node.parent && (node.parent.kind === 170 /* CallExpression */ || - node.parent.kind === 171 /* NewExpression */) && + if (node.parent && (node.parent.kind === 171 /* CallExpression */ || + node.parent.kind === 172 /* NewExpression */) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -44910,10 +45457,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: node = node.expression; break; default: @@ -44977,45 +45524,45 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 197 /* ExpressionStatement */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 166 /* ArrayLiteralExpression */: - case 194 /* Block */: - case 221 /* ModuleBlock */: - case 167 /* ObjectLiteralExpression */: - case 155 /* TypeLiteral */: - case 157 /* TupleType */: - case 222 /* CaseBlock */: - case 244 /* DefaultClause */: - case 243 /* CaseClause */: - case 174 /* ParenthesizedExpression */: - case 168 /* PropertyAccessExpression */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 195 /* VariableStatement */: - case 213 /* VariableDeclaration */: - case 229 /* ExportAssignment */: - case 206 /* ReturnStatement */: - case 184 /* ConditionalExpression */: - case 164 /* ArrayBindingPattern */: - case 163 /* ObjectBindingPattern */: - case 237 /* JsxOpeningElement */: - case 236 /* JsxSelfClosingElement */: - case 242 /* JsxExpression */: - case 142 /* MethodSignature */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 138 /* Parameter */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 160 /* ParenthesizedType */: - case 172 /* TaggedTemplateExpression */: - case 180 /* AwaitExpression */: - case 227 /* NamedImports */: + case 198 /* ExpressionStatement */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 167 /* ArrayLiteralExpression */: + case 195 /* Block */: + case 222 /* ModuleBlock */: + case 168 /* ObjectLiteralExpression */: + case 156 /* TypeLiteral */: + case 158 /* TupleType */: + case 223 /* CaseBlock */: + case 245 /* DefaultClause */: + case 244 /* CaseClause */: + case 175 /* ParenthesizedExpression */: + case 169 /* PropertyAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 196 /* VariableStatement */: + case 214 /* VariableDeclaration */: + case 230 /* ExportAssignment */: + case 207 /* ReturnStatement */: + case 185 /* ConditionalExpression */: + case 165 /* ArrayBindingPattern */: + case 164 /* ObjectBindingPattern */: + case 238 /* JsxOpeningElement */: + case 237 /* JsxSelfClosingElement */: + case 243 /* JsxExpression */: + case 143 /* MethodSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 139 /* Parameter */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 161 /* ParenthesizedType */: + case 173 /* TaggedTemplateExpression */: + case 181 /* AwaitExpression */: + case 228 /* NamedImports */: return true; } return false; @@ -45024,22 +45571,22 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 201 /* ForStatement */: - case 198 /* IfStatement */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: - case 176 /* ArrowFunction */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - return childKind !== 194 /* Block */; - case 235 /* JsxElement */: - return childKind !== 239 /* JsxClosingElement */; + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 202 /* ForStatement */: + case 199 /* IfStatement */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 177 /* ArrowFunction */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + return childKind !== 195 /* Block */; + case 236 /* JsxElement */: + return childKind !== 240 /* JsxClosingElement */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -45191,7 +45738,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(273 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); + var list = createNode(274 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { @@ -45210,7 +45757,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 135 /* FirstNode */) { + if (this.kind >= 136 /* FirstNode */) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -45257,7 +45804,7 @@ var ts; return undefined; } var child = children[0]; - return child.kind < 135 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + return child.kind < 136 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -45265,7 +45812,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 135 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 136 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; return NodeObject; }()); @@ -45314,7 +45861,7 @@ var ts; if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments - if (canUseParsedParamTagComments && declaration.kind === 138 /* Parameter */) { + if (canUseParsedParamTagComments && declaration.kind === 139 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -45323,15 +45870,15 @@ var ts; }); } // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === 220 /* ModuleDeclaration */ && declaration.body.kind === 220 /* ModuleDeclaration */) { + if (declaration.kind === 221 /* ModuleDeclaration */ && declaration.body.kind === 221 /* ModuleDeclaration */) { return; } // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === 220 /* ModuleDeclaration */ && declaration.parent.kind === 220 /* ModuleDeclaration */) { + while (declaration.kind === 221 /* ModuleDeclaration */ && declaration.parent.kind === 221 /* ModuleDeclaration */) { declaration = declaration.parent; } // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange(declaration.kind === 213 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 214 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { ts.addRange(jsDocCommentParts, cleanedJsDocComment); @@ -45676,9 +46223,9 @@ var ts; if (result_2 !== undefined) { return result_2; } - if (declaration.name.kind === 136 /* ComputedPropertyName */) { + if (declaration.name.kind === 137 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 168 /* PropertyAccessExpression */) { + if (expr.kind === 169 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -45698,9 +46245,9 @@ var ts; } function visit(node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -45720,60 +46267,60 @@ var ts; ts.forEachChild(node, visit); } break; - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 219 /* EnumDeclaration */: - case 220 /* ModuleDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 232 /* ExportSpecifier */: - case 228 /* ImportSpecifier */: - case 223 /* ImportEqualsDeclaration */: - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 155 /* TypeLiteral */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 220 /* EnumDeclaration */: + case 221 /* ModuleDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 233 /* ExportSpecifier */: + case 229 /* ImportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 156 /* TypeLiteral */: addDeclaration(node); // fall through - case 144 /* Constructor */: - case 195 /* VariableStatement */: - case 214 /* VariableDeclarationList */: - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: - case 221 /* ModuleBlock */: + case 145 /* Constructor */: + case 196 /* VariableStatement */: + case 215 /* VariableDeclarationList */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: + case 222 /* ModuleBlock */: ts.forEachChild(node, visit); break; - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 138 /* Parameter */: + case 139 /* Parameter */: // Only consider properties defined as constructor parameters if (!(node.flags & 56 /* AccessibilityModifier */)) { break; } // fall through - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 249 /* EnumMember */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 250 /* EnumMember */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: addDeclaration(node); break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -45785,7 +46332,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 227 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -45961,6 +46508,9 @@ var ts; ClassificationTypeNames.jsxOpenTagName = "jsx open tag name"; ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; + ClassificationTypeNames.jsxAttribute = "jsx attribute"; + ClassificationTypeNames.jsxText = "jsx text"; + ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value"; return ClassificationTypeNames; }()); ts.ClassificationTypeNames = ClassificationTypeNames; @@ -45986,6 +46536,9 @@ var ts; ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName"; ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName"; ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText"; + ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; })(ts.ClassificationType || (ts.ClassificationType = {})); var ClassificationType = ts.ClassificationType; function displayPartsToString(displayParts) { @@ -46001,16 +46554,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 175 /* FunctionExpression */) { + if (declaration.kind === 176 /* FunctionExpression */) { return true; } - if (declaration.kind !== 213 /* VariableDeclaration */ && declaration.kind !== 215 /* FunctionDeclaration */) { + if (declaration.kind !== 214 /* VariableDeclaration */ && declaration.kind !== 216 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable - for (var parent_8 = declaration.parent; !ts.isFunctionBlock(parent_8); parent_8 = parent_8.parent) { + for (var parent_9 = declaration.parent; !ts.isFunctionBlock(parent_9); parent_9 = parent_9.parent) { // Reached source file or module block - if (parent_8.kind === 250 /* SourceFile */ || parent_8.kind === 221 /* ModuleBlock */) { + if (parent_9.kind === 251 /* SourceFile */ || parent_9.kind === 222 /* ModuleBlock */) { return false; } } @@ -46266,18 +46819,12 @@ var ts; return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; - function createGetCanonicalFileName(useCaseSensitivefileNames) { - return useCaseSensitivefileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); - } - ts.createGetCanonicalFileName = createGetCanonicalFileName; function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) { if (currentDirectory === void 0) { currentDirectory = ""; } // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have // for those settings. var buckets = {}; - var getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); + var getCanonicalFileName = ts.createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings) { return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs; } @@ -46642,7 +47189,7 @@ var ts; /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 209 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 210 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -46651,12 +47198,12 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 69 /* Identifier */ && - (node.parent.kind === 205 /* BreakStatement */ || node.parent.kind === 204 /* ContinueStatement */) && + (node.parent.kind === 206 /* BreakStatement */ || node.parent.kind === 205 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 69 /* Identifier */ && - node.parent.kind === 209 /* LabeledStatement */ && + node.parent.kind === 210 /* LabeledStatement */ && node.parent.label === node; } /** @@ -46664,7 +47211,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 209 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 210 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -46675,25 +47222,25 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 171 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 172 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 220 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 221 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 69 /* Identifier */ && @@ -46702,22 +47249,22 @@ var ts; /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node) { return (node.kind === 69 /* Identifier */ || node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - (node.parent.kind === 247 /* PropertyAssignment */ || node.parent.kind === 248 /* ShorthandPropertyAssignment */) && node.parent.name === node; + (node.parent.kind === 248 /* PropertyAssignment */ || node.parent.kind === 249 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { switch (node.parent.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 247 /* PropertyAssignment */: - case 249 /* EnumMember */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 220 /* ModuleDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 248 /* PropertyAssignment */: + case 250 /* EnumMember */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 221 /* ModuleDeclaration */: return node.parent.name === node; - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } @@ -46776,7 +47323,7 @@ var ts; })(BreakContinueSearchType || (BreakContinueSearchType = {})); // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 70 /* FirstKeyword */; i <= 134 /* LastKeyword */; i++) { + for (var i = 70 /* FirstKeyword */; i <= 135 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -46791,17 +47338,17 @@ var ts; return undefined; } switch (node.kind) { - case 250 /* SourceFile */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 220 /* ModuleDeclaration */: + case 251 /* SourceFile */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 221 /* ModuleDeclaration */: return node; } } @@ -46809,38 +47356,38 @@ var ts; ts.getContainerNode = getContainerNode; /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 220 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 216 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 217 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 218 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 219 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 213 /* VariableDeclaration */: + case 221 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 217 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 218 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 219 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 220 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 214 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 215 /* FunctionDeclaration */: return ScriptElementKind.functionElement; - case 145 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; - case 146 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 216 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 146 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 147 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return ScriptElementKind.memberFunctionElement; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return ScriptElementKind.memberVariableElement; - case 149 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; - case 148 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; - case 147 /* CallSignature */: return ScriptElementKind.callSignatureElement; - case 144 /* Constructor */: return ScriptElementKind.constructorImplementationElement; - case 137 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 249 /* EnumMember */: return ScriptElementKind.variableElement; - case 138 /* Parameter */: return (node.flags & 56 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 223 /* ImportEqualsDeclaration */: - case 228 /* ImportSpecifier */: - case 225 /* ImportClause */: - case 232 /* ExportSpecifier */: - case 226 /* NamespaceImport */: + case 150 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 149 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 148 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 145 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 138 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 250 /* EnumMember */: return ScriptElementKind.variableElement; + case 139 /* Parameter */: return (node.flags & 56 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 224 /* ImportEqualsDeclaration */: + case 229 /* ImportSpecifier */: + case 226 /* ImportClause */: + case 233 /* ExportSpecifier */: + case 227 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -46878,7 +47425,7 @@ var ts; host.log(message); } } - var getCanonicalFileName = createGetCanonicalFileName(useCaseSensitivefileNames); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitivefileNames); function getValidSourceFile(fileName) { var sourceFile = program.getSourceFile(fileName); if (!sourceFile) { @@ -47152,9 +47699,9 @@ var ts; isJsDocTagName = true; } switch (tag.kind) { - case 271 /* JSDocTypeTag */: - case 269 /* JSDocParameterTag */: - case 270 /* JSDocReturnTag */: + case 272 /* JSDocTypeTag */: + case 270 /* JSDocParameterTag */: + case 271 /* JSDocReturnTag */: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -47199,13 +47746,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_9 = contextToken.parent, kind = contextToken.kind; + var parent_10 = contextToken.parent, kind = contextToken.kind; if (kind === 21 /* DotToken */) { - if (parent_9.kind === 168 /* PropertyAccessExpression */) { + if (parent_10.kind === 169 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_9.kind === 135 /* QualifiedName */) { + else if (parent_10.kind === 136 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -47220,8 +47767,9 @@ var ts; isRightOfOpenTag = true; location = contextToken; } - else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 239 /* JsxClosingElement */) { + else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 240 /* JsxClosingElement */) { isStartingCloseTag = true; + location = contextToken; } } } @@ -47245,7 +47793,10 @@ var ts; } else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; - symbols = [typeChecker.getSymbolAtLocation(tagName)]; + var tagSymbol = typeChecker.getSymbolAtLocation(tagName); + if (!typeChecker.isUnknownSymbol(tagSymbol)) { + symbols = [tagSymbol]; + } isMemberCompletion = true; isNewIdentifierLocation = false; } @@ -47263,7 +47814,7 @@ var ts; // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */) { + if (node.kind === 69 /* Identifier */ || node.kind === 136 /* QualifiedName */ || node.kind === 169 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -47319,7 +47870,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType; - if ((jsxContainer.kind === 236 /* JsxSelfClosingElement */) || (jsxContainer.kind === 237 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 237 /* JsxSelfClosingElement */) || (jsxContainer.kind === 238 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); if (attrsType) { @@ -47391,15 +47942,15 @@ var ts; return result; } function isInJsxText(contextToken) { - if (contextToken.kind === 238 /* JsxText */) { + if (contextToken.kind === 239 /* JsxText */) { return true; } if (contextToken.kind === 27 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 237 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 238 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 239 /* JsxClosingElement */ || contextToken.parent.kind === 236 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 235 /* JsxElement */; + if (contextToken.parent.kind === 240 /* JsxClosingElement */ || contextToken.parent.kind === 237 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 236 /* JsxElement */; } } return false; @@ -47409,40 +47960,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 170 /* CallExpression */ // func( a, | - || containingNodeKind === 144 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 171 /* NewExpression */ // new C(a, | - || containingNodeKind === 166 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 183 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 152 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 171 /* CallExpression */ // func( a, | + || containingNodeKind === 145 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 172 /* NewExpression */ // new C(a, | + || containingNodeKind === 167 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 184 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 153 /* FunctionType */; // var x: (s: string, list| case 17 /* OpenParenToken */: - return containingNodeKind === 170 /* CallExpression */ // func( | - || containingNodeKind === 144 /* Constructor */ // constructor( | - || containingNodeKind === 171 /* NewExpression */ // new C(a| - || containingNodeKind === 174 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 160 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 171 /* CallExpression */ // func( | + || containingNodeKind === 145 /* Constructor */ // constructor( | + || containingNodeKind === 172 /* NewExpression */ // new C(a| + || containingNodeKind === 175 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 161 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 19 /* OpenBracketToken */: - return containingNodeKind === 166 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 149 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 136 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + return containingNodeKind === 167 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 150 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 137 /* ComputedPropertyName */; // [ | /* this can become an index signature */ case 125 /* ModuleKeyword */: // module | case 126 /* NamespaceKeyword */: return true; case 21 /* DotToken */: - return containingNodeKind === 220 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 221 /* ModuleDeclaration */; // module A.| case 15 /* OpenBraceToken */: - return containingNodeKind === 216 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 217 /* ClassDeclaration */; // class A{ | case 56 /* EqualsToken */: - return containingNodeKind === 213 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 183 /* BinaryExpression */; // x = a| + return containingNodeKind === 214 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 184 /* BinaryExpression */; // x = a| case 12 /* TemplateHead */: - return containingNodeKind === 185 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 186 /* TemplateExpression */; // `aa ${| case 13 /* TemplateMiddle */: - return containingNodeKind === 192 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 193 /* TemplateSpan */; // `aa ${10} dd ${| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: - return containingNodeKind === 141 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 142 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -47456,7 +48007,7 @@ var ts; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) { if (contextToken.kind === 9 /* StringLiteral */ - || contextToken.kind === 162 /* StringLiteralType */ + || contextToken.kind === 163 /* StringLiteralType */ || contextToken.kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(contextToken.kind)) { var start_7 = contextToken.getStart(); @@ -47486,14 +48037,14 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 167 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 168 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; typeForObject = typeChecker.getContextualType(objectLikeContainer); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 163 /* ObjectBindingPattern */) { + else if (objectLikeContainer.kind === 164 /* ObjectBindingPattern */) { // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -47539,9 +48090,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 227 /* NamedImports */ ? - 224 /* ImportDeclaration */ : - 230 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 228 /* NamedImports */ ? + 225 /* ImportDeclaration */ : + 231 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -47566,9 +48117,9 @@ var ts; switch (contextToken.kind) { case 15 /* OpenBraceToken */: // const x = { | case 24 /* CommaToken */: - var parent_10 = contextToken.parent; - if (parent_10 && (parent_10.kind === 167 /* ObjectLiteralExpression */ || parent_10.kind === 163 /* ObjectBindingPattern */)) { - return parent_10; + var parent_11 = contextToken.parent; + if (parent_11 && (parent_11.kind === 168 /* ObjectLiteralExpression */ || parent_11.kind === 164 /* ObjectBindingPattern */)) { + return parent_11; } break; } @@ -47585,8 +48136,8 @@ var ts; case 15 /* OpenBraceToken */: // import { | case 24 /* CommaToken */: switch (contextToken.parent.kind) { - case 227 /* NamedImports */: - case 231 /* NamedExports */: + case 228 /* NamedImports */: + case 232 /* NamedExports */: return contextToken.parent; } } @@ -47595,37 +48146,37 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_11 = contextToken.parent; + var parent_12 = contextToken.parent; switch (contextToken.kind) { case 26 /* LessThanSlashToken */: case 39 /* SlashToken */: case 69 /* Identifier */: - case 240 /* JsxAttribute */: - case 241 /* JsxSpreadAttribute */: - if (parent_11 && (parent_11.kind === 236 /* JsxSelfClosingElement */ || parent_11.kind === 237 /* JsxOpeningElement */)) { - return parent_11; + case 241 /* JsxAttribute */: + case 242 /* JsxSpreadAttribute */: + if (parent_12 && (parent_12.kind === 237 /* JsxSelfClosingElement */ || parent_12.kind === 238 /* JsxOpeningElement */)) { + return parent_12; } - else if (parent_11.kind === 240 /* JsxAttribute */) { - return parent_11.parent; + else if (parent_12.kind === 241 /* JsxAttribute */) { + return parent_12.parent; } break; // The context token is the closing } or " of an attribute, which means // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_11 && ((parent_11.kind === 240 /* JsxAttribute */) || (parent_11.kind === 241 /* JsxSpreadAttribute */))) { - return parent_11.parent; + if (parent_12 && ((parent_12.kind === 241 /* JsxAttribute */) || (parent_12.kind === 242 /* JsxSpreadAttribute */))) { + return parent_12.parent; } break; case 16 /* CloseBraceToken */: - if (parent_11 && - parent_11.kind === 242 /* JsxExpression */ && - parent_11.parent && - (parent_11.parent.kind === 240 /* JsxAttribute */)) { - return parent_11.parent.parent; + if (parent_12 && + parent_12.kind === 243 /* JsxExpression */ && + parent_12.parent && + (parent_12.parent.kind === 241 /* JsxAttribute */)) { + return parent_12.parent.parent; } - if (parent_11 && parent_11.kind === 241 /* JsxSpreadAttribute */) { - return parent_11.parent; + if (parent_12 && parent_12.kind === 242 /* JsxSpreadAttribute */) { + return parent_12.parent; } break; } @@ -47634,16 +48185,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return true; } return false; @@ -47655,54 +48206,54 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 213 /* VariableDeclaration */ || - containingNodeKind === 214 /* VariableDeclarationList */ || - containingNodeKind === 195 /* VariableStatement */ || - containingNodeKind === 219 /* EnumDeclaration */ || + return containingNodeKind === 214 /* VariableDeclaration */ || + containingNodeKind === 215 /* VariableDeclarationList */ || + containingNodeKind === 196 /* VariableStatement */ || + containingNodeKind === 220 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 216 /* ClassDeclaration */ || - containingNodeKind === 188 /* ClassExpression */ || - containingNodeKind === 217 /* InterfaceDeclaration */ || - containingNodeKind === 164 /* ArrayBindingPattern */ || - containingNodeKind === 218 /* TypeAliasDeclaration */; // type Map, K, | + containingNodeKind === 217 /* ClassDeclaration */ || + containingNodeKind === 189 /* ClassExpression */ || + containingNodeKind === 218 /* InterfaceDeclaration */ || + containingNodeKind === 165 /* ArrayBindingPattern */ || + containingNodeKind === 219 /* TypeAliasDeclaration */; // type Map, K, | case 21 /* DotToken */: - return containingNodeKind === 164 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 165 /* ArrayBindingPattern */; // var [.| case 54 /* ColonToken */: - return containingNodeKind === 165 /* BindingElement */; // var {x :html| + return containingNodeKind === 166 /* BindingElement */; // var {x :html| case 19 /* OpenBracketToken */: - return containingNodeKind === 164 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 165 /* ArrayBindingPattern */; // var [x| case 17 /* OpenParenToken */: - return containingNodeKind === 246 /* CatchClause */ || + return containingNodeKind === 247 /* CatchClause */ || isFunction(containingNodeKind); case 15 /* OpenBraceToken */: - return containingNodeKind === 219 /* EnumDeclaration */ || - containingNodeKind === 217 /* InterfaceDeclaration */ || - containingNodeKind === 155 /* TypeLiteral */; // const x : { | + return containingNodeKind === 220 /* EnumDeclaration */ || + containingNodeKind === 218 /* InterfaceDeclaration */ || + containingNodeKind === 156 /* TypeLiteral */; // const x : { | case 23 /* SemicolonToken */: - return containingNodeKind === 140 /* PropertySignature */ && + return containingNodeKind === 141 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 217 /* InterfaceDeclaration */ || - contextToken.parent.parent.kind === 155 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 218 /* InterfaceDeclaration */ || + contextToken.parent.parent.kind === 156 /* TypeLiteral */); // const x : { a; | case 25 /* LessThanToken */: - return containingNodeKind === 216 /* ClassDeclaration */ || - containingNodeKind === 188 /* ClassExpression */ || - containingNodeKind === 217 /* InterfaceDeclaration */ || - containingNodeKind === 218 /* TypeAliasDeclaration */ || + return containingNodeKind === 217 /* ClassDeclaration */ || + containingNodeKind === 189 /* ClassExpression */ || + containingNodeKind === 218 /* InterfaceDeclaration */ || + containingNodeKind === 219 /* TypeAliasDeclaration */ || isFunction(containingNodeKind); case 113 /* StaticKeyword */: - return containingNodeKind === 141 /* PropertyDeclaration */; + return containingNodeKind === 142 /* PropertyDeclaration */; case 22 /* DotDotDotToken */: - return containingNodeKind === 138 /* Parameter */ || + return containingNodeKind === 139 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 164 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 165 /* ArrayBindingPattern */); // var [...z| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: - return containingNodeKind === 138 /* Parameter */; + return containingNodeKind === 139 /* Parameter */; case 116 /* AsKeyword */: - return containingNodeKind === 228 /* ImportSpecifier */ || - containingNodeKind === 232 /* ExportSpecifier */ || - containingNodeKind === 226 /* NamespaceImport */; + return containingNodeKind === 229 /* ImportSpecifier */ || + containingNodeKind === 233 /* ExportSpecifier */ || + containingNodeKind === 227 /* NamespaceImport */; case 73 /* ClassKeyword */: case 81 /* EnumKeyword */: case 107 /* InterfaceKeyword */: @@ -47762,8 +48313,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_31 = element.propertyName || element.name; - exisingImportsOrExports[name_31.text] = true; + var name_34 = element.propertyName || element.name; + exisingImportsOrExports[name_34.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -47784,10 +48335,10 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 247 /* PropertyAssignment */ && - m.kind !== 248 /* ShorthandPropertyAssignment */ && - m.kind !== 165 /* BindingElement */ && - m.kind !== 143 /* MethodDeclaration */) { + if (m.kind !== 248 /* PropertyAssignment */ && + m.kind !== 249 /* ShorthandPropertyAssignment */ && + m.kind !== 166 /* BindingElement */ && + m.kind !== 144 /* MethodDeclaration */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -47795,7 +48346,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 165 /* BindingElement */ && m.propertyName) { + if (m.kind === 166 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 69 /* Identifier */) { existingName = m.propertyName.text; @@ -47825,7 +48376,7 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 240 /* JsxAttribute */) { + if (attr.kind === 241 /* JsxAttribute */) { seenNames[attr.name.text] = true; } } @@ -47851,7 +48402,23 @@ var ts; } else { if (!symbols || symbols.length === 0) { - return undefined; + if (sourceFile.languageVariant === 1 /* JSX */ && + location.parent && location.parent.kind === 240 /* JsxClosingElement */) { + // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, + // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. + // For example: + // var x =
completion list at "1" will contain "div" with type any + var tagName = location.parent.parent.openingElement.tagName; + entries.push({ + name: tagName.text, + kind: undefined, + kindModifiers: undefined, + sortText: "0" + }); + } + else { + return undefined; + } } getCompletionEntriesFromSymbols(symbols, entries); } @@ -47864,10 +48431,10 @@ var ts; var entries = []; var target = program.getCompilerOptions().target; var nameTable = getNameTable(sourceFile); - for (var name_32 in nameTable) { - if (!uniqueNames[name_32]) { - uniqueNames[name_32] = name_32; - var displayName = getCompletionEntryDisplayName(name_32, target, /*performCharacterChecks*/ true); + for (var name_35 in nameTable) { + if (!uniqueNames[name_35]) { + uniqueNames[name_35] = name_35; + var displayName = getCompletionEntryDisplayName(name_35, target, /*performCharacterChecks*/ true); if (displayName) { var entry = { name: displayName, @@ -47973,7 +48540,7 @@ var ts; function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); if (flags & 32 /* Class */) - return ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 189 /* ClassExpression */) ? ScriptElementKind.localClassElement : ScriptElementKind.classElement; if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; @@ -48075,7 +48642,7 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 168 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 169 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -48084,7 +48651,7 @@ var ts; } // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 170 /* CallExpression */ || location.kind === 171 /* NewExpression */) { + if (location.kind === 171 /* CallExpression */ || location.kind === 172 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -48097,7 +48664,7 @@ var ts; // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 171 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 172 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -48150,24 +48717,24 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 121 /* ConstructorKeyword */ && location.parent.kind === 144 /* Constructor */)) { + (location.kind === 121 /* ConstructorKeyword */ && location.parent.kind === 145 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 144 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 145 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 144 /* Constructor */) { + if (functionDeclaration.kind === 145 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 147 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 148 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -48176,7 +48743,7 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { - if (ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 189 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -48220,7 +48787,7 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 220 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 221 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 69 /* Identifier */; displayParts.push(ts.keywordPart(isNamespace ? 126 /* NamespaceKeyword */ : 125 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); @@ -48243,17 +48810,17 @@ var ts; } else { // Method/function type parameter - var declaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */); + var declaration = ts.getDeclarationOfKind(symbol, 138 /* TypeParameter */); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 148 /* ConstructSignature */) { + if (declaration.kind === 149 /* ConstructSignature */) { displayParts.push(ts.keywordPart(92 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 147 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 148 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -48273,7 +48840,7 @@ var ts; if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 249 /* EnumMember */) { + if (declaration.kind === 250 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -48289,7 +48856,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 223 /* ImportEqualsDeclaration */) { + if (declaration.kind === 224 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -48418,14 +48985,14 @@ var ts; } var typeChecker = program.getTypeChecker(); var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { + if (!symbol || typeChecker.isUnknownSymbol(symbol)) { // Try getting just type at this position and show switch (node.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: case 97 /* ThisKeyword */: - case 161 /* ThisType */: + case 162 /* ThisType */: case 95 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -48504,8 +49071,8 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 144 /* Constructor */) || - (!selectConstructors && (d.kind === 215 /* FunctionDeclaration */ || d.kind === 143 /* MethodDeclaration */ || d.kind === 142 /* MethodSignature */))) { + if ((selectConstructors && d.kind === 145 /* Constructor */) || + (!selectConstructors && (d.kind === 216 /* FunctionDeclaration */ || d.kind === 144 /* MethodDeclaration */ || d.kind === 143 /* MethodSignature */))) { declarations.push(d); if (d.body) definition = d; @@ -48574,7 +49141,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 248 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 249 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -48650,7 +49217,7 @@ var ts; function getSemanticDocumentHighlights(node) { if (node.kind === 69 /* Identifier */ || node.kind === 97 /* ThisKeyword */ || - node.kind === 161 /* ThisType */ || + node.kind === 162 /* ThisType */ || node.kind === 95 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { @@ -48704,75 +49271,75 @@ var ts; switch (node.kind) { case 88 /* IfKeyword */: case 80 /* ElseKeyword */: - if (hasKind(node.parent, 198 /* IfStatement */)) { + if (hasKind(node.parent, 199 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 94 /* ReturnKeyword */: - if (hasKind(node.parent, 206 /* ReturnStatement */)) { + if (hasKind(node.parent, 207 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 98 /* ThrowKeyword */: - if (hasKind(node.parent, 210 /* ThrowStatement */)) { + if (hasKind(node.parent, 211 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 72 /* CatchKeyword */: - if (hasKind(parent(parent(node)), 211 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 212 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 100 /* TryKeyword */: case 85 /* FinallyKeyword */: - if (hasKind(parent(node), 211 /* TryStatement */)) { + if (hasKind(parent(node), 212 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 96 /* SwitchKeyword */: - if (hasKind(node.parent, 208 /* SwitchStatement */)) { + if (hasKind(node.parent, 209 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 71 /* CaseKeyword */: case 77 /* DefaultKeyword */: - if (hasKind(parent(parent(parent(node))), 208 /* SwitchStatement */)) { + if (hasKind(parent(parent(parent(node))), 209 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 70 /* BreakKeyword */: case 75 /* ContinueKeyword */: - if (hasKind(node.parent, 205 /* BreakStatement */) || hasKind(node.parent, 204 /* ContinueStatement */)) { + if (hasKind(node.parent, 206 /* BreakStatement */) || hasKind(node.parent, 205 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurrences(node.parent); } break; case 86 /* ForKeyword */: - if (hasKind(node.parent, 201 /* ForStatement */) || - hasKind(node.parent, 202 /* ForInStatement */) || - hasKind(node.parent, 203 /* ForOfStatement */)) { + if (hasKind(node.parent, 202 /* ForStatement */) || + hasKind(node.parent, 203 /* ForInStatement */) || + hasKind(node.parent, 204 /* ForOfStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 104 /* WhileKeyword */: case 79 /* DoKeyword */: - if (hasKind(node.parent, 200 /* WhileStatement */) || hasKind(node.parent, 199 /* DoStatement */)) { + if (hasKind(node.parent, 201 /* WhileStatement */) || hasKind(node.parent, 200 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 121 /* ConstructorKeyword */: - if (hasKind(node.parent, 144 /* Constructor */)) { + if (hasKind(node.parent, 145 /* Constructor */)) { return getConstructorOccurrences(node.parent); } break; case 123 /* GetKeyword */: case 129 /* SetKeyword */: - if (hasKind(node.parent, 145 /* GetAccessor */) || hasKind(node.parent, 146 /* SetAccessor */)) { + if (hasKind(node.parent, 146 /* GetAccessor */) || hasKind(node.parent, 147 /* SetAccessor */)) { return getGetAndSetOccurrences(node.parent); } break; default: if (ts.isModifierKind(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 195 /* VariableStatement */)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 196 /* VariableStatement */)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -48788,10 +49355,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 210 /* ThrowStatement */) { + if (node.kind === 211 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 211 /* TryStatement */) { + else if (node.kind === 212 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -48818,19 +49385,19 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_12 = child.parent; - if (ts.isFunctionBlock(parent_12) || parent_12.kind === 250 /* SourceFile */) { - return parent_12; + var parent_13 = child.parent; + if (ts.isFunctionBlock(parent_13) || parent_13.kind === 251 /* SourceFile */) { + return parent_13; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent_12.kind === 211 /* TryStatement */) { - var tryStatement = parent_12; + if (parent_13.kind === 212 /* TryStatement */) { + var tryStatement = parent_13; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_12; + child = parent_13; } return undefined; } @@ -48839,7 +49406,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 205 /* BreakStatement */ || node.kind === 204 /* ContinueStatement */) { + if (node.kind === 206 /* BreakStatement */ || node.kind === 205 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -48854,16 +49421,16 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) { switch (node_2.kind) { - case 208 /* SwitchStatement */: - if (statement.kind === 204 /* ContinueStatement */) { + case 209 /* SwitchStatement */: + if (statement.kind === 205 /* ContinueStatement */) { continue; } // Fall through. - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 200 /* WhileStatement */: - case 199 /* DoStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 201 /* WhileStatement */: + case 200 /* DoStatement */: if (!statement.label || isLabeledBy(node_2, statement.label.text)) { return node_2; } @@ -48882,24 +49449,24 @@ var ts; var container = declaration.parent; // Make sure we only highlight the keyword when it makes sense to do so. if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 216 /* ClassDeclaration */ || - container.kind === 188 /* ClassExpression */ || - (declaration.kind === 138 /* Parameter */ && hasKind(container, 144 /* Constructor */)))) { + if (!(container.kind === 217 /* ClassDeclaration */ || + container.kind === 189 /* ClassExpression */ || + (declaration.kind === 139 /* Parameter */ && hasKind(container, 145 /* Constructor */)))) { return undefined; } } else if (modifier === 113 /* StaticKeyword */) { - if (!(container.kind === 216 /* ClassDeclaration */ || container.kind === 188 /* ClassExpression */)) { + if (!(container.kind === 217 /* ClassDeclaration */ || container.kind === 189 /* ClassExpression */)) { return undefined; } } else if (modifier === 82 /* ExportKeyword */ || modifier === 122 /* DeclareKeyword */) { - if (!(container.kind === 221 /* ModuleBlock */ || container.kind === 250 /* SourceFile */)) { + if (!(container.kind === 222 /* ModuleBlock */ || container.kind === 251 /* SourceFile */)) { return undefined; } } else if (modifier === 115 /* AbstractKeyword */) { - if (!(container.kind === 216 /* ClassDeclaration */ || declaration.kind === 216 /* ClassDeclaration */)) { + if (!(container.kind === 217 /* ClassDeclaration */ || declaration.kind === 217 /* ClassDeclaration */)) { return undefined; } } @@ -48911,8 +49478,8 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 221 /* ModuleBlock */: - case 250 /* SourceFile */: + case 222 /* ModuleBlock */: + case 251 /* SourceFile */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */) { nodes = declaration.members.concat(declaration); @@ -48921,17 +49488,17 @@ var ts; nodes = container.statements; } break; - case 144 /* Constructor */: + case 145 /* Constructor */: nodes = container.parameters.concat(container.parent.members); break; - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. if (modifierFlag & 56 /* AccessibilityModifier */) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 144 /* Constructor */ && member; + return member.kind === 145 /* Constructor */ && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -48984,8 +49551,8 @@ var ts; } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 145 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 146 /* SetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 146 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 147 /* SetAccessor */); return ts.map(keywords, getHighlightSpanForNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); @@ -49008,7 +49575,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86 /* ForKeyword */, 104 /* WhileKeyword */, 79 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 199 /* DoStatement */) { + if (loopNode.kind === 200 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 104 /* WhileKeyword */)) { @@ -49029,13 +49596,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -49089,7 +49656,7 @@ var ts; function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 194 /* Block */))) { + if (!(func && hasKind(func.body, 195 /* Block */))) { return undefined; } var keywords = []; @@ -49105,7 +49672,7 @@ var ts; function getIfElseOccurrences(ifStatement) { var keywords = []; // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 198 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 199 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. @@ -49118,7 +49685,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 198 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 199 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -49235,7 +49802,7 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 97 /* ThisKeyword */ || node.kind === 161 /* ThisType */) { + if (node.kind === 97 /* ThisKeyword */ || node.kind === 162 /* ThisType */) { return getReferencesForThisKeyword(node, sourceFiles); } if (node.kind === 95 /* SuperKeyword */) { @@ -49296,10 +49863,8 @@ var ts; textSpan: ts.createTextSpan(declarations[0].getStart(), 0) }; } - function isImportOrExportSpecifierImportSymbol(symbol) { - return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 232 /* ExportSpecifier */; - }); + function isImportSpecifierSymbol(symbol) { + return (symbol.flags & 8388608 /* Alias */) && !!ts.getDeclarationOfKind(symbol, 229 /* ImportSpecifier */); } function getInternedName(symbol, location, declarations) { // If this is an export or import specifier it could have been renamed using the 'as' syntax. @@ -49325,14 +49890,14 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 175 /* FunctionExpression */ || valueDeclaration.kind === 188 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 176 /* FunctionExpression */ || valueDeclaration.kind === 189 /* ClassExpression */)) { return valueDeclaration; } // If this is private property or method, the scope is the containing class if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 16 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 216 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 217 /* ClassDeclaration */); } } // If the symbol is an import we would like to find it if we are looking for what it imports. @@ -49358,7 +49923,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 251 /* SourceFile */ && !ts.isExternalModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -49531,13 +50096,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 64 /* Static */; switch (searchSpaceNode.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -49569,27 +50134,27 @@ var ts; // Whether 'this' occurs in a static context within a class. var staticFlag = 64 /* Static */; switch (searchSpaceNode.kind) { - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // fall through - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // Fall through - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -49598,7 +50163,7 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 250 /* SourceFile */) { + if (searchSpaceNode.kind === 251 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -49624,33 +50189,33 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || (node.kind !== 97 /* ThisKeyword */ && node.kind !== 161 /* ThisType */)) { + if (!node || (node.kind !== 97 /* ThisKeyword */ && node.kind !== 162 /* ThisType */)) { return; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 64 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 250 /* SourceFile */: - if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { + case 251 /* SourceFile */: + if (container.kind === 251 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -49662,9 +50227,17 @@ var ts; // The search set contains at least the current symbol var result = [symbol]; // If the symbol is an alias, add what it alaises to the list - if (isImportOrExportSpecifierImportSymbol(symbol)) { + if (isImportSpecifierSymbol(symbol)) { result.push(typeChecker.getAliasedSymbol(symbol)); } + // For export specifiers, the exported name can be refering to a local symbol, e.g.: + // import {a} from "mod"; + // export {a as somethingElse} + // We want the *local* declaration of 'a' as declared in the import, + // *not* as declared within "mod" (or farther) + if (location.parent.kind === 233 /* ExportSpecifier */) { + result.push(typeChecker.getExportSpecifierLocalTargetSymbol(location.parent)); + } // If the location is in a context sensitive location (i.e. in an object literal) try // to get a contextual type for it, and add the property symbol from the contextual // type to the search set @@ -49692,7 +50265,7 @@ var ts; // we should include both parameter declaration symbol and property declaration symbol // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in contructor.locals. // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 138 /* Parameter */ && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 139 /* Parameter */ && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } @@ -49704,19 +50277,44 @@ var ts; } // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ {}); } }); return result; } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { + /** + * Find symbol of the given property-name and add the symbol to the given result array + * @param symbol a symbol to start searching for the given propertyName + * @param propertyName a name of property to serach for + * @param result an array of symbol of found property symbols + * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisitng of the same symbol. + * The value of previousIterationSymbol is undefined when the function is first called. + */ + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + if (!symbol) { + return; + } + // If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited + // This is particularly important for the following cases, so that we do not infinitely visit the same symbol. + // For example: + // interface C extends C { + // /*findRef*/propName: string; + // } + // The first time getPropertySymbolsFromBaseTypes is called when finding-all-references at propName, + // the symbol argument will be the symbol of an interface "C" and previousIterationSymbol is undefined, + // the function will add any found symbol of the property-name, then its sub-routine will call + // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already + // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. + if (ts.hasProperty(previousIterationSymbolsCache, symbol.name)) { + return; + } + if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 216 /* ClassDeclaration */) { + if (declaration.kind === 217 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 217 /* InterfaceDeclaration */) { + else if (declaration.kind === 218 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -49731,7 +50329,8 @@ var ts; result.push(propertySymbol); } // Visit the typeReference as well to see if it directly or indirectly use that property - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); + previousIterationSymbolsCache[symbol.name] = symbol; + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); } } } @@ -49742,12 +50341,22 @@ var ts; } // If the reference symbol is an alias, check if what it is aliasing is one of the search // symbols. - if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { + if (isImportSpecifierSymbol(referenceSymbol)) { var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); if (searchSymbols.indexOf(aliasedSymbol) >= 0) { return aliasedSymbol; } } + // For export specifiers, it can be a local symbol, e.g. + // import {a} from "mod"; + // export {a as somethingElse} + // We want the local target of the export (i.e. the import symbol) and not the final target (i.e. "mod".a) + if (referenceLocation.parent.kind === 233 /* ExportSpecifier */) { + var aliasedSymbol = typeChecker.getExportSpecifierLocalTargetSymbol(referenceLocation.parent); + if (searchSymbols.indexOf(aliasedSymbol) >= 0) { + return aliasedSymbol; + } + } // If the reference location is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this symbol to // compare to our searchSymbol @@ -49767,7 +50376,7 @@ var ts; // see if any is in the list if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { var result_3 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3, /*previousIterationSymbolsCache*/ {}); return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } return undefined; @@ -49777,19 +50386,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_33 = node.text; + var name_36 = node.text; if (contextualType) { if (contextualType.flags & 16384 /* Union */) { // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) // if not, search the constituent types for the property - var unionProperty = contextualType.getProperty(name_33); + var unionProperty = contextualType.getProperty(name_36); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_33); + var symbol = t.getProperty(name_36); if (symbol) { result_4.push(symbol); } @@ -49798,7 +50407,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_33); + var symbol_1 = contextualType.getProperty(name_36); if (symbol_1) { return [symbol_1]; } @@ -49856,10 +50465,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 182 /* PostfixUnaryExpression */ || parent.kind === 181 /* PrefixUnaryExpression */) { + if (parent.kind === 183 /* PostfixUnaryExpression */ || parent.kind === 182 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 183 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 184 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; return 56 /* FirstAssignment */ <= operator && operator <= 68 /* LastAssignment */; } @@ -49890,34 +50499,34 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 138 /* Parameter */: - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 247 /* PropertyAssignment */: - case 248 /* ShorthandPropertyAssignment */: - case 249 /* EnumMember */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 246 /* CatchClause */: + case 139 /* Parameter */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 248 /* PropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: + case 250 /* EnumMember */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 247 /* CatchClause */: return 1 /* Value */; - case 137 /* TypeParameter */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 155 /* TypeLiteral */: + case 138 /* TypeParameter */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 156 /* TypeLiteral */: return 2 /* Type */; - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 220 /* ModuleDeclaration */: - if (node.name.kind === 9 /* StringLiteral */) { + case 221 /* ModuleDeclaration */: + if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { @@ -49926,15 +50535,15 @@ var ts; else { return 4 /* Namespace */; } - case 227 /* NamedImports */: - case 228 /* ImportSpecifier */: - case 223 /* ImportEqualsDeclaration */: - case 224 /* ImportDeclaration */: - case 229 /* ExportAssignment */: - case 230 /* ExportDeclaration */: + case 228 /* NamedImports */: + case 229 /* ImportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 225 /* ImportDeclaration */: + case 230 /* ExportAssignment */: + case 231 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 250 /* SourceFile */: + case 251 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; @@ -49943,10 +50552,10 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 151 /* TypeReference */ || - (node.parent.kind === 190 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + return node.parent.kind === 152 /* TypeReference */ || + (node.parent.kind === 191 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || (node.kind === 97 /* ThisKeyword */ && !ts.isExpression(node)) || - node.kind === 161 /* ThisType */; + node.kind === 162 /* ThisType */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -49954,32 +50563,32 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 168 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 168 /* PropertyAccessExpression */) { + if (root.parent.kind === 169 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 169 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 190 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 245 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 191 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 246 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 216 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || - (decl.kind === 217 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); + return (decl.kind === 217 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || + (decl.kind === 218 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 135 /* QualifiedName */) { - while (root.parent && root.parent.kind === 135 /* QualifiedName */) { + if (root.parent.kind === 136 /* QualifiedName */) { + while (root.parent && root.parent.kind === 136 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 151 /* TypeReference */ && !isLastClause; + return root.parent.kind === 152 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 135 /* QualifiedName */) { + while (node.parent.kind === 136 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -49989,15 +50598,15 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 135 /* QualifiedName */ && + if (node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 223 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 224 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 229 /* ExportAssignment */) { + if (node.parent.kind === 230 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -50037,16 +50646,16 @@ var ts; return; } switch (node.kind) { - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: case 9 /* StringLiteral */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: case 84 /* FalseKeyword */: case 99 /* TrueKeyword */: case 93 /* NullKeyword */: case 95 /* SuperKeyword */: case 97 /* ThisKeyword */: - case 161 /* ThisType */: + case 162 /* ThisType */: case 69 /* Identifier */: break; // Cant create the text span @@ -50063,7 +50672,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 220 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 221 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -50104,10 +50713,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -50161,7 +50770,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 220 /* ModuleDeclaration */ && + return declaration.kind === 221 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */; }); } @@ -50212,6 +50821,9 @@ var ts; case 19 /* jsxOpenTagName */: return ClassificationTypeNames.jsxOpenTagName; case 20 /* jsxCloseTagName */: return ClassificationTypeNames.jsxCloseTagName; case 21 /* jsxSelfClosingTagName */: return ClassificationTypeNames.jsxSelfClosingTagName; + case 22 /* jsxAttribute */: return ClassificationTypeNames.jsxAttribute; + case 23 /* jsxText */: return ClassificationTypeNames.jsxText; + case 24 /* jsxAttributeStringLiteralValue */: return ClassificationTypeNames.jsxAttributeStringLiteralValue; } } function convertClassifications(classifications) { @@ -50319,16 +50931,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); pos = tag.tagName.end; switch (tag.kind) { - case 269 /* JSDocParameterTag */: + case 270 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 272 /* JSDocTemplateTag */: + case 273 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 271 /* JSDocTypeTag */: + case 272 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 270 /* JSDocReturnTag */: + case 271 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -50365,7 +50977,8 @@ var ts; function classifyDisabledMergeCode(text, start, end) { // Classify the line that the ======= marker is on as a comment. Then just lex // all further tokens and add them to the result. - for (var i = start; i < end; i++) { + var i; + for (i = start; i < end; i++) { if (ts.isLineBreak(text.charCodeAt(i))) { break; } @@ -50385,11 +50998,11 @@ var ts; pushClassification(start, end - start, type); } } - function classifyToken(token) { + function classifyTokenOrJsxText(token) { if (ts.nodeIsMissing(token)) { return; } - var tokenStart = classifyLeadingTriviaAndGetTokenStart(token); + var tokenStart = token.kind === 239 /* JsxText */ ? token.pos : classifyLeadingTriviaAndGetTokenStart(token); var tokenWidth = token.end - tokenStart; ts.Debug.assert(tokenWidth >= 0); if (tokenWidth > 0) { @@ -50419,16 +51032,17 @@ var ts; if (token) { if (tokenKind === 56 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 213 /* VariableDeclaration */ || - token.parent.kind === 141 /* PropertyDeclaration */ || - token.parent.kind === 138 /* Parameter */) { + if (token.parent.kind === 214 /* VariableDeclaration */ || + token.parent.kind === 142 /* PropertyDeclaration */ || + token.parent.kind === 139 /* Parameter */ || + token.parent.kind === 241 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 183 /* BinaryExpression */ || - token.parent.kind === 181 /* PrefixUnaryExpression */ || - token.parent.kind === 182 /* PostfixUnaryExpression */ || - token.parent.kind === 184 /* ConditionalExpression */) { + if (token.parent.kind === 184 /* BinaryExpression */ || + token.parent.kind === 182 /* PrefixUnaryExpression */ || + token.parent.kind === 183 /* PostfixUnaryExpression */ || + token.parent.kind === 185 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -50437,8 +51051,8 @@ var ts; else if (tokenKind === 8 /* NumericLiteral */) { return 4 /* numericLiteral */; } - else if (tokenKind === 9 /* StringLiteral */ || tokenKind === 162 /* StringLiteralType */) { - return 6 /* stringLiteral */; + else if (tokenKind === 9 /* StringLiteral */ || tokenKind === 163 /* StringLiteralType */) { + return token.parent.kind === 241 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 10 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -50448,54 +51062,61 @@ var ts; // TODO (drosen): we should *also* get another classification type for these literals. return 6 /* stringLiteral */; } + else if (tokenKind === 239 /* JsxText */) { + return 23 /* jsxText */; + } else if (tokenKind === 69 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 138 /* Parameter */: + case 139 /* Parameter */: if (token.parent.name === token) { return 17 /* parameterName */; } return; - case 237 /* JsxOpeningElement */: + case 238 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } return; - case 239 /* JsxClosingElement */: + case 240 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } return; - case 236 /* JsxSelfClosingElement */: + case 237 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } return; + case 241 /* JsxAttribute */: + if (token.parent.name === token) { + return 22 /* jsxAttribute */; + } } } return 2 /* identifier */; @@ -50511,8 +51132,8 @@ var ts; var children = element.getChildren(sourceFile); for (var i = 0, n = children.length; i < n; i++) { var child = children[i]; - if (ts.isToken(child)) { - classifyToken(child); + if (ts.isToken(child) || child.kind === 239 /* JsxText */) { + classifyTokenOrJsxText(child); } else { // Recurse into our child nodes. @@ -50638,19 +51259,19 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 144 /* Constructor */: - case 216 /* ClassDeclaration */: - case 195 /* VariableStatement */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 145 /* Constructor */: + case 217 /* ClassDeclaration */: + case 196 /* VariableStatement */: break findOwner; - case 250 /* SourceFile */: + case 251 /* SourceFile */: return undefined; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - if (commentOwner.parent.kind === 220 /* ModuleDeclaration */) { + if (commentOwner.parent.kind === 221 /* ModuleDeclaration */) { return undefined; } break findOwner; @@ -50692,7 +51313,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 195 /* VariableStatement */) { + if (commentOwner.kind === 196 /* VariableStatement */) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -50710,17 +51331,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 174 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 175 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return rightHandSide.parameters; - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 144 /* Constructor */) { + if (member.kind === 145 /* Constructor */) { return member.parameters; } } @@ -50974,7 +51595,7 @@ var ts; // then we want 'something' to be in the name table. Similarly, if we have // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 234 /* ExternalModuleReference */ || + node.parent.kind === 235 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -50987,7 +51608,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 169 /* ElementAccessExpression */ && + node.parent.kind === 170 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /// Classifier @@ -51246,7 +51867,7 @@ var ts; var end = scanner.getTextPos(); addResult(start, end, classFromKind(token)); if (end >= text.length) { - if (token === 9 /* StringLiteral */ || token === 162 /* StringLiteralType */) { + if (token === 9 /* StringLiteral */ || token === 163 /* StringLiteralType */) { // Check to see if we finished up on a multiline string literal. var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { @@ -51369,7 +51990,7 @@ var ts; } } function isKeyword(token) { - return token >= 70 /* FirstKeyword */ && token <= 134 /* LastKeyword */; + return token >= 70 /* FirstKeyword */ && token <= 135 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -51385,7 +52006,7 @@ var ts; case 8 /* NumericLiteral */: return 4 /* numericLiteral */; case 9 /* StringLiteral */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: return 6 /* stringLiteral */; case 10 /* RegularExpressionLiteral */: return 7 /* regularExpressionLiteral */; @@ -51476,6 +52097,9 @@ var ts; startNode.getStart(sourceFile); return ts.createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } + function textSpanEndingAtNextToken(startNode, previousTokenToFindNextEndToken) { + return textSpan(startNode, ts.findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent)); + } function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); @@ -51493,132 +52117,114 @@ var ts; } function spanInNode(node) { if (node) { - if (ts.isExpression(node)) { - if (node.parent.kind === 199 /* DoStatement */) { - // Set span as if on while keyword - return spanInPreviousNode(node); - } - if (node.parent.kind === 139 /* Decorator */) { - // Set breakpoint on the decorator emit - return spanInNode(node.parent); - } - if (node.parent.kind === 201 /* ForStatement */) { - // For now lets set the span on this expression, fix it later - return textSpan(node); - } - if (node.parent.kind === 183 /* BinaryExpression */ && node.parent.operatorToken.kind === 24 /* CommaToken */) { - // if this is comma expression, the breakpoint is possible in this expression - return textSpan(node); - } - if (node.parent.kind === 176 /* ArrowFunction */ && node.parent.body === node) { - // If this is body of arrow function, it is allowed to have the breakpoint - return textSpan(node); - } - } switch (node.kind) { - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 213 /* VariableDeclaration */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 214 /* VariableDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return spanInVariableDeclaration(node); - case 138 /* Parameter */: + case 139 /* Parameter */: return spanInParameterDeclaration(node); - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 145 /* Constructor */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // Fall through - case 221 /* ModuleBlock */: + case 222 /* ModuleBlock */: return spanInBlock(node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return spanInBlock(node.block); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: // Span on while(...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 199 /* DoStatement */: + return textSpanEndingAtNextToken(node, node.expression); + case 200 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 212 /* DebuggerStatement */: + case 213 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 198 /* IfStatement */: + case 199 /* IfStatement */: // set on if(..) span - return textSpan(node, ts.findNextToken(node.expression, node)); - case 209 /* LabeledStatement */: + return textSpanEndingAtNextToken(node, node.expression); + case 210 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return spanInForStatement(node); - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - // span on for (a in ...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 208 /* SwitchStatement */: + case 203 /* ForInStatement */: + // span of for (a in ...) + return textSpanEndingAtNextToken(node, node.expression); + case 204 /* ForOfStatement */: + // span in initializer + return spanInInitializerOfForLike(node); + case 209 /* SwitchStatement */: // span on switch(...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + return textSpanEndingAtNextToken(node, node.expression); + case 244 /* CaseClause */: + case 245 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 211 /* TryStatement */: + case 212 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 249 /* EnumMember */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 250 /* EnumMember */: + case 166 /* BindingElement */: // span on complete node return textSpan(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 139 /* Decorator */: + case 140 /* Decorator */: return spanInNodeArray(node.parent.decorators); + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: + return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: return undefined; // Tokens: case 23 /* SemicolonToken */: @@ -51630,6 +52236,8 @@ var ts; return spanInOpenBraceToken(node); case 16 /* CloseBraceToken */: return spanInCloseBraceToken(node); + case 20 /* CloseBracketToken */: + return spanInCloseBracketToken(node); case 17 /* OpenParenToken */: return spanInOpenParenToken(node); case 18 /* CloseParenToken */: @@ -51646,58 +52254,142 @@ var ts; case 72 /* CatchKeyword */: case 85 /* FinallyKeyword */: return spanInNextNode(node); + case 135 /* OfKeyword */: + return spanInOfKeyword(node); default: + // Destructuring pattern in destructuring assignment + // [a, b, c] of + // [a, b, c] = expression + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); + } + // Set breakpoint on identifier element of destructuring pattern + // a or ...c or d: x from + // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern + if ((node.kind === 69 /* Identifier */ || + node.kind == 188 /* SpreadElementExpression */ || + node.kind === 248 /* PropertyAssignment */ || + node.kind === 249 /* ShorthandPropertyAssignment */) && + ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + return textSpan(node); + } + if (node.kind === 184 /* BinaryExpression */) { + var binaryExpression = node; + // Set breakpoint in destructuring pattern if its destructuring assignment + // [a, b, c] or {a, b, c} of + // [a, b, c] = expression or + // {a, b, c} = expression + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); + } + if (binaryExpression.operatorToken.kind === 56 /* EqualsToken */ && + ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + // Set breakpoint on assignment expression element of destructuring pattern + // a = expression of + // [a = expression, b, c] = someExpression or + // { a = expression, b, c } = someExpression + return textSpan(node); + } + if (binaryExpression.operatorToken.kind === 24 /* CommaToken */) { + return spanInNode(binaryExpression.left); + } + } + if (ts.isExpression(node)) { + switch (node.parent.kind) { + case 200 /* DoStatement */: + // Set span as if on while keyword + return spanInPreviousNode(node); + case 140 /* Decorator */: + // Set breakpoint on the decorator emit + return spanInNode(node.parent); + case 202 /* ForStatement */: + case 204 /* ForOfStatement */: + return textSpan(node); + case 184 /* BinaryExpression */: + if (node.parent.operatorToken.kind === 24 /* CommaToken */) { + // if this is comma expression, the breakpoint is possible in this expression + return textSpan(node); + } + break; + case 177 /* ArrowFunction */: + if (node.parent.body === node) { + // If this is body of arrow function, it is allowed to have the breakpoint + return textSpan(node); + } + break; + } + } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 247 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 248 /* PropertyAssignment */ && + node.parent.name === node && + !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 173 /* TypeAssertionExpression */ && node.parent.type === node) { - return spanInNode(node.parent.expression); + if (node.parent.kind === 174 /* TypeAssertionExpression */ && node.parent.type === node) { + return spanInNextNode(node.parent.type); } // return type of function go to previous token if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } + // initializer of variable/parameter declaration go to previous node + if ((node.parent.kind === 214 /* VariableDeclaration */ || + node.parent.kind === 139 /* Parameter */)) { + var paramOrVarDecl = node.parent; + if (paramOrVarDecl.initializer === node || + paramOrVarDecl.type === node || + ts.isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + } + if (node.parent.kind === 184 /* BinaryExpression */) { + var binaryExpression = node.parent; + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && + (binaryExpression.right === node || + binaryExpression.operatorToken === node)) { + // If initializer of destructuring assignment move to previous token + return spanInPreviousNode(node); + } + } // Default go to parent to set the breakpoint return spanInNode(node.parent); } } + function textSpanFromVariableDeclaration(variableDeclaration) { + var declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] === variableDeclaration) { + // First declaration - include let keyword + return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + else { + // Span only on this declaration + return textSpan(variableDeclaration); + } + } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 202 /* ForInStatement */ || - variableDeclaration.parent.parent.kind === 203 /* ForOfStatement */) { + if (variableDeclaration.parent.parent.kind === 203 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 195 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 201 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); - var declarations = isParentVariableStatement - ? variableDeclaration.parent.parent.declarationList.declarations - : isDeclarationOfForStatement - ? variableDeclaration.parent.parent.initializer.declarations - : undefined; - // Breakpoint is possible in variableDeclaration only if there is initialization - if (variableDeclaration.initializer || (variableDeclaration.flags & 2 /* Export */)) { - if (declarations && declarations[0] === variableDeclaration) { - if (isParentVariableStatement) { - // First declaration - include let keyword - return textSpan(variableDeclaration.parent, variableDeclaration); - } - else { - ts.Debug.assert(isDeclarationOfForStatement); - // Include let keyword from for statement declarations in the span - return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); - } - } - else { - // Span only on this declaration - return textSpan(variableDeclaration); - } + // If this is a destructuring pattern set breakpoint in binding pattern + if (ts.isBindingPattern(variableDeclaration.name)) { + return spanInBindingPattern(variableDeclaration.name); } - else if (declarations && declarations[0] !== variableDeclaration) { + // Breakpoint is possible in variableDeclaration only if there is initialization + // or its declaration from 'for of' + if (variableDeclaration.initializer || + (variableDeclaration.flags & 2 /* Export */) || + variableDeclaration.parent.parent.kind === 204 /* ForOfStatement */) { + return textSpanFromVariableDeclaration(variableDeclaration); + } + var declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] !== variableDeclaration) { // If we cant set breakpoint on this declaration, set it on previous one - var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); - return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + // Because the variable declaration may be binding pattern and + // we would like to set breakpoint in last binding element if thats the case, + // use preceding token instead + return spanInNode(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } } function canHaveSpanInParameterDeclaration(parameter) { @@ -51706,7 +52398,11 @@ var ts; !!(parameter.flags & 8 /* Public */) || !!(parameter.flags & 16 /* Private */); } function spanInParameterDeclaration(parameter) { - if (canHaveSpanInParameterDeclaration(parameter)) { + if (ts.isBindingPattern(parameter.name)) { + // set breakpoint in binding pattern + return spanInBindingPattern(parameter.name); + } + else if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); } else { @@ -51724,7 +52420,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 2 /* Export */) || - (functionDeclaration.parent.kind === 216 /* ClassDeclaration */ && functionDeclaration.kind !== 144 /* Constructor */); + (functionDeclaration.parent.kind === 217 /* ClassDeclaration */ && functionDeclaration.kind !== 145 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -51747,34 +52443,39 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement - case 200 /* WhileStatement */: - case 198 /* IfStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 201 /* WhileStatement */: + case 199 /* IfStatement */: + case 203 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 201 /* ForStatement */: + case 202 /* ForStatement */: + case 204 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } + function spanInInitializerOfForLike(forLikeStaement) { + if (forLikeStaement.initializer.kind === 215 /* VariableDeclarationList */) { + // declaration list, set breakpoint in first declaration + var variableDeclarationList = forLikeStaement.initializer; + if (variableDeclarationList.declarations.length > 0) { + return spanInNode(variableDeclarationList.declarations[0]); + } + } + else { + // Expression - set breakpoint in it + return spanInNode(forLikeStaement.initializer); + } + } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 214 /* VariableDeclarationList */) { - var variableDeclarationList = forStatement.initializer; - if (variableDeclarationList.declarations.length > 0) { - return spanInNode(variableDeclarationList.declarations[0]); - } - } - else { - return spanInNode(forStatement.initializer); - } + return spanInInitializerOfForLike(forStatement); } if (forStatement.condition) { return textSpan(forStatement.condition); @@ -51783,16 +52484,44 @@ var ts; return textSpan(forStatement.incrementor); } } + function spanInBindingPattern(bindingPattern) { + // Set breakpoint in first binding element + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 190 /* OmittedExpression */ ? element : undefined; }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + // Empty binding pattern of binding element, set breakpoint on binding element + if (bindingPattern.parent.kind === 166 /* BindingElement */) { + return textSpan(bindingPattern.parent); + } + // Variable declaration is used as the span + return textSpanFromVariableDeclaration(bindingPattern.parent); + } + function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { + ts.Debug.assert(node.kind !== 165 /* ArrayBindingPattern */ && node.kind !== 164 /* ObjectBindingPattern */); + var elements = node.kind === 167 /* ArrayLiteralExpression */ ? + node.elements : + node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 190 /* OmittedExpression */ ? element : undefined; }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + // Could be ArrayLiteral from destructuring assignment or + // just nested element in another destructuring assignment + // set breakpoint on assignment when parent is destructuring assignment + // Otherwise set breakpoint for this element + return textSpan(node.parent.kind === 184 /* BinaryExpression */ ? node.parent : node); + } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -51800,24 +52529,24 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 221 /* ModuleBlock */: + case 222 /* ModuleBlock */: // If this is not instantiated module block no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 219 /* EnumDeclaration */: - case 216 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // fall through. - case 246 /* CatchClause */: + case 247 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -51825,33 +52554,66 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; + case 164 /* ObjectBindingPattern */: + // Breakpoint in last binding element or binding pattern if it contains no elements + var bindingPattern = node.parent; + return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); // Default to parent node default: + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + var objectLiteral = node.parent; + return textSpan(ts.lastOrUndefined(objectLiteral.properties) || objectLiteral); + } + return spanInNode(node.parent); + } + } + function spanInCloseBracketToken(node) { + switch (node.parent.kind) { + case 165 /* ArrayBindingPattern */: + // Breakpoint in last binding element or binding pattern if it contains no elements + var bindingPattern = node.parent; + return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); + default: + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + var arrayLiteral = node.parent; + return textSpan(ts.lastOrUndefined(arrayLiteral.elements) || arrayLiteral); + } + // Default to parent node return spanInNode(node.parent); } } function spanInOpenParenToken(node) { - if (node.parent.kind === 199 /* DoStatement */) { - // Go to while keyword and do action instead + if (node.parent.kind === 200 /* DoStatement */ || + node.parent.kind === 171 /* CallExpression */ || + node.parent.kind === 172 /* NewExpression */) { return spanInPreviousNode(node); } + if (node.parent.kind === 175 /* ParenthesizedExpression */) { + return spanInNextNode(node); + } // Default to parent node return spanInNode(node.parent); } function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - case 200 /* WhileStatement */: - case 199 /* DoStatement */: - case 201 /* ForStatement */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 145 /* Constructor */: + case 201 /* WhileStatement */: + case 200 /* DoStatement */: + case 202 /* ForStatement */: + case 204 /* ForOfStatement */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 175 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -51860,21 +52622,31 @@ var ts; } function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration - if (ts.isFunctionLike(node.parent) || node.parent.kind === 247 /* PropertyAssignment */) { + if (ts.isFunctionLike(node.parent) || + node.parent.kind === 248 /* PropertyAssignment */ || + node.parent.kind === 139 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 173 /* TypeAssertionExpression */) { - return spanInNode(node.parent.expression); + if (node.parent.kind === 174 /* TypeAssertionExpression */) { + return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 199 /* DoStatement */) { + if (node.parent.kind === 200 /* DoStatement */) { // Set span on while expression - return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); + return textSpanEndingAtNextToken(node, node.parent.expression); + } + // Default to parent node + return spanInNode(node.parent); + } + function spanInOfKeyword(node) { + if (node.parent.kind === 204 /* ForOfStatement */) { + // set using next token + return spanInNextNode(node); } // Default to parent node return spanInNode(node.parent); diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 797f9ec728c..3cd6e23dc1d 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -167,161 +167,162 @@ declare namespace ts { SymbolKeyword = 131, TypeKeyword = 132, FromKeyword = 133, - OfKeyword = 134, - QualifiedName = 135, - ComputedPropertyName = 136, - TypeParameter = 137, - Parameter = 138, - Decorator = 139, - PropertySignature = 140, - PropertyDeclaration = 141, - MethodSignature = 142, - MethodDeclaration = 143, - Constructor = 144, - GetAccessor = 145, - SetAccessor = 146, - CallSignature = 147, - ConstructSignature = 148, - IndexSignature = 149, - TypePredicate = 150, - TypeReference = 151, - FunctionType = 152, - ConstructorType = 153, - TypeQuery = 154, - TypeLiteral = 155, - ArrayType = 156, - TupleType = 157, - UnionType = 158, - IntersectionType = 159, - ParenthesizedType = 160, - ThisType = 161, - StringLiteralType = 162, - ObjectBindingPattern = 163, - ArrayBindingPattern = 164, - BindingElement = 165, - ArrayLiteralExpression = 166, - ObjectLiteralExpression = 167, - PropertyAccessExpression = 168, - ElementAccessExpression = 169, - CallExpression = 170, - NewExpression = 171, - TaggedTemplateExpression = 172, - TypeAssertionExpression = 173, - ParenthesizedExpression = 174, - FunctionExpression = 175, - ArrowFunction = 176, - DeleteExpression = 177, - TypeOfExpression = 178, - VoidExpression = 179, - AwaitExpression = 180, - PrefixUnaryExpression = 181, - PostfixUnaryExpression = 182, - BinaryExpression = 183, - ConditionalExpression = 184, - TemplateExpression = 185, - YieldExpression = 186, - SpreadElementExpression = 187, - ClassExpression = 188, - OmittedExpression = 189, - ExpressionWithTypeArguments = 190, - AsExpression = 191, - TemplateSpan = 192, - SemicolonClassElement = 193, - Block = 194, - VariableStatement = 195, - EmptyStatement = 196, - ExpressionStatement = 197, - IfStatement = 198, - DoStatement = 199, - WhileStatement = 200, - ForStatement = 201, - ForInStatement = 202, - ForOfStatement = 203, - ContinueStatement = 204, - BreakStatement = 205, - ReturnStatement = 206, - WithStatement = 207, - SwitchStatement = 208, - LabeledStatement = 209, - ThrowStatement = 210, - TryStatement = 211, - DebuggerStatement = 212, - VariableDeclaration = 213, - VariableDeclarationList = 214, - FunctionDeclaration = 215, - ClassDeclaration = 216, - InterfaceDeclaration = 217, - TypeAliasDeclaration = 218, - EnumDeclaration = 219, - ModuleDeclaration = 220, - ModuleBlock = 221, - CaseBlock = 222, - ImportEqualsDeclaration = 223, - ImportDeclaration = 224, - ImportClause = 225, - NamespaceImport = 226, - NamedImports = 227, - ImportSpecifier = 228, - ExportAssignment = 229, - ExportDeclaration = 230, - NamedExports = 231, - ExportSpecifier = 232, - MissingDeclaration = 233, - ExternalModuleReference = 234, - JsxElement = 235, - JsxSelfClosingElement = 236, - JsxOpeningElement = 237, - JsxText = 238, - JsxClosingElement = 239, - JsxAttribute = 240, - JsxSpreadAttribute = 241, - JsxExpression = 242, - CaseClause = 243, - DefaultClause = 244, - HeritageClause = 245, - CatchClause = 246, - PropertyAssignment = 247, - ShorthandPropertyAssignment = 248, - EnumMember = 249, - SourceFile = 250, - JSDocTypeExpression = 251, - JSDocAllType = 252, - JSDocUnknownType = 253, - JSDocArrayType = 254, - JSDocUnionType = 255, - JSDocTupleType = 256, - JSDocNullableType = 257, - JSDocNonNullableType = 258, - JSDocRecordType = 259, - JSDocRecordMember = 260, - JSDocTypeReference = 261, - JSDocOptionalType = 262, - JSDocFunctionType = 263, - JSDocVariadicType = 264, - JSDocConstructorType = 265, - JSDocThisType = 266, - JSDocComment = 267, - JSDocTag = 268, - JSDocParameterTag = 269, - JSDocReturnTag = 270, - JSDocTypeTag = 271, - JSDocTemplateTag = 272, - SyntaxList = 273, - Count = 274, + GlobalKeyword = 134, + OfKeyword = 135, + QualifiedName = 136, + ComputedPropertyName = 137, + TypeParameter = 138, + Parameter = 139, + Decorator = 140, + PropertySignature = 141, + PropertyDeclaration = 142, + MethodSignature = 143, + MethodDeclaration = 144, + Constructor = 145, + GetAccessor = 146, + SetAccessor = 147, + CallSignature = 148, + ConstructSignature = 149, + IndexSignature = 150, + TypePredicate = 151, + TypeReference = 152, + FunctionType = 153, + ConstructorType = 154, + TypeQuery = 155, + TypeLiteral = 156, + ArrayType = 157, + TupleType = 158, + UnionType = 159, + IntersectionType = 160, + ParenthesizedType = 161, + ThisType = 162, + StringLiteralType = 163, + ObjectBindingPattern = 164, + ArrayBindingPattern = 165, + BindingElement = 166, + ArrayLiteralExpression = 167, + ObjectLiteralExpression = 168, + PropertyAccessExpression = 169, + ElementAccessExpression = 170, + CallExpression = 171, + NewExpression = 172, + TaggedTemplateExpression = 173, + TypeAssertionExpression = 174, + ParenthesizedExpression = 175, + FunctionExpression = 176, + ArrowFunction = 177, + DeleteExpression = 178, + TypeOfExpression = 179, + VoidExpression = 180, + AwaitExpression = 181, + PrefixUnaryExpression = 182, + PostfixUnaryExpression = 183, + BinaryExpression = 184, + ConditionalExpression = 185, + TemplateExpression = 186, + YieldExpression = 187, + SpreadElementExpression = 188, + ClassExpression = 189, + OmittedExpression = 190, + ExpressionWithTypeArguments = 191, + AsExpression = 192, + TemplateSpan = 193, + SemicolonClassElement = 194, + Block = 195, + VariableStatement = 196, + EmptyStatement = 197, + ExpressionStatement = 198, + IfStatement = 199, + DoStatement = 200, + WhileStatement = 201, + ForStatement = 202, + ForInStatement = 203, + ForOfStatement = 204, + ContinueStatement = 205, + BreakStatement = 206, + ReturnStatement = 207, + WithStatement = 208, + SwitchStatement = 209, + LabeledStatement = 210, + ThrowStatement = 211, + TryStatement = 212, + DebuggerStatement = 213, + VariableDeclaration = 214, + VariableDeclarationList = 215, + FunctionDeclaration = 216, + ClassDeclaration = 217, + InterfaceDeclaration = 218, + TypeAliasDeclaration = 219, + EnumDeclaration = 220, + ModuleDeclaration = 221, + ModuleBlock = 222, + CaseBlock = 223, + ImportEqualsDeclaration = 224, + ImportDeclaration = 225, + ImportClause = 226, + NamespaceImport = 227, + NamedImports = 228, + ImportSpecifier = 229, + ExportAssignment = 230, + ExportDeclaration = 231, + NamedExports = 232, + ExportSpecifier = 233, + MissingDeclaration = 234, + ExternalModuleReference = 235, + JsxElement = 236, + JsxSelfClosingElement = 237, + JsxOpeningElement = 238, + JsxText = 239, + JsxClosingElement = 240, + JsxAttribute = 241, + JsxSpreadAttribute = 242, + JsxExpression = 243, + CaseClause = 244, + DefaultClause = 245, + HeritageClause = 246, + CatchClause = 247, + PropertyAssignment = 248, + ShorthandPropertyAssignment = 249, + EnumMember = 250, + SourceFile = 251, + JSDocTypeExpression = 252, + JSDocAllType = 253, + JSDocUnknownType = 254, + JSDocArrayType = 255, + JSDocUnionType = 256, + JSDocTupleType = 257, + JSDocNullableType = 258, + JSDocNonNullableType = 259, + JSDocRecordType = 260, + JSDocRecordMember = 261, + JSDocTypeReference = 262, + JSDocOptionalType = 263, + JSDocFunctionType = 264, + JSDocVariadicType = 265, + JSDocConstructorType = 266, + JSDocThisType = 267, + JSDocComment = 268, + JSDocTag = 269, + JSDocParameterTag = 270, + JSDocReturnTag = 271, + JSDocTypeTag = 272, + JSDocTemplateTag = 273, + SyntaxList = 274, + Count = 275, FirstAssignment = 56, LastAssignment = 68, FirstReservedWord = 70, LastReservedWord = 105, FirstKeyword = 70, - LastKeyword = 134, + LastKeyword = 135, FirstFutureReservedWord = 106, LastFutureReservedWord = 114, - FirstTypeNode = 150, - LastTypeNode = 162, + FirstTypeNode = 151, + LastTypeNode = 163, FirstPunctuation = 15, LastPunctuation = 68, FirstToken = 0, - LastToken = 134, + LastToken = 135, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -330,7 +331,7 @@ declare namespace ts { LastTemplateToken = 14, FirstBinaryOperator = 25, LastBinaryOperator = 68, - FirstNode = 135, + FirstNode = 136, } enum NodeFlags { None = 0, @@ -354,10 +355,16 @@ declare namespace ts { ContainsThis = 262144, HasImplicitReturn = 524288, HasExplicitReturn = 1048576, + GlobalAugmentation = 2097152, + HasClassExtends = 4194304, + HasDecorators = 8388608, + HasParamDecorators = 16777216, + HasAsyncFunctions = 33554432, Modifier = 1022, AccessibilityModifier = 56, BlockScoped = 24576, ReachabilityCheckFlags = 1572864, + EmitHelperFlags = 62914560, } enum JsxFlags { None = 0, @@ -1141,6 +1148,7 @@ declare namespace ts { getSymbolAtLocation(node: Node): Symbol; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol; + getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getTypeAtLocation(node: Node): Type; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; @@ -1154,6 +1162,7 @@ declare namespace ts { isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; + isUnknownSymbol(symbol: Symbol): boolean; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; getAliasedSymbol(symbol: Symbol): Symbol; @@ -1543,6 +1552,8 @@ declare namespace ts { } } declare namespace ts { + type FileWatcherCallback = (path: string, removed?: boolean) => void; + type DirectoryWatcherCallback = (path: string) => void; interface System { args: string[]; newLine: string; @@ -1550,8 +1561,8 @@ declare namespace ts { write(s: string): void; readFile(path: string, encoding?: string): string; writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; - watchFile?(path: string, callback: (path: string, removed?: boolean) => void): FileWatcher; - watchDirectory?(path: string, callback: (path: string) => void, recursive?: boolean): FileWatcher; + watchFile?(path: Path, callback: FileWatcherCallback): FileWatcher; + watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; resolvePath(path: string): string; fileExists(path: string): boolean; directoryExists(path: string): boolean; @@ -1565,6 +1576,10 @@ declare namespace ts { interface FileWatcher { close(): void; } + interface DirectoryWatcher extends FileWatcher { + directoryPath: Path; + referenceCount: number; + } var sys: System; } declare namespace ts { @@ -2237,6 +2252,9 @@ declare namespace ts { static jsxOpenTagName: string; static jsxCloseTagName: string; static jsxSelfClosingTagName: string; + static jsxAttribute: string; + static jsxText: string; + static jsxAttributeStringLiteralValue: string; } enum ClassificationType { comment = 1, @@ -2260,6 +2278,9 @@ declare namespace ts { jsxOpenTagName = 19, jsxCloseTagName = 20, jsxSelfClosingTagName = 21, + jsxAttribute = 22, + jsxText = 23, + jsxAttributeStringLiteralValue = 24, } interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; @@ -2283,7 +2304,6 @@ declare namespace ts { function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string; function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry; function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 1e2f51f5aae..bbe9a4b07e3 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -163,182 +163,183 @@ var ts; SyntaxKind[SyntaxKind["SymbolKeyword"] = 131] = "SymbolKeyword"; SyntaxKind[SyntaxKind["TypeKeyword"] = 132] = "TypeKeyword"; SyntaxKind[SyntaxKind["FromKeyword"] = 133] = "FromKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 134] = "OfKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 134] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 135] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 135] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 136] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 136] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 137] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 137] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 138] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 139] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 138] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 139] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 140] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 140] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 141] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 142] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 143] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 144] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 145] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 146] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 147] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 148] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 149] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 141] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 142] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 143] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 144] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 145] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 146] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 147] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 148] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 149] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 150] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 150] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 151] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 152] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 153] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 154] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 155] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 156] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 157] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 158] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 159] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 160] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 161] = "ThisType"; - SyntaxKind[SyntaxKind["StringLiteralType"] = 162] = "StringLiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 151] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 152] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 153] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 154] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 155] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 156] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 157] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 158] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 159] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 160] = "IntersectionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 161] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 162] = "ThisType"; + SyntaxKind[SyntaxKind["StringLiteralType"] = 163] = "StringLiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 163] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 164] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 165] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 164] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 165] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 166] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 166] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 167] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 168] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 169] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 170] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 171] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 172] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 173] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 174] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 175] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 176] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 177] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 178] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 179] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 180] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 181] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 182] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 183] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 184] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 185] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 186] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 187] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["ClassExpression"] = 188] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 189] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 190] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 191] = "AsExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 167] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 168] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 169] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 170] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 171] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 172] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 173] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 174] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 175] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 176] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 177] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 178] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 179] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 180] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 181] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 182] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 183] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 184] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 185] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 186] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 187] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElementExpression"] = 188] = "SpreadElementExpression"; + SyntaxKind[SyntaxKind["ClassExpression"] = 189] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 190] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 191] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 192] = "AsExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 192] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 193] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 193] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 194] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 194] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 195] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 196] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 197] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 198] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 199] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 200] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 201] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 202] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 203] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 204] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 205] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 206] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 207] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 208] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 209] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 210] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 211] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 212] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 213] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 214] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 215] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 216] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 217] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 218] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 219] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 220] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 221] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 222] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 223] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 224] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 225] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 226] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 227] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 228] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 229] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 230] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 231] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 232] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 233] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 195] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 196] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 197] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 198] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 199] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 200] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 201] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 202] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 203] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 204] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 205] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 206] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 207] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 208] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 209] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 210] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 211] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 212] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 213] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 214] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 215] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 216] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 217] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 218] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 219] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 220] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 221] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 222] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 223] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 224] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 225] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 226] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 227] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 228] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 229] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 230] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 231] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 232] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 233] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 234] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 234] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 235] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 235] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 236] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 237] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxText"] = 238] = "JsxText"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 239] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 240] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 241] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 242] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 236] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 237] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 238] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxText"] = 239] = "JsxText"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 240] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 241] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 242] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 243] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 243] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 244] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 245] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 246] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 244] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 245] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 246] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 247] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 247] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 248] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 248] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 249] = "ShorthandPropertyAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 249] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 250] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 250] = "SourceFile"; + SyntaxKind[SyntaxKind["SourceFile"] = 251] = "SourceFile"; // JSDoc nodes. - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 251] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 252] = "JSDocTypeExpression"; // The * type. - SyntaxKind[SyntaxKind["JSDocAllType"] = 252] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 253] = "JSDocAllType"; // The ? type. - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 253] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 254] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 255] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 256] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 257] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 258] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 259] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 260] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 261] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 262] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 263] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 264] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 265] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 266] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 267] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 268] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 269] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 270] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 271] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 272] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 254] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocArrayType"] = 255] = "JSDocArrayType"; + SyntaxKind[SyntaxKind["JSDocUnionType"] = 256] = "JSDocUnionType"; + SyntaxKind[SyntaxKind["JSDocTupleType"] = 257] = "JSDocTupleType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 258] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 259] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocRecordType"] = 260] = "JSDocRecordType"; + SyntaxKind[SyntaxKind["JSDocRecordMember"] = 261] = "JSDocRecordMember"; + SyntaxKind[SyntaxKind["JSDocTypeReference"] = 262] = "JSDocTypeReference"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 263] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 264] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 265] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocConstructorType"] = 266] = "JSDocConstructorType"; + SyntaxKind[SyntaxKind["JSDocThisType"] = 267] = "JSDocThisType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 268] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTag"] = 269] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 270] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 271] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 272] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 273] = "JSDocTemplateTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 273] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 274] = "SyntaxList"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 274] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 275] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 56] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 68] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 70] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 105] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 70] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 134] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 135] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 106] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 114] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 150] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 162] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 151] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 163] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 15] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 68] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 134] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 135] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -347,7 +348,7 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 14] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 25] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 68] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 135] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 136] = "FirstNode"; })(ts.SyntaxKind || (ts.SyntaxKind = {})); var SyntaxKind = ts.SyntaxKind; (function (NodeFlags) { @@ -372,10 +373,16 @@ var ts; NodeFlags[NodeFlags["ContainsThis"] = 262144] = "ContainsThis"; NodeFlags[NodeFlags["HasImplicitReturn"] = 524288] = "HasImplicitReturn"; NodeFlags[NodeFlags["HasExplicitReturn"] = 1048576] = "HasExplicitReturn"; + NodeFlags[NodeFlags["GlobalAugmentation"] = 2097152] = "GlobalAugmentation"; + NodeFlags[NodeFlags["HasClassExtends"] = 4194304] = "HasClassExtends"; + NodeFlags[NodeFlags["HasDecorators"] = 8388608] = "HasDecorators"; + NodeFlags[NodeFlags["HasParamDecorators"] = 16777216] = "HasParamDecorators"; + NodeFlags[NodeFlags["HasAsyncFunctions"] = 33554432] = "HasAsyncFunctions"; NodeFlags[NodeFlags["Modifier"] = 1022] = "Modifier"; NodeFlags[NodeFlags["AccessibilityModifier"] = 56] = "AccessibilityModifier"; NodeFlags[NodeFlags["BlockScoped"] = 24576] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 1572864] = "ReachabilityCheckFlags"; + NodeFlags[NodeFlags["EmitHelperFlags"] = 62914560] = "EmitHelperFlags"; })(ts.NodeFlags || (ts.NodeFlags = {})); var NodeFlags = ts.NodeFlags; /* @internal */ @@ -584,11 +591,6 @@ var ts; NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 8] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["EmitDecorate"] = 16] = "EmitDecorate"; - NodeCheckFlags[NodeCheckFlags["EmitParam"] = 32] = "EmitParam"; - NodeCheckFlags[NodeCheckFlags["EmitAwaiter"] = 64] = "EmitAwaiter"; - NodeCheckFlags[NodeCheckFlags["EmitGenerator"] = 128] = "EmitGenerator"; NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance"; NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic"; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked"; @@ -1532,7 +1534,8 @@ var ts; directoryComponents.length--; } // Find the component that differs - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + var joinStartIndex; + for (joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } @@ -1681,6 +1684,12 @@ var ts; return copiedList; } ts.copyListRemovingItem = copyListRemovingItem; + function createGetCanonicalFileName(useCaseSensitivefileNames) { + return useCaseSensitivefileNames + ? (function (fileName) { return fileName; }) + : (function (fileName) { return fileName.toLowerCase(); }); + } + ts.createGetCanonicalFileName = createGetCanonicalFileName; })(ts || (ts = {})); /// var ts; @@ -1829,7 +1838,7 @@ var ts; var _os = require("os"); // average async stat takes about 30 microseconds // set chunk size to do 30 files in < 1 millisecond - function createWatchedFileSet(interval, chunkSize) { + function createPollingWatchedFileSet(interval, chunkSize) { if (interval === void 0) { interval = 2500; } if (chunkSize === void 0) { chunkSize = 30; } var watchedFiles = []; @@ -1843,13 +1852,13 @@ var ts; if (!watchedFile) { return; } - _fs.stat(watchedFile.fileName, function (err, stats) { + _fs.stat(watchedFile.filePath, function (err, stats) { if (err) { - watchedFile.callback(watchedFile.fileName); + watchedFile.callback(watchedFile.filePath); } else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { - watchedFile.mtime = getModifiedTime(watchedFile.fileName); - watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0); + watchedFile.mtime = getModifiedTime(watchedFile.filePath); + watchedFile.callback(watchedFile.filePath, watchedFile.mtime.getTime() === 0); } }); } @@ -1875,11 +1884,11 @@ var ts; nextFileToCheck = nextToCheck; }, interval); } - function addFile(fileName, callback) { + function addFile(filePath, callback) { var file = { - fileName: fileName, + filePath: filePath, callback: callback, - mtime: getModifiedTime(fileName) + mtime: getModifiedTime(filePath) }; watchedFiles.push(file); if (watchedFiles.length === 1) { @@ -1898,6 +1907,77 @@ var ts; removeFile: removeFile }; } + function createWatchedFileSet() { + var dirWatchers = ts.createFileMap(); + // One file can have multiple watchers + var fileWatcherCallbacks = ts.createFileMap(); + return { addFile: addFile, removeFile: removeFile }; + function reduceDirWatcherRefCountForFile(filePath) { + var dirPath = ts.getDirectoryPath(filePath); + if (dirWatchers.contains(dirPath)) { + var watcher = dirWatchers.get(dirPath); + watcher.referenceCount -= 1; + if (watcher.referenceCount <= 0) { + watcher.close(); + dirWatchers.remove(dirPath); + } + } + } + function addDirWatcher(dirPath) { + if (dirWatchers.contains(dirPath)) { + var watcher_1 = dirWatchers.get(dirPath); + watcher_1.referenceCount += 1; + return; + } + var watcher = _fs.watch(dirPath, { persistent: true }, function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); + watcher.referenceCount = 1; + dirWatchers.set(dirPath, watcher); + return; + } + function addFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + fileWatcherCallbacks.get(filePath).push(callback); + } + else { + fileWatcherCallbacks.set(filePath, [callback]); + } + } + function addFile(filePath, callback) { + addFileWatcherCallback(filePath, callback); + addDirWatcher(ts.getDirectoryPath(filePath)); + return { filePath: filePath, callback: callback }; + } + function removeFile(watchedFile) { + removeFileWatcherCallback(watchedFile.filePath, watchedFile.callback); + reduceDirWatcherRefCountForFile(watchedFile.filePath); + } + function removeFileWatcherCallback(filePath, callback) { + if (fileWatcherCallbacks.contains(filePath)) { + var newCallbacks = ts.copyListRemovingItem(callback, fileWatcherCallbacks.get(filePath)); + if (newCallbacks.length === 0) { + fileWatcherCallbacks.remove(filePath); + } + else { + fileWatcherCallbacks.set(filePath, newCallbacks); + } + } + } + /** + * @param watcherPath is the path from which the watcher is triggered. + */ + function fileEventHandler(eventName, relativeFileName, baseDirPath) { + // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" + var filePath = typeof relativeFileName !== "string" + ? undefined + : ts.toPath(relativeFileName, baseDirPath, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)); + if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) { + for (var _i = 0, _a = fileWatcherCallbacks.get(filePath); _i < _a.length; _i++) { + var fileCallback = _a[_i]; + fileCallback(filePath); + } + } + } + } // REVIEW: for now this implementation uses polling. // The advantage of polling is that it works reliably // on all os and with network mounted files. @@ -1911,7 +1991,11 @@ var ts; // changes for large reference sets? If so, do we want // to increase the chunk size or decrease the interval // time dynamically to match the large reference set? + var pollingWatchedFileSet = createPollingWatchedFileSet(); var watchedFileSet = createWatchedFileSet(); + function isNode4OrLater() { + return parseInt(process.version.charAt(1)) >= 4; + } var platform = _os.platform(); // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; @@ -1960,7 +2044,7 @@ var ts; } } function getCanonicalPath(path) { - return useCaseSensitiveFileNames ? path.toLowerCase() : path; + return useCaseSensitiveFileNames ? path : path.toLowerCase(); } function readDirectory(path, extension, exclude) { var result = []; @@ -2000,20 +2084,28 @@ var ts; }, readFile: readFile, writeFile: writeFile, - watchFile: function (fileName, callback) { + watchFile: function (filePath, callback) { // Node 4.0 stablized the `fs.watch` function on Windows which avoids polling // and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649 // and https://github.com/Microsoft/TypeScript/issues/4643), therefore // if the current node.js version is newer than 4, use `fs.watch` instead. - var watchedFile = watchedFileSet.addFile(fileName, callback); + var watchSet = isNode4OrLater() ? watchedFileSet : pollingWatchedFileSet; + var watchedFile = watchSet.addFile(filePath, callback); return { - close: function () { return watchedFileSet.removeFile(watchedFile); } + close: function () { return watchSet.removeFile(watchedFile); } }; }, watchDirectory: function (path, callback, recursive) { // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) - return _fs.watch(path, { persistent: true, recursive: !!recursive }, function (eventName, relativeFileName) { + var options; + if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + options = { persistent: true, recursive: !!recursive }; + } + else { + options = { persistent: true }; + } + return _fs.watch(path, options, function (eventName, relativeFileName) { // In watchDirectory we only care about adding and removing files (when event name is // "rename"); changes made within files are handled by corresponding fileWatchers (when // event name is "change") @@ -2283,7 +2375,6 @@ var ts; Cannot_find_parameter_0: { code: 1225, category: ts.DiagnosticCategory.Error, key: "Cannot_find_parameter_0_1225", message: "Cannot find parameter '{0}'." }, Type_predicate_0_is_not_assignable_to_1: { code: 1226, category: ts.DiagnosticCategory.Error, key: "Type_predicate_0_is_not_assignable_to_1_1226", message: "Type predicate '{0}' is not assignable to '{1}'." }, Parameter_0_is_not_in_the_same_position_as_parameter_1: { code: 1227, category: ts.DiagnosticCategory.Error, key: "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", message: "Parameter '{0}' is not in the same position as parameter '{1}'." }, - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: { code: 1228, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", message: "A type predicate is only allowed in return type position for functions and methods." }, A_type_predicate_cannot_reference_a_rest_parameter: { code: 1229, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_a_rest_parameter_1229", message: "A type predicate cannot reference a rest parameter." }, A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: { code: 1230, category: ts.DiagnosticCategory.Error, key: "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", message: "A type predicate cannot reference element '{0}' in a binding pattern." }, An_export_assignment_can_only_be_used_in_a_module: { code: 1231, category: ts.DiagnosticCategory.Error, key: "An_export_assignment_can_only_be_used_in_a_module_1231", message: "An export assignment can only be used in a module." }, @@ -2519,7 +2610,6 @@ var ts; All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_an_abstract_method_must_be_consecutive_2516", message: "All declarations of an abstract method must be consecutive." }, Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", message: "Cannot assign an abstract constructor type to a non-abstract constructor type." }, A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: { code: 2518, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", message: "A 'this'-based type guard is not compatible with a parameter-based type guard." }, - A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods: { code: 2519, category: ts.DiagnosticCategory.Error, key: "A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_r_2519", message: "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods." }, Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", message: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." }, Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521", message: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." }, The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_2522", message: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." }, @@ -2548,6 +2638,16 @@ var ts; Type_0_provides_no_match_for_the_signature_1: { code: 2658, category: ts.DiagnosticCategory.Error, key: "Type_0_provides_no_match_for_the_signature_1_2658", message: "Type '{0}' provides no match for the signature '{1}'" }, super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: { code: 2659, category: ts.DiagnosticCategory.Error, key: "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", message: "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher." }, super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: { code: 2660, category: ts.DiagnosticCategory.Error, key: "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", message: "'super' can only be referenced in members of derived classes or object literal expressions." }, + Cannot_re_export_name_that_is_not_defined_in_the_module: { code: 2661, category: ts.DiagnosticCategory.Error, key: "Cannot_re_export_name_that_is_not_defined_in_the_module_2661", message: "Cannot re-export name that is not defined in the module." }, + Cannot_find_name_0_Did_you_mean_the_static_member_1_0: { code: 2662, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", message: "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?" }, + Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: { code: 2663, category: ts.DiagnosticCategory.Error, key: "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", message: "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?" }, + Invalid_module_name_in_augmentation_module_0_cannot_be_found: { code: 2664, category: ts.DiagnosticCategory.Error, key: "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", message: "Invalid module name in augmentation, module '{0}' cannot be found." }, + Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope: { code: 2665, category: ts.DiagnosticCategory.Error, key: "Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope_2665", message: "Module augmentation cannot introduce new names in the top level scope." }, + Exports_and_export_assignments_are_not_permitted_in_module_augmentations: { code: 2666, category: ts.DiagnosticCategory.Error, key: "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", message: "Exports and export assignments are not permitted in module augmentations." }, + Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: { code: 2667, category: ts.DiagnosticCategory.Error, key: "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", message: "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module." }, + export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: { code: 2668, category: ts.DiagnosticCategory.Error, key: "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", message: "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible." }, + Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: { code: 2669, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", message: "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations." }, + Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: { code: 2670, category: ts.DiagnosticCategory.Error, key: "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", message: "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -2712,6 +2812,7 @@ var ts; _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", message: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", message: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", message: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: { code: 7015, category: ts.DiagnosticCategory.Error, key: "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", message: "Element implicitly has an 'any' type because index expression is not of type 'number'." }, Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation_7016", message: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index_signature_of_object_type_implicitly_has_an_any_type_7017", message: "Index signature of object type implicitly has an 'any' type." }, Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: ts.DiagnosticCategory.Error, key: "Object_literal_s_property_0_implicitly_has_an_1_type_7018", message: "Object literal's property '{0}' implicitly has an '{1}' type." }, @@ -2810,6 +2911,7 @@ var ts; "protected": 111 /* ProtectedKeyword */, "public": 112 /* PublicKeyword */, "require": 127 /* RequireKeyword */, + "global": 134 /* GlobalKeyword */, "return": 94 /* ReturnKeyword */, "set": 129 /* SetKeyword */, "static": 113 /* StaticKeyword */, @@ -2830,7 +2932,7 @@ var ts; "yield": 114 /* YieldKeyword */, "async": 118 /* AsyncKeyword */, "await": 119 /* AwaitKeyword */, - "of": 134 /* OfKeyword */, + "of": 135 /* OfKeyword */, "{": 15 /* OpenBraceToken */, "}": 16 /* CloseBraceToken */, "(": 17 /* OpenParenToken */, @@ -4246,7 +4348,7 @@ var ts; break; } } - return token = 238 /* JsxText */; + return token = 239 /* JsxText */; } // Scans a JSX identifier; these differ from normal identifiers in that // they allow dashes @@ -4429,7 +4531,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 250 /* SourceFile */) { + while (node && node.kind !== 251 /* SourceFile */) { node = node.parent; } return node; @@ -4532,6 +4634,31 @@ var ts; isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function isAmbientModule(node) { + return node && node.kind === 221 /* ModuleDeclaration */ && + (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); + } + ts.isAmbientModule = isAmbientModule; + function isGlobalScopeAugmentation(module) { + return !!(module.flags & 2097152 /* GlobalAugmentation */); + } + ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; + function isExternalModuleAugmentation(node) { + // external module augmentation is a ambient module declaration that is either: + // - defined in the top level scope and source file is an external module + // - defined inside ambient module declaration located in the top level scope and source file not an external module + if (!node || !isAmbientModule(node)) { + return false; + } + switch (node.parent.kind) { + case 251 /* SourceFile */: + return isExternalModule(node.parent); + case 222 /* ModuleBlock */: + return isAmbientModule(node.parent.parent) && !isExternalModule(node.parent.parent.parent); + } + return false; + } + ts.isExternalModuleAugmentation = isExternalModuleAugmentation; // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { @@ -4541,15 +4668,15 @@ var ts; return current; } switch (current.kind) { - case 250 /* SourceFile */: - case 222 /* CaseBlock */: - case 246 /* CatchClause */: - case 220 /* ModuleDeclaration */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 251 /* SourceFile */: + case 223 /* CaseBlock */: + case 247 /* CatchClause */: + case 221 /* ModuleDeclaration */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: return current; - case 194 /* Block */: + case 195 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { @@ -4562,9 +4689,9 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 213 /* VariableDeclaration */ && + declaration.kind === 214 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 246 /* CatchClause */; + declaration.parent.kind === 247 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; // Return display name of an identifier @@ -4603,7 +4730,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -4612,17 +4739,18 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 220 /* ModuleDeclaration */: - case 219 /* EnumDeclaration */: - case 249 /* EnumMember */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 220 /* EnumDeclaration */: + case 250 /* EnumMember */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 219 /* TypeAliasDeclaration */: errorNode = node.name; break; } @@ -4650,11 +4778,11 @@ var ts; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 219 /* EnumDeclaration */ && isConst(node); + return node.kind === 220 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 165 /* BindingElement */ || isBindingPattern(node))) { + while (node && (node.kind === 166 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; @@ -4669,14 +4797,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 213 /* VariableDeclaration */) { + if (node.kind === 214 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 214 /* VariableDeclarationList */) { + if (node && node.kind === 215 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 195 /* VariableStatement */) { + if (node && node.kind === 196 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -4691,7 +4819,7 @@ var ts; } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 197 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; + return node.kind === 198 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { @@ -4707,7 +4835,7 @@ var ts; } ts.getJsDocComments = getJsDocComments; function getJsDocCommentsFromText(node, text) { - var commentRanges = (node.kind === 138 /* Parameter */ || node.kind === 137 /* TypeParameter */) ? + var commentRanges = (node.kind === 139 /* Parameter */ || node.kind === 138 /* TypeParameter */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRangesOfNodeFromText(node, text); return ts.filter(commentRanges, isJsDocComment); @@ -4722,7 +4850,7 @@ var ts; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; function isTypeNode(node) { - if (150 /* FirstTypeNode */ <= node.kind && node.kind <= 162 /* LastTypeNode */) { + if (151 /* FirstTypeNode */ <= node.kind && node.kind <= 163 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -4733,26 +4861,26 @@ var ts; case 131 /* SymbolKeyword */: return true; case 103 /* VoidKeyword */: - return node.parent.kind !== 179 /* VoidExpression */; - case 190 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 180 /* VoidExpression */; + case 191 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 69 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); - case 135 /* QualifiedName */: - case 168 /* PropertyAccessExpression */: + ts.Debug.assert(node.kind === 69 /* Identifier */ || node.kind === 136 /* QualifiedName */ || node.kind === 169 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); + case 136 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: case 97 /* ThisKeyword */: var parent_1 = node.parent; - if (parent_1.kind === 154 /* TypeQuery */) { + if (parent_1.kind === 155 /* TypeQuery */) { return false; } // Do not recursively call isTypeNode on the parent. In the example: @@ -4761,38 +4889,38 @@ var ts; // // Calling isTypeNode would consider the qualified name A.B a type node. Only C or // A.B.C is a type node. - if (150 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 162 /* LastTypeNode */) { + if (151 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 163 /* LastTypeNode */) { return true; } switch (parent_1.kind) { - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent_1); - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return node === parent_1.constraint; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 138 /* Parameter */: - case 213 /* VariableDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 139 /* Parameter */: + case 214 /* VariableDeclaration */: return node === parent_1.type; - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 144 /* Constructor */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 145 /* Constructor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return node === parent_1.type; - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return node === parent_1.type; - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: return node === parent_1.type; - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -4806,23 +4934,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return visitor(node); - case 222 /* CaseBlock */: - case 194 /* Block */: - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 207 /* WithStatement */: - case 208 /* SwitchStatement */: - case 243 /* CaseClause */: - case 244 /* DefaultClause */: - case 209 /* LabeledStatement */: - case 211 /* TryStatement */: - case 246 /* CatchClause */: + case 223 /* CaseBlock */: + case 195 /* Block */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 208 /* WithStatement */: + case 209 /* SwitchStatement */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: + case 210 /* LabeledStatement */: + case 212 /* TryStatement */: + case 247 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4832,18 +4960,18 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: - case 220 /* ModuleDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. @@ -4851,7 +4979,7 @@ var ts; default: if (isFunctionLike(node)) { var name_5 = node.name; - if (name_5 && name_5.kind === 136 /* ComputedPropertyName */) { + if (name_5 && name_5.kind === 137 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(name_5.expression); @@ -4870,14 +4998,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 165 /* BindingElement */: - case 249 /* EnumMember */: - case 138 /* Parameter */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 248 /* ShorthandPropertyAssignment */: - case 213 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 250 /* EnumMember */: + case 139 /* Parameter */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 249 /* ShorthandPropertyAssignment */: + case 214 /* VariableDeclaration */: return true; } } @@ -4885,11 +5013,11 @@ var ts; } ts.isVariableLike = isVariableLike; function isAccessor(node) { - return node && (node.kind === 145 /* GetAccessor */ || node.kind === 146 /* SetAccessor */); + return node && (node.kind === 146 /* GetAccessor */ || node.kind === 147 /* SetAccessor */); } ts.isAccessor = isAccessor; function isClassLike(node) { - return node && (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */); + return node && (node.kind === 217 /* ClassDeclaration */ || node.kind === 189 /* ClassExpression */); } ts.isClassLike = isClassLike; function isFunctionLike(node) { @@ -4898,32 +5026,32 @@ var ts; ts.isFunctionLike = isFunctionLike; function isFunctionLikeKind(kind) { switch (kind) { - case 144 /* Constructor */: - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 145 /* Constructor */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return true; } } ts.isFunctionLikeKind = isFunctionLikeKind; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: return true; } return false; @@ -4931,24 +5059,24 @@ var ts; ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: return true; - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isFunctionBlock(node) { - return node && node.kind === 194 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 195 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 143 /* MethodDeclaration */ && node.parent.kind === 167 /* ObjectLiteralExpression */; + return node && node.kind === 144 /* MethodDeclaration */ && node.parent.kind === 168 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isIdentifierTypePredicate(predicate) { @@ -4980,7 +5108,7 @@ var ts; return undefined; } switch (node.kind) { - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -4995,9 +5123,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 139 /* Decorator */: + case 140 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 138 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 139 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -5008,26 +5136,26 @@ var ts; node = node.parent; } break; - case 176 /* ArrowFunction */: + case 177 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // Fall through - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 220 /* ModuleDeclaration */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 219 /* EnumDeclaration */: - case 250 /* SourceFile */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 221 /* ModuleDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 220 /* EnumDeclaration */: + case 251 /* SourceFile */: return node; } } @@ -5037,7 +5165,7 @@ var ts; * Given an super call\property node returns a closest node where either * - super call\property is legal in the node and not legal in the parent node the node. * i.e. super call is legal in constructor but not legal in the class body. - * - node is arrow function (so caller might need to call getSuperContainer in case if he needs to climb higher) + * - node is arrow function (so caller might need to call getSuperContainer in case it needs to climb higher) * - super call\property is definitely illegal in the node (but might be legal in some subnode) * i.e. super property access is illegal in function declaration but can be legal in the statement list */ @@ -5048,26 +5176,26 @@ var ts; return node; } switch (node.kind) { - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: node = node.parent; break; - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: if (!stopOnFunctions) { continue; } - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return node; - case 139 /* Decorator */: + case 140 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 138 /* Parameter */ && isClassElement(node.parent.parent)) { + if (node.parent.kind === 139 /* Parameter */ && isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -5085,12 +5213,12 @@ var ts; function getEntityNameFromTypeNode(node) { if (node) { switch (node.kind) { - case 151 /* TypeReference */: + case 152 /* TypeReference */: return node.typeName; - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return node.expression; case 69 /* Identifier */: - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return node; } } @@ -5098,7 +5226,7 @@ var ts; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { return node.tag; } // Will either be a CallExpression, NewExpression, or Decorator. @@ -5107,58 +5235,40 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: // classes are valid targets return true; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 216 /* ClassDeclaration */; - case 138 /* Parameter */: - // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; - return node.parent.body && node.parent.parent.kind === 216 /* ClassDeclaration */; - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 143 /* MethodDeclaration */: + return node.parent.kind === 217 /* ClassDeclaration */; + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 144 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. - return node.body && node.parent.kind === 216 /* ClassDeclaration */; + return node.body !== undefined + && node.parent.kind === 217 /* ClassDeclaration */; + case 139 /* Parameter */: + // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; + return node.parent.body !== undefined + && (node.parent.kind === 145 /* Constructor */ + || node.parent.kind === 144 /* MethodDeclaration */ + || node.parent.kind === 147 /* SetAccessor */) + && node.parent.parent.kind === 217 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { - switch (node.kind) { - case 216 /* ClassDeclaration */: - if (node.decorators) { - return true; - } - return false; - case 141 /* PropertyDeclaration */: - case 138 /* Parameter */: - if (node.decorators) { - return true; - } - return false; - case 145 /* GetAccessor */: - if (node.body && node.decorators) { - return true; - } - return false; - case 143 /* MethodDeclaration */: - case 146 /* SetAccessor */: - if (node.body && node.decorators) { - return true; - } - return false; - } - return false; + return node.decorators !== undefined + && nodeCanBeDecorated(node); } ts.nodeIsDecorated = nodeIsDecorated; function isPropertyAccessExpression(node) { - return node.kind === 168 /* PropertyAccessExpression */; + return node.kind === 169 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 169 /* ElementAccessExpression */; + return node.kind === 170 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isExpression(node) { @@ -5168,42 +5278,42 @@ var ts; case 99 /* TrueKeyword */: case 84 /* FalseKeyword */: case 10 /* RegularExpressionLiteral */: - case 166 /* ArrayLiteralExpression */: - case 167 /* ObjectLiteralExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 172 /* TaggedTemplateExpression */: - case 191 /* AsExpression */: - case 173 /* TypeAssertionExpression */: - case 174 /* ParenthesizedExpression */: - case 175 /* FunctionExpression */: - case 188 /* ClassExpression */: - case 176 /* ArrowFunction */: - case 179 /* VoidExpression */: - case 177 /* DeleteExpression */: - case 178 /* TypeOfExpression */: - case 181 /* PrefixUnaryExpression */: - case 182 /* PostfixUnaryExpression */: - case 183 /* BinaryExpression */: - case 184 /* ConditionalExpression */: - case 187 /* SpreadElementExpression */: - case 185 /* TemplateExpression */: + case 167 /* ArrayLiteralExpression */: + case 168 /* ObjectLiteralExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 173 /* TaggedTemplateExpression */: + case 192 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 175 /* ParenthesizedExpression */: + case 176 /* FunctionExpression */: + case 189 /* ClassExpression */: + case 177 /* ArrowFunction */: + case 180 /* VoidExpression */: + case 178 /* DeleteExpression */: + case 179 /* TypeOfExpression */: + case 182 /* PrefixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: + case 184 /* BinaryExpression */: + case 185 /* ConditionalExpression */: + case 188 /* SpreadElementExpression */: + case 186 /* TemplateExpression */: case 11 /* NoSubstitutionTemplateLiteral */: - case 189 /* OmittedExpression */: - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: - case 186 /* YieldExpression */: - case 180 /* AwaitExpression */: + case 190 /* OmittedExpression */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: + case 187 /* YieldExpression */: + case 181 /* AwaitExpression */: return true; - case 135 /* QualifiedName */: - while (node.parent.kind === 135 /* QualifiedName */) { + case 136 /* QualifiedName */: + while (node.parent.kind === 136 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 154 /* TypeQuery */; + return node.parent.kind === 155 /* TypeQuery */; case 69 /* Identifier */: - if (node.parent.kind === 154 /* TypeQuery */) { + if (node.parent.kind === 155 /* TypeQuery */) { return true; } // fall through @@ -5212,47 +5322,47 @@ var ts; case 97 /* ThisKeyword */: var parent_2 = node.parent; switch (parent_2.kind) { - case 213 /* VariableDeclaration */: - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 249 /* EnumMember */: - case 247 /* PropertyAssignment */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 139 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 250 /* EnumMember */: + case 248 /* PropertyAssignment */: + case 166 /* BindingElement */: return parent_2.initializer === node; - case 197 /* ExpressionStatement */: - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 206 /* ReturnStatement */: - case 207 /* WithStatement */: - case 208 /* SwitchStatement */: - case 243 /* CaseClause */: - case 210 /* ThrowStatement */: - case 208 /* SwitchStatement */: + case 198 /* ExpressionStatement */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 207 /* ReturnStatement */: + case 208 /* WithStatement */: + case 209 /* SwitchStatement */: + case 244 /* CaseClause */: + case 211 /* ThrowStatement */: + case 209 /* SwitchStatement */: return parent_2.expression === node; - case 201 /* ForStatement */: + case 202 /* ForStatement */: var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 214 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 215 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 214 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 215 /* VariableDeclarationList */) || forInStatement.expression === node; - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: return node === parent_2.expression; - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return node === parent_2.expression; - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: return node === parent_2.expression; - case 139 /* Decorator */: - case 242 /* JsxExpression */: - case 241 /* JsxSpreadAttribute */: + case 140 /* Decorator */: + case 243 /* JsxExpression */: + case 242 /* JsxSpreadAttribute */: return true; - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return parent_2.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent_2); default: if (isExpression(parent_2)) { @@ -5276,7 +5386,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */; + return node.kind === 224 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 235 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -5285,7 +5395,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 234 /* ExternalModuleReference */; + return node.kind === 224 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 235 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -5303,7 +5413,7 @@ var ts; */ function isRequireCall(expression) { // of the form 'require("name")' - return expression.kind === 170 /* CallExpression */ && + return expression.kind === 171 /* CallExpression */ && expression.expression.kind === 69 /* Identifier */ && expression.expression.text === "require" && expression.arguments.length === 1 && @@ -5313,11 +5423,11 @@ var ts; /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property /// assignments we treat as special in the binder function getSpecialPropertyAssignmentKind(expression) { - if (expression.kind !== 183 /* BinaryExpression */) { + if (expression.kind !== 184 /* BinaryExpression */) { return 0 /* None */; } var expr = expression; - if (expr.operatorToken.kind !== 56 /* EqualsToken */ || expr.left.kind !== 168 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 56 /* EqualsToken */ || expr.left.kind !== 169 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; @@ -5335,7 +5445,7 @@ var ts; else if (lhs.expression.kind === 97 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 168 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 169 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 69 /* Identifier */ && innerPropertyAccess.name.text === "prototype") { @@ -5346,30 +5456,33 @@ var ts; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function getExternalModuleName(node) { - if (node.kind === 224 /* ImportDeclaration */) { + if (node.kind === 225 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 223 /* ImportEqualsDeclaration */) { + if (node.kind === 224 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 234 /* ExternalModuleReference */) { + if (reference.kind === 235 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 230 /* ExportDeclaration */) { + if (node.kind === 231 /* ExportDeclaration */) { return node.moduleSpecifier; } + if (node.kind === 221 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { + return node.name; + } } ts.getExternalModuleName = getExternalModuleName; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 138 /* Parameter */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 248 /* ShorthandPropertyAssignment */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 139 /* Parameter */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 249 /* ShorthandPropertyAssignment */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -5377,9 +5490,9 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 263 /* JSDocFunctionType */ && + return node.kind === 264 /* JSDocFunctionType */ && node.parameters.length > 0 && - node.parameters[0].type.kind === 265 /* JSDocConstructorType */; + node.parameters[0].type.kind === 266 /* JSDocConstructorType */; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function getJSDocTag(node, kind) { @@ -5393,15 +5506,15 @@ var ts; } } function getJSDocTypeTag(node) { - return getJSDocTag(node, 271 /* JSDocTypeTag */); + return getJSDocTag(node, 272 /* JSDocTypeTag */); } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocReturnTag(node) { - return getJSDocTag(node, 270 /* JSDocReturnTag */); + return getJSDocTag(node, 271 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getJSDocTag(node, 272 /* JSDocTemplateTag */); + return getJSDocTag(node, 273 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getCorrespondingJSDocParameterTag(parameter) { @@ -5412,7 +5525,7 @@ var ts; var docComment = parameter.parent.jsDocComment; if (docComment) { return ts.forEach(docComment.tags, function (t) { - if (t.kind === 269 /* JSDocParameterTag */) { + if (t.kind === 270 /* JSDocParameterTag */) { var parameterTag = t; var name_6 = parameterTag.preParameterName || parameterTag.postParameterName; if (name_6.text === parameterName) { @@ -5431,12 +5544,12 @@ var ts; function isRestParameter(node) { if (node) { if (node.parserContextFlags & 32 /* JavaScriptFile */) { - if (node.type && node.type.kind === 264 /* JSDocVariadicType */) { + if (node.type && node.type.kind === 265 /* JSDocVariadicType */) { return true; } var paramTag = getCorrespondingJSDocParameterTag(node); if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 264 /* JSDocVariadicType */; + return paramTag.typeExpression.type.kind === 265 /* JSDocVariadicType */; } } return node.dotDotDotToken !== undefined; @@ -5457,7 +5570,7 @@ var ts; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 164 /* ArrayBindingPattern */ || node.kind === 163 /* ObjectBindingPattern */); + return !!node && (node.kind === 165 /* ArrayBindingPattern */ || node.kind === 164 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isNodeDescendentOf(node, ancestor) { @@ -5481,34 +5594,34 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 176 /* ArrowFunction */: - case 165 /* BindingElement */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 144 /* Constructor */: - case 219 /* EnumDeclaration */: - case 249 /* EnumMember */: - case 232 /* ExportSpecifier */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 145 /* GetAccessor */: - case 225 /* ImportClause */: - case 223 /* ImportEqualsDeclaration */: - case 228 /* ImportSpecifier */: - case 217 /* InterfaceDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 220 /* ModuleDeclaration */: - case 226 /* NamespaceImport */: - case 138 /* Parameter */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 146 /* SetAccessor */: - case 248 /* ShorthandPropertyAssignment */: - case 218 /* TypeAliasDeclaration */: - case 137 /* TypeParameter */: - case 213 /* VariableDeclaration */: + case 177 /* ArrowFunction */: + case 166 /* BindingElement */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 145 /* Constructor */: + case 220 /* EnumDeclaration */: + case 250 /* EnumMember */: + case 233 /* ExportSpecifier */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 146 /* GetAccessor */: + case 226 /* ImportClause */: + case 224 /* ImportEqualsDeclaration */: + case 229 /* ImportSpecifier */: + case 218 /* InterfaceDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 221 /* ModuleDeclaration */: + case 227 /* NamespaceImport */: + case 139 /* Parameter */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 147 /* SetAccessor */: + case 249 /* ShorthandPropertyAssignment */: + case 219 /* TypeAliasDeclaration */: + case 138 /* TypeParameter */: + case 214 /* VariableDeclaration */: return true; } return false; @@ -5516,25 +5629,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: - case 212 /* DebuggerStatement */: - case 199 /* DoStatement */: - case 197 /* ExpressionStatement */: - case 196 /* EmptyStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 201 /* ForStatement */: - case 198 /* IfStatement */: - case 209 /* LabeledStatement */: - case 206 /* ReturnStatement */: - case 208 /* SwitchStatement */: - case 210 /* ThrowStatement */: - case 211 /* TryStatement */: - case 195 /* VariableStatement */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 229 /* ExportAssignment */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 213 /* DebuggerStatement */: + case 200 /* DoStatement */: + case 198 /* ExpressionStatement */: + case 197 /* EmptyStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 202 /* ForStatement */: + case 199 /* IfStatement */: + case 210 /* LabeledStatement */: + case 207 /* ReturnStatement */: + case 209 /* SwitchStatement */: + case 211 /* ThrowStatement */: + case 212 /* TryStatement */: + case 196 /* VariableStatement */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 230 /* ExportAssignment */: return true; default: return false; @@ -5543,13 +5656,13 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 144 /* Constructor */: - case 141 /* PropertyDeclaration */: - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 142 /* MethodSignature */: - case 149 /* IndexSignature */: + case 145 /* Constructor */: + case 142 /* PropertyDeclaration */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 143 /* MethodSignature */: + case 150 /* IndexSignature */: return true; default: return false; @@ -5562,7 +5675,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 228 /* ImportSpecifier */ || parent.kind === 232 /* ExportSpecifier */) { + if (parent.kind === 229 /* ImportSpecifier */ || parent.kind === 233 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -5577,31 +5690,31 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 249 /* EnumMember */: - case 247 /* PropertyAssignment */: - case 168 /* PropertyAccessExpression */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 250 /* EnumMember */: + case 248 /* PropertyAssignment */: + case 169 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 135 /* QualifiedName */) { + while (parent.kind === 136 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 154 /* TypeQuery */; + return parent.kind === 155 /* TypeQuery */; } return false; - case 165 /* BindingElement */: - case 228 /* ImportSpecifier */: + case 166 /* BindingElement */: + case 229 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 232 /* ExportSpecifier */: + case 233 /* ExportSpecifier */: // Any name in an export specifier return true; } @@ -5617,12 +5730,12 @@ var ts; // export = ... // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 223 /* ImportEqualsDeclaration */ || - node.kind === 225 /* ImportClause */ && !!node.name || - node.kind === 226 /* NamespaceImport */ || - node.kind === 228 /* ImportSpecifier */ || - node.kind === 232 /* ExportSpecifier */ || - node.kind === 229 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; + return node.kind === 224 /* ImportEqualsDeclaration */ || + node.kind === 226 /* ImportClause */ && !!node.name || + node.kind === 227 /* NamespaceImport */ || + node.kind === 229 /* ImportSpecifier */ || + node.kind === 233 /* ExportSpecifier */ || + node.kind === 230 /* ExportAssignment */ && node.expression.kind === 69 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { @@ -5704,7 +5817,7 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 70 /* FirstKeyword */ <= token && token <= 134 /* LastKeyword */; + return 70 /* FirstKeyword */ <= token && token <= 135 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { @@ -5731,7 +5844,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 136 /* ComputedPropertyName */ && + return name.kind === 137 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression.kind) && !isWellKnownSymbolSyntactically(name.expression); } @@ -5749,7 +5862,7 @@ var ts; if (name.kind === 69 /* Identifier */ || name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */) { return name.text; } - if (name.kind === 136 /* ComputedPropertyName */) { + if (name.kind === 137 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -5789,18 +5902,18 @@ var ts; ts.isModifierKind = isModifierKind; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 138 /* Parameter */; + return root.kind === 139 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 165 /* BindingElement */) { + while (node.kind === 166 /* BindingElement */) { node = node.parent.parent; } return node; } ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 220 /* ModuleDeclaration */ || n.kind === 250 /* SourceFile */; + return isFunctionLike(n) || n.kind === 221 /* ModuleDeclaration */ || n.kind === 251 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; /** @@ -5850,7 +5963,7 @@ var ts; } ts.cloneEntityName = cloneEntityName; function isQualifiedName(node) { - return node.kind === 135 /* QualifiedName */; + return node.kind === 136 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function nodeIsSynthesized(node) { @@ -6180,7 +6293,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 144 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 145 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -6197,10 +6310,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 145 /* GetAccessor */) { + if (accessor.kind === 146 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 146 /* SetAccessor */) { + else if (accessor.kind === 147 /* SetAccessor */) { setAccessor = accessor; } else { @@ -6209,7 +6322,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 145 /* GetAccessor */ || member.kind === 146 /* SetAccessor */) + if ((member.kind === 146 /* GetAccessor */ || member.kind === 147 /* SetAccessor */) && (member.flags & 64 /* Static */) === (accessor.flags & 64 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -6220,10 +6333,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 145 /* GetAccessor */ && !getAccessor) { + if (member.kind === 146 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 146 /* SetAccessor */ && !setAccessor) { + if (member.kind === 147 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6433,24 +6546,24 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 171 /* NewExpression */: - case 170 /* CallExpression */: - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: - case 172 /* TaggedTemplateExpression */: - case 166 /* ArrayLiteralExpression */: - case 174 /* ParenthesizedExpression */: - case 167 /* ObjectLiteralExpression */: - case 188 /* ClassExpression */: - case 175 /* FunctionExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 172 /* NewExpression */: + case 171 /* CallExpression */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: + case 173 /* TaggedTemplateExpression */: + case 167 /* ArrayLiteralExpression */: + case 175 /* ParenthesizedExpression */: + case 168 /* ObjectLiteralExpression */: + case 189 /* ClassExpression */: + case 176 /* FunctionExpression */: case 69 /* Identifier */: case 10 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 11 /* NoSubstitutionTemplateLiteral */: - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: case 84 /* FalseKeyword */: case 93 /* NullKeyword */: case 97 /* ThisKeyword */: @@ -6467,7 +6580,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function isExpressionWithTypeArgumentsInClassExtendsClause(node) { - return node.kind === 190 /* ExpressionWithTypeArguments */ && + return node.kind === 191 /* ExpressionWithTypeArguments */ && node.parent.token === 83 /* ExtendsKeyword */ && isClassLike(node.parent.parent); } @@ -6490,16 +6603,16 @@ var ts; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteralOrArrayLiteral(expression) { var kind = expression.kind; - if (kind === 167 /* ObjectLiteralExpression */) { + if (kind === 168 /* ObjectLiteralExpression */) { return expression.properties.length === 0; } - if (kind === 166 /* ArrayLiteralExpression */) { + if (kind === 167 /* ArrayLiteralExpression */) { return expression.elements.length === 0; } return false; @@ -6854,9 +6967,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 137 /* TypeParameter */) { + if (d && d.kind === 138 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 217 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 218 /* InterfaceDeclaration */) { return current; } } @@ -6864,7 +6977,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return node.flags & 56 /* AccessibilityModifier */ && node.parent.kind === 144 /* Constructor */ && ts.isClassLike(node.parent.parent); + return node.flags & 56 /* AccessibilityModifier */ && node.parent.kind === 145 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; })(ts || (ts = {})); @@ -6876,7 +6989,7 @@ var ts; var NodeConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 250 /* SourceFile */) { + if (kind === 251 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else { @@ -6919,26 +7032,26 @@ var ts; var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 248 /* ShorthandPropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 247 /* PropertyAssignment */: - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 139 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 248 /* PropertyAssignment */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -6947,24 +7060,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -6975,290 +7088,290 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 157 /* TupleType */: + case 158 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: return visitNodes(cbNodes, node.types); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 178 /* TypeOfExpression */: + case 179 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 179 /* VoidExpression */: + case 180 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 180 /* AwaitExpression */: + case 181 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 191 /* AsExpression */: + case 192 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 187 /* SpreadElementExpression */: + case 188 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 214 /* VariableDeclarationList */: + case 215 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 198 /* IfStatement */: + case 199 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 199 /* DoStatement */: + case 200 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 202 /* ForInStatement */: + case 203 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 203 /* ForOfStatement */: + case 204 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 204 /* ContinueStatement */: - case 205 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 206 /* BreakStatement */: return visitNode(cbNode, node.label); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 243 /* CaseClause */: + case 244 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 244 /* DefaultClause */: + case 245 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 211 /* TryStatement */: + case 212 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 139 /* Decorator */: + case 140 /* Decorator */: return visitNode(cbNode, node.expression); - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 225 /* ImportClause */: + case 226 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 226 /* NamespaceImport */: + case 227 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 227 /* NamedImports */: - case 231 /* NamedExports */: + case 228 /* NamedImports */: + case 232 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 245 /* HeritageClause */: + case 246 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 234 /* ExternalModuleReference */: + case 235 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 233 /* MissingDeclaration */: + case 234 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); - case 235 /* JsxElement */: + case 236 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 236 /* JsxSelfClosingElement */: - case 237 /* JsxOpeningElement */: + case 237 /* JsxSelfClosingElement */: + case 238 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNodes, node.attributes); - case 240 /* JsxAttribute */: + case 241 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 241 /* JsxSpreadAttribute */: + case 242 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return visitNode(cbNode, node.expression); - case 239 /* JsxClosingElement */: + case 240 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 251 /* JSDocTypeExpression */: + case 252 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 255 /* JSDocUnionType */: + case 256 /* JSDocUnionType */: return visitNodes(cbNodes, node.types); - case 256 /* JSDocTupleType */: + case 257 /* JSDocTupleType */: return visitNodes(cbNodes, node.types); - case 254 /* JSDocArrayType */: + case 255 /* JSDocArrayType */: return visitNode(cbNode, node.elementType); - case 258 /* JSDocNonNullableType */: + case 259 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 257 /* JSDocNullableType */: + case 258 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 259 /* JSDocRecordType */: + case 260 /* JSDocRecordType */: return visitNodes(cbNodes, node.members); - case 261 /* JSDocTypeReference */: + case 262 /* JSDocTypeReference */: return visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeArguments); - case 262 /* JSDocOptionalType */: + case 263 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 263 /* JSDocFunctionType */: + case 264 /* JSDocFunctionType */: return visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 264 /* JSDocVariadicType */: + case 265 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 265 /* JSDocConstructorType */: + case 266 /* JSDocConstructorType */: return visitNode(cbNode, node.type); - case 266 /* JSDocThisType */: + case 267 /* JSDocThisType */: return visitNode(cbNode, node.type); - case 260 /* JSDocRecordMember */: + case 261 /* JSDocRecordMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 267 /* JSDocComment */: + case 268 /* JSDocComment */: return visitNodes(cbNodes, node.tags); - case 269 /* JSDocParameterTag */: + case 270 /* JSDocParameterTag */: return visitNode(cbNode, node.preParameterName) || visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.postParameterName); - case 270 /* JSDocReturnTag */: + case 271 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 271 /* JSDocTypeTag */: + case 272 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 272 /* JSDocTemplateTag */: + case 273 /* JSDocTemplateTag */: return visitNodes(cbNodes, node.typeParameters); } } @@ -7466,9 +7579,9 @@ var ts; // Add additional cases as necessary depending on how we see JSDoc comments used // in the wild. switch (node.kind) { - case 195 /* VariableStatement */: - case 215 /* FunctionDeclaration */: - case 138 /* Parameter */: + case 196 /* VariableStatement */: + case 216 /* FunctionDeclaration */: + case 139 /* Parameter */: addJSDocComment(node); } forEachChild(node, visit); @@ -7511,7 +7624,7 @@ var ts; function createSourceFile(fileName, languageVersion) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(250 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(251 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -7685,16 +7798,18 @@ var ts; } return result; } - // Invokes the provided callback then unconditionally restores the parser to the state it - // was in immediately prior to invoking the callback. The result of invoking the callback - // is returned from this function. + /** Invokes the provided callback then unconditionally restores the parser to the state it + * was in immediately prior to invoking the callback. The result of invoking the callback + * is returned from this function. + */ function lookAhead(callback) { return speculationHelper(callback, /*isLookAhead*/ true); } - // Invokes the provided callback. If the callback returns something falsy, then it restores - // the parser to the state it was in immediately prior to invoking the callback. If the - // callback returns something truthy, then the parser state is not rolled back. The result - // of invoking the callback is returned from this function. + /** Invokes the provided callback. If the callback returns something falsy, then it restores + * the parser to the state it was in immediately prior to invoking the callback. If the + * callback returns something truthy, then the parser state is not rolled back. The result + * of invoking the callback is returned from this function. + */ function tryParse(callback) { return speculationHelper(callback, /*isLookAhead*/ false); } @@ -7861,7 +7976,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(136 /* ComputedPropertyName */); + var node = createNode(137 /* ComputedPropertyName */); parseExpected(19 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -8262,14 +8377,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 144 /* Constructor */: - case 149 /* IndexSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 141 /* PropertyDeclaration */: - case 193 /* SemicolonClassElement */: + case 145 /* Constructor */: + case 150 /* IndexSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 194 /* SemicolonClassElement */: return true; - case 143 /* MethodDeclaration */: + case 144 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -8284,8 +8399,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: return true; } } @@ -8294,58 +8409,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: - case 195 /* VariableStatement */: - case 194 /* Block */: - case 198 /* IfStatement */: - case 197 /* ExpressionStatement */: - case 210 /* ThrowStatement */: - case 206 /* ReturnStatement */: - case 208 /* SwitchStatement */: - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 201 /* ForStatement */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 196 /* EmptyStatement */: - case 211 /* TryStatement */: - case 209 /* LabeledStatement */: - case 199 /* DoStatement */: - case 212 /* DebuggerStatement */: - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 230 /* ExportDeclaration */: - case 229 /* ExportAssignment */: - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 218 /* TypeAliasDeclaration */: + case 216 /* FunctionDeclaration */: + case 196 /* VariableStatement */: + case 195 /* Block */: + case 199 /* IfStatement */: + case 198 /* ExpressionStatement */: + case 211 /* ThrowStatement */: + case 207 /* ReturnStatement */: + case 209 /* SwitchStatement */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 202 /* ForStatement */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 197 /* EmptyStatement */: + case 212 /* TryStatement */: + case 210 /* LabeledStatement */: + case 200 /* DoStatement */: + case 213 /* DebuggerStatement */: + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 231 /* ExportDeclaration */: + case 230 /* ExportAssignment */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 219 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 249 /* EnumMember */; + return node.kind === 250 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 148 /* ConstructSignature */: - case 142 /* MethodSignature */: - case 149 /* IndexSignature */: - case 140 /* PropertySignature */: - case 147 /* CallSignature */: + case 149 /* ConstructSignature */: + case 143 /* MethodSignature */: + case 150 /* IndexSignature */: + case 141 /* PropertySignature */: + case 148 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 213 /* VariableDeclaration */) { + if (node.kind !== 214 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -8366,7 +8481,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 138 /* Parameter */) { + if (node.kind !== 139 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -8483,7 +8598,7 @@ var ts; function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); while (parseOptional(21 /* DotToken */)) { - var node = createNode(135 /* QualifiedName */, entity.pos); + var node = createNode(136 /* QualifiedName */, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -8522,7 +8637,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(185 /* TemplateExpression */); + var template = createNode(186 /* TemplateExpression */); template.head = parseTemplateLiteralFragment(); ts.Debug.assert(template.head.kind === 12 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; @@ -8535,7 +8650,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(192 /* TemplateSpan */); + var span = createNode(193 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token === 16 /* CloseBraceToken */) { @@ -8549,7 +8664,7 @@ var ts; return finishNode(span); } function parseStringLiteralTypeNode() { - return parseLiteralLikeNode(162 /* StringLiteralType */, /*internName*/ true); + return parseLiteralLikeNode(163 /* StringLiteralType */, /*internName*/ true); } function parseLiteralNode(internName) { return parseLiteralLikeNode(token, internName); @@ -8584,12 +8699,9 @@ var ts; return node; } // TYPES - function parseTypeReferenceOrTypePredicate() { + function parseTypeReference() { var typeName = parseEntityName(/*allowReservedWords*/ false, ts.Diagnostics.Type_expected); - if (typeName.kind === 69 /* Identifier */ && token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { - return parseTypePredicate(typeName); - } - var node = createNode(151 /* TypeReference */, typeName.pos); + var node = createNode(152 /* TypeReference */, typeName.pos); node.typeName = typeName; if (!scanner.hasPrecedingLineBreak() && token === 25 /* LessThanToken */) { node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 25 /* LessThanToken */, 27 /* GreaterThanToken */); @@ -8598,24 +8710,24 @@ var ts; } function parseTypePredicate(lhs) { nextToken(); - var node = createNode(150 /* TypePredicate */, lhs.pos); + var node = createNode(151 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(161 /* ThisType */); + var node = createNode(162 /* ThisType */); nextToken(); return finishNode(node); } function parseTypeQuery() { - var node = createNode(154 /* TypeQuery */); + var node = createNode(155 /* TypeQuery */); parseExpected(101 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(137 /* TypeParameter */); + var node = createNode(138 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(83 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -8659,7 +8771,7 @@ var ts; } } function parseParameter() { - var node = createNode(138 /* Parameter */); + var node = createNode(139 /* Parameter */); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); node.dotDotDotToken = parseOptionalToken(22 /* DotDotDotToken */); @@ -8702,10 +8814,10 @@ var ts; signature.parameters = parseParameterList(yieldContext, awaitContext, requireCompleteParameterList); if (returnTokenRequired) { parseExpected(returnToken); - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } else if (parseOptional(returnToken)) { - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } } function parseParameterList(yieldContext, awaitContext, requireCompleteParameterList) { @@ -8753,7 +8865,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 148 /* ConstructSignature */) { + if (kind === 149 /* ConstructSignature */) { parseExpected(92 /* NewKeyword */); } fillSignature(54 /* ColonToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -8817,7 +8929,7 @@ var ts; return token === 54 /* ColonToken */ || token === 24 /* CommaToken */ || token === 20 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(149 /* IndexSignature */, fullStart); + var node = createNode(150 /* IndexSignature */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 19 /* OpenBracketToken */, 20 /* CloseBracketToken */); @@ -8830,7 +8942,7 @@ var ts; var name = parsePropertyName(); var questionToken = parseOptionalToken(53 /* QuestionToken */); if (token === 17 /* OpenParenToken */ || token === 25 /* LessThanToken */) { - var method = createNode(142 /* MethodSignature */, fullStart); + var method = createNode(143 /* MethodSignature */, fullStart); method.name = name; method.questionToken = questionToken; // Method signatues don't exist in expression contexts. So they have neither @@ -8840,7 +8952,7 @@ var ts; return finishNode(method); } else { - var property = createNode(140 /* PropertySignature */, fullStart); + var property = createNode(141 /* PropertySignature */, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -8888,7 +9000,7 @@ var ts; switch (token) { case 17 /* OpenParenToken */: case 25 /* LessThanToken */: - return parseSignatureMember(147 /* CallSignature */); + return parseSignatureMember(148 /* CallSignature */); case 19 /* OpenBracketToken */: // Indexer or computed property return isIndexSignature() @@ -8896,7 +9008,7 @@ var ts; : parsePropertyOrMethodSignature(); case 92 /* NewKeyword */: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(148 /* ConstructSignature */); + return parseSignatureMember(149 /* ConstructSignature */); } // fall through. case 9 /* StringLiteral */: @@ -8933,7 +9045,7 @@ var ts; return token === 17 /* OpenParenToken */ || token === 25 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(155 /* TypeLiteral */); + var node = createNode(156 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -8949,12 +9061,12 @@ var ts; return members; } function parseTupleType() { - var node = createNode(157 /* TupleType */); + var node = createNode(158 /* TupleType */); node.elementTypes = parseBracketedList(19 /* TupleElementTypes */, parseType, 19 /* OpenBracketToken */, 20 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(160 /* ParenthesizedType */); + var node = createNode(161 /* ParenthesizedType */); parseExpected(17 /* OpenParenToken */); node.type = parseType(); parseExpected(18 /* CloseParenToken */); @@ -8962,7 +9074,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 153 /* ConstructorType */) { + if (kind === 154 /* ConstructorType */) { parseExpected(92 /* NewKeyword */); } fillSignature(34 /* EqualsGreaterThanToken */, /*yieldContext*/ false, /*awaitContext*/ false, /*requireCompleteParameterList*/ false, node); @@ -8981,7 +9093,7 @@ var ts; case 131 /* SymbolKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReferenceOrTypePredicate(); + return node || parseTypeReference(); case 9 /* StringLiteral */: return parseStringLiteralTypeNode(); case 103 /* VoidKeyword */: @@ -9004,7 +9116,7 @@ var ts; case 17 /* OpenParenToken */: return parseParenthesizedType(); default: - return parseTypeReferenceOrTypePredicate(); + return parseTypeReference(); } } function isStartOfType() { @@ -9039,7 +9151,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(19 /* OpenBracketToken */)) { parseExpected(20 /* CloseBracketToken */); - var node = createNode(156 /* ArrayType */, type.pos); + var node = createNode(157 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -9061,10 +9173,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(159 /* IntersectionType */, parseArrayTypeOrHigher, 46 /* AmpersandToken */); + return parseUnionOrIntersectionType(160 /* IntersectionType */, parseArrayTypeOrHigher, 46 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(158 /* UnionType */, parseIntersectionTypeOrHigher, 47 /* BarToken */); + return parseUnionOrIntersectionType(159 /* UnionType */, parseIntersectionTypeOrHigher, 47 /* BarToken */); } function isStartOfFunctionType() { if (token === 25 /* LessThanToken */) { @@ -9101,6 +9213,26 @@ var ts; } return false; } + function parseTypeOrTypePredicate() { + var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); + var type = parseType(); + if (typePredicateVariable) { + var node = createNode(151 /* TypePredicate */, typePredicateVariable.pos); + node.parameterName = typePredicateVariable; + node.type = type; + return finishNode(node); + } + else { + return type; + } + } + function parseTypePredicatePrefix() { + var id = parseIdentifier(); + if (token === 124 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + nextToken(); + return id; + } + } function parseType() { // The rules about 'yield' only apply to actual code/expression contexts. They don't // apply to 'type' contexts. So we disable these parameters here before moving on. @@ -9108,10 +9240,10 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(152 /* FunctionType */); + return parseFunctionOrConstructorType(153 /* FunctionType */); } if (token === 92 /* NewKeyword */) { - return parseFunctionOrConstructorType(153 /* ConstructorType */); + return parseFunctionOrConstructorType(154 /* ConstructorType */); } return parseUnionTypeOrHigher(); } @@ -9304,7 +9436,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(186 /* YieldExpression */); + var node = createNode(187 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -9324,8 +9456,8 @@ var ts; } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 34 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(176 /* ArrowFunction */, identifier.pos); - var parameter = createNode(138 /* Parameter */, identifier.pos); + var node = createNode(177 /* ArrowFunction */, identifier.pos); + var parameter = createNode(139 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; @@ -9477,7 +9609,7 @@ var ts; return parseParenthesizedArrowFunctionExpressionHead(/*allowAmbiguity*/ false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(176 /* ArrowFunction */); + var node = createNode(177 /* ArrowFunction */); setModifiers(node, parseModifiersForArrowFunction()); var isAsync = !!(node.flags & 256 /* Async */); // Arrow functions are never generators. @@ -9543,7 +9675,7 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(184 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(185 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); @@ -9556,7 +9688,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 90 /* InKeyword */ || t === 134 /* OfKeyword */; + return t === 90 /* InKeyword */ || t === 135 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -9664,39 +9796,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(183 /* BinaryExpression */, left.pos); + var node = createNode(184 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(191 /* AsExpression */, left.pos); + var node = createNode(192 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(181 /* PrefixUnaryExpression */); + var node = createNode(182 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(177 /* DeleteExpression */); + var node = createNode(178 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(178 /* TypeOfExpression */); + var node = createNode(179 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(179 /* VoidExpression */); + var node = createNode(180 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9712,7 +9844,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(180 /* AwaitExpression */); + var node = createNode(181 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -9738,7 +9870,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token === 38 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 173 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 174 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -9828,7 +9960,7 @@ var ts; */ function parseIncrementExpression() { if (token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) { - var node = createNode(181 /* PrefixUnaryExpression */); + var node = createNode(182 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -9841,7 +9973,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 41 /* PlusPlusToken */ || token === 42 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(182 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(183 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -9945,7 +10077,7 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(168 /* PropertyAccessExpression */, expression.pos); + var node = createNode(169 /* PropertyAccessExpression */, expression.pos); node.expression = expression; node.dotToken = parseExpectedToken(21 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -9964,8 +10096,8 @@ var ts; function parseJsxElementOrSelfClosingElement(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElement(inExpressionContext); var result; - if (opening.kind === 237 /* JsxOpeningElement */) { - var node = createNode(235 /* JsxElement */, opening.pos); + if (opening.kind === 238 /* JsxOpeningElement */) { + var node = createNode(236 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement.tagName); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -9975,7 +10107,7 @@ var ts; result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 236 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 237 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -9990,7 +10122,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElement(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(183 /* BinaryExpression */, result.pos); + var badNode = createNode(184 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -10002,13 +10134,13 @@ var ts; return result; } function parseJsxText() { - var node = createNode(238 /* JsxText */, scanner.getStartPos()); + var node = createNode(239 /* JsxText */, scanner.getStartPos()); token = scanner.scanJsxToken(); return finishNode(node); } function parseJsxChild() { switch (token) { - case 238 /* JsxText */: + case 239 /* JsxText */: return parseJsxText(); case 15 /* OpenBraceToken */: return parseJsxExpression(/*inExpressionContext*/ false); @@ -10050,7 +10182,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(237 /* JsxOpeningElement */, fullStart); + node = createNode(238 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -10062,7 +10194,7 @@ var ts; parseExpected(27 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(236 /* JsxSelfClosingElement */, fullStart); + node = createNode(237 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -10073,7 +10205,7 @@ var ts; var elementName = parseIdentifierName(); while (parseOptional(21 /* DotToken */)) { scanJsxIdentifier(); - var node = createNode(135 /* QualifiedName */, elementName.pos); + var node = createNode(136 /* QualifiedName */, elementName.pos); node.left = elementName; node.right = parseIdentifierName(); elementName = finishNode(node); @@ -10081,7 +10213,7 @@ var ts; return elementName; } function parseJsxExpression(inExpressionContext) { - var node = createNode(242 /* JsxExpression */); + var node = createNode(243 /* JsxExpression */); parseExpected(15 /* OpenBraceToken */); if (token !== 16 /* CloseBraceToken */) { node.expression = parseAssignmentExpressionOrHigher(); @@ -10100,7 +10232,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(240 /* JsxAttribute */); + var node = createNode(241 /* JsxAttribute */); node.name = parseIdentifierName(); if (parseOptional(56 /* EqualsToken */)) { switch (token) { @@ -10115,7 +10247,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(241 /* JsxSpreadAttribute */); + var node = createNode(242 /* JsxSpreadAttribute */); parseExpected(15 /* OpenBraceToken */); parseExpected(22 /* DotDotDotToken */); node.expression = parseExpression(); @@ -10123,7 +10255,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(239 /* JsxClosingElement */); + var node = createNode(240 /* JsxClosingElement */); parseExpected(26 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -10136,7 +10268,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(173 /* TypeAssertionExpression */); + var node = createNode(174 /* TypeAssertionExpression */); parseExpected(25 /* LessThanToken */); node.type = parseType(); parseExpected(27 /* GreaterThanToken */); @@ -10147,7 +10279,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(21 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(168 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(169 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -10156,7 +10288,7 @@ var ts; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(19 /* OpenBracketToken */)) { - var indexedAccess = createNode(169 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(170 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -10172,7 +10304,7 @@ var ts; continue; } if (token === 11 /* NoSubstitutionTemplateLiteral */ || token === 12 /* TemplateHead */) { - var tagExpression = createNode(172 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(173 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token === 11 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -10195,7 +10327,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(170 /* CallExpression */, expression.pos); + var callExpr = createNode(171 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -10203,7 +10335,7 @@ var ts; continue; } else if (token === 17 /* OpenParenToken */) { - var callExpr = createNode(170 /* CallExpression */, expression.pos); + var callExpr = createNode(171 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -10313,28 +10445,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(174 /* ParenthesizedExpression */); + var node = createNode(175 /* ParenthesizedExpression */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(187 /* SpreadElementExpression */); + var node = createNode(188 /* SpreadElementExpression */); parseExpected(22 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token === 22 /* DotDotDotToken */ ? parseSpreadElement() : - token === 24 /* CommaToken */ ? createNode(189 /* OmittedExpression */) : + token === 24 /* CommaToken */ ? createNode(190 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(166 /* ArrayLiteralExpression */); + var node = createNode(167 /* ArrayLiteralExpression */); parseExpected(19 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 1024 /* MultiLine */; @@ -10344,10 +10476,10 @@ var ts; } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { if (parseContextualModifier(123 /* GetKeyword */)) { - return parseAccessorDeclaration(145 /* GetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(146 /* GetAccessor */, fullStart, decorators, modifiers); } else if (parseContextualModifier(129 /* SetKeyword */)) { - return parseAccessorDeclaration(146 /* SetAccessor */, fullStart, decorators, modifiers); + return parseAccessorDeclaration(147 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -10374,7 +10506,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token === 24 /* CommaToken */ || token === 16 /* CloseBraceToken */ || token === 56 /* EqualsToken */); if (isShorthandPropertyAssignment) { - var shorthandDeclaration = createNode(248 /* ShorthandPropertyAssignment */, fullStart); + var shorthandDeclaration = createNode(249 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; var equalsToken = parseOptionalToken(56 /* EqualsToken */); @@ -10385,7 +10517,7 @@ var ts; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(247 /* PropertyAssignment */, fullStart); + var propertyAssignment = createNode(248 /* PropertyAssignment */, fullStart); propertyAssignment.modifiers = modifiers; propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; @@ -10395,7 +10527,7 @@ var ts; } } function parseObjectLiteralExpression() { - var node = createNode(167 /* ObjectLiteralExpression */); + var node = createNode(168 /* ObjectLiteralExpression */); parseExpected(15 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 1024 /* MultiLine */; @@ -10414,7 +10546,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNode(175 /* FunctionExpression */); + var node = createNode(176 /* FunctionExpression */); setModifiers(node, parseModifiers()); parseExpected(87 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(37 /* AsteriskToken */); @@ -10436,7 +10568,7 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(171 /* NewExpression */); + var node = createNode(172 /* NewExpression */); parseExpected(92 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -10447,7 +10579,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(194 /* Block */); + var node = createNode(195 /* Block */); if (parseExpected(15 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -10477,12 +10609,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(196 /* EmptyStatement */); + var node = createNode(197 /* EmptyStatement */); parseExpected(23 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(198 /* IfStatement */); + var node = createNode(199 /* IfStatement */); parseExpected(88 /* IfKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10492,7 +10624,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(199 /* DoStatement */); + var node = createNode(200 /* DoStatement */); parseExpected(79 /* DoKeyword */); node.statement = parseStatement(); parseExpected(104 /* WhileKeyword */); @@ -10507,7 +10639,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(200 /* WhileStatement */); + var node = createNode(201 /* WhileStatement */); parseExpected(104 /* WhileKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10530,21 +10662,21 @@ var ts; } var forOrForInOrForOfStatement; if (parseOptional(90 /* InKeyword */)) { - var forInStatement = createNode(202 /* ForInStatement */, pos); + var forInStatement = createNode(203 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(134 /* OfKeyword */)) { - var forOfStatement = createNode(203 /* ForOfStatement */, pos); + else if (parseOptional(135 /* OfKeyword */)) { + var forOfStatement = createNode(204 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(18 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(201 /* ForStatement */, pos); + var forStatement = createNode(202 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(23 /* SemicolonToken */); if (token !== 23 /* SemicolonToken */ && token !== 18 /* CloseParenToken */) { @@ -10562,7 +10694,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); + parseExpected(kind === 206 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -10570,7 +10702,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(206 /* ReturnStatement */); + var node = createNode(207 /* ReturnStatement */); parseExpected(94 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -10579,7 +10711,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(207 /* WithStatement */); + var node = createNode(208 /* WithStatement */); parseExpected(105 /* WithKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -10588,7 +10720,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(243 /* CaseClause */); + var node = createNode(244 /* CaseClause */); parseExpected(71 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(54 /* ColonToken */); @@ -10596,7 +10728,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(244 /* DefaultClause */); + var node = createNode(245 /* DefaultClause */); parseExpected(77 /* DefaultKeyword */); parseExpected(54 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -10606,12 +10738,12 @@ var ts; return token === 71 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(208 /* SwitchStatement */); + var node = createNode(209 /* SwitchStatement */); parseExpected(96 /* SwitchKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(18 /* CloseParenToken */); - var caseBlock = createNode(222 /* CaseBlock */, scanner.getStartPos()); + var caseBlock = createNode(223 /* CaseBlock */, scanner.getStartPos()); parseExpected(15 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(16 /* CloseBraceToken */); @@ -10626,7 +10758,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(210 /* ThrowStatement */); + var node = createNode(211 /* ThrowStatement */); parseExpected(98 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -10634,7 +10766,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(211 /* TryStatement */); + var node = createNode(212 /* TryStatement */); parseExpected(100 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token === 72 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -10647,7 +10779,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(246 /* CatchClause */); + var result = createNode(247 /* CatchClause */); parseExpected(72 /* CatchKeyword */); if (parseExpected(17 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -10657,7 +10789,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(212 /* DebuggerStatement */); + var node = createNode(213 /* DebuggerStatement */); parseExpected(76 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -10669,13 +10801,13 @@ var ts; var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); if (expression.kind === 69 /* Identifier */ && parseOptional(54 /* ColonToken */)) { - var labeledStatement = createNode(209 /* LabeledStatement */, fullStart); + var labeledStatement = createNode(210 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(197 /* ExpressionStatement */, fullStart); + var expressionStatement = createNode(198 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); @@ -10742,6 +10874,8 @@ var ts; return false; } continue; + case 134 /* GlobalKeyword */: + return nextToken() === 15 /* OpenBraceToken */; case 89 /* ImportKeyword */: nextToken(); return token === 9 /* StringLiteral */ || token === 37 /* AsteriskToken */ || @@ -10801,6 +10935,7 @@ var ts; case 125 /* ModuleKeyword */: case 126 /* NamespaceKeyword */: case 132 /* TypeKeyword */: + case 134 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 112 /* PublicKeyword */: @@ -10849,9 +10984,9 @@ var ts; case 86 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 75 /* ContinueKeyword */: - return parseBreakOrContinueStatement(204 /* ContinueStatement */); + return parseBreakOrContinueStatement(205 /* ContinueStatement */); case 70 /* BreakKeyword */: - return parseBreakOrContinueStatement(205 /* BreakStatement */); + return parseBreakOrContinueStatement(206 /* BreakStatement */); case 94 /* ReturnKeyword */: return parseReturnStatement(); case 105 /* WithKeyword */: @@ -10884,6 +11019,7 @@ var ts; case 112 /* PublicKeyword */: case 115 /* AbstractKeyword */: case 113 /* StaticKeyword */: + case 134 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -10910,6 +11046,7 @@ var ts; return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case 81 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); + case 134 /* GlobalKeyword */: case 125 /* ModuleKeyword */: case 126 /* NamespaceKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -10924,7 +11061,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(233 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var node = createMissingNode(234 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -10946,16 +11083,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token === 24 /* CommaToken */) { - return createNode(189 /* OmittedExpression */); + return createNode(190 /* OmittedExpression */); } - var node = createNode(165 /* BindingElement */); + var node = createNode(166 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(22 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseBindingElementInitializer(/*inParameter*/ false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(165 /* BindingElement */); + var node = createNode(166 /* BindingElement */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); if (tokenIsIdentifier && token !== 54 /* ColonToken */) { @@ -10970,14 +11107,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(163 /* ObjectBindingPattern */); + var node = createNode(164 /* ObjectBindingPattern */); parseExpected(15 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(16 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(164 /* ArrayBindingPattern */); + var node = createNode(165 /* ArrayBindingPattern */); parseExpected(19 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(20 /* CloseBracketToken */); @@ -10996,7 +11133,7 @@ var ts; return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(213 /* VariableDeclaration */); + var node = createNode(214 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -11005,7 +11142,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(214 /* VariableDeclarationList */); + var node = createNode(215 /* VariableDeclarationList */); switch (token) { case 102 /* VarKeyword */: break; @@ -11028,7 +11165,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token === 134 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token === 135 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -11043,7 +11180,7 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 18 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(195 /* VariableStatement */, fullStart); + var node = createNode(196 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); @@ -11051,7 +11188,7 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215 /* FunctionDeclaration */, fullStart); + var node = createNode(216 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(87 /* FunctionKeyword */); @@ -11064,7 +11201,7 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(144 /* Constructor */, pos); + var node = createNode(145 /* Constructor */, pos); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(121 /* ConstructorKeyword */); @@ -11073,7 +11210,7 @@ var ts; return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(143 /* MethodDeclaration */, fullStart); + var method = createNode(144 /* MethodDeclaration */, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; @@ -11086,7 +11223,7 @@ var ts; return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(141 /* PropertyDeclaration */, fullStart); + var property = createNode(142 /* PropertyDeclaration */, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -11212,7 +11349,7 @@ var ts; decorators = []; decorators.pos = decoratorStart; } - var decorator = createNode(139 /* Decorator */, decoratorStart); + var decorator = createNode(140 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -11277,7 +11414,7 @@ var ts; } function parseClassElement() { if (token === 23 /* SemicolonToken */) { - var result = createNode(193 /* SemicolonClassElement */); + var result = createNode(194 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -11315,10 +11452,10 @@ var ts; return parseClassDeclarationOrExpression( /*fullStart*/ scanner.getStartPos(), /*decorators*/ undefined, - /*modifiers*/ undefined, 188 /* ClassExpression */); + /*modifiers*/ undefined, 189 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 216 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 217 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var node = createNode(kind, fullStart); @@ -11362,7 +11499,7 @@ var ts; } function parseHeritageClause() { if (token === 83 /* ExtendsKeyword */ || token === 106 /* ImplementsKeyword */) { - var node = createNode(245 /* HeritageClause */); + var node = createNode(246 /* HeritageClause */); node.token = token; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -11371,7 +11508,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(190 /* ExpressionWithTypeArguments */); + var node = createNode(191 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); if (token === 25 /* LessThanToken */) { node.typeArguments = parseBracketedList(18 /* TypeArguments */, parseType, 25 /* LessThanToken */, 27 /* GreaterThanToken */); @@ -11385,7 +11522,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(217 /* InterfaceDeclaration */, fullStart); + var node = createNode(218 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(107 /* InterfaceKeyword */); @@ -11396,7 +11533,7 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218 /* TypeAliasDeclaration */, fullStart); + var node = createNode(219 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(132 /* TypeKeyword */); @@ -11412,13 +11549,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(249 /* EnumMember */, scanner.getStartPos()); + var node = createNode(250 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(219 /* EnumDeclaration */, fullStart); + var node = createNode(220 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(81 /* EnumKeyword */); @@ -11433,7 +11570,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(221 /* ModuleBlock */, scanner.getStartPos()); + var node = createNode(222 /* ModuleBlock */, scanner.getStartPos()); if (parseExpected(15 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(16 /* CloseBraceToken */); @@ -11444,7 +11581,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(220 /* ModuleDeclaration */, fullStart); + var node = createNode(221 /* ModuleDeclaration */, fullStart); // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 65536 /* Namespace */; @@ -11458,16 +11595,27 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(220 /* ModuleDeclaration */, fullStart); + var node = createNode(221 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - node.name = parseLiteralNode(/*internName*/ true); + if (token === 134 /* GlobalKeyword */) { + // parse 'global' as name of global scope augmentation + node.name = parseIdentifier(); + node.flags |= 2097152 /* GlobalAugmentation */; + } + else { + node.name = parseLiteralNode(/*internName*/ true); + } node.body = parseModuleBlock(); return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { var flags = modifiers ? modifiers.flags : 0; - if (parseOptional(126 /* NamespaceKeyword */)) { + if (token === 134 /* GlobalKeyword */) { + // global augmentation + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + else if (parseOptional(126 /* NamespaceKeyword */)) { flags |= 65536 /* Namespace */; } else { @@ -11498,7 +11646,7 @@ var ts; // ImportEquals declaration of type: // import x = require("mod"); or // import x = M.x; - var importEqualsDeclaration = createNode(223 /* ImportEqualsDeclaration */, fullStart); + var importEqualsDeclaration = createNode(224 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; @@ -11509,7 +11657,7 @@ var ts; } } // Import statement - var importDeclaration = createNode(224 /* ImportDeclaration */, fullStart); + var importDeclaration = createNode(225 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); // ImportDeclaration: @@ -11532,7 +11680,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(225 /* ImportClause */, fullStart); + var importClause = createNode(226 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -11542,7 +11690,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(24 /* CommaToken */)) { - importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(227 /* NamedImports */); + importClause.namedBindings = token === 37 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(228 /* NamedImports */); } return finishNode(importClause); } @@ -11552,7 +11700,7 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(234 /* ExternalModuleReference */); + var node = createNode(235 /* ExternalModuleReference */); parseExpected(127 /* RequireKeyword */); parseExpected(17 /* OpenParenToken */); node.expression = parseModuleSpecifier(); @@ -11575,7 +11723,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(226 /* NamespaceImport */); + var namespaceImport = createNode(227 /* NamespaceImport */); parseExpected(37 /* AsteriskToken */); parseExpected(116 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -11590,14 +11738,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 227 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); + node.elements = parseBracketedList(21 /* ImportOrExportSpecifiers */, kind === 228 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 15 /* OpenBraceToken */, 16 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(232 /* ExportSpecifier */); + return parseImportOrExportSpecifier(233 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(228 /* ImportSpecifier */); + return parseImportOrExportSpecifier(229 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -11622,14 +11770,14 @@ var ts; else { node.name = identifierName; } - if (kind === 228 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 229 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(230 /* ExportDeclaration */, fullStart); + var node = createNode(231 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(37 /* AsteriskToken */)) { @@ -11637,7 +11785,7 @@ var ts; node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(231 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(232 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. @@ -11650,7 +11798,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(229 /* ExportAssignment */, fullStart); + var node = createNode(230 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); if (parseOptional(56 /* EqualsToken */)) { @@ -11725,10 +11873,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 2 /* Export */ - || node.kind === 223 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 234 /* ExternalModuleReference */ - || node.kind === 224 /* ImportDeclaration */ - || node.kind === 229 /* ExportAssignment */ - || node.kind === 230 /* ExportDeclaration */ + || node.kind === 224 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 235 /* ExternalModuleReference */ + || node.kind === 225 /* ImportDeclaration */ + || node.kind === 230 /* ExportAssignment */ + || node.kind === 231 /* ExportDeclaration */ ? node : undefined; }); @@ -11803,7 +11951,7 @@ var ts; scanner.setText(sourceText, start, length); // Prime the first token for us to start processing. token = nextToken(); - var result = createNode(251 /* JSDocTypeExpression */); + var result = createNode(252 /* JSDocTypeExpression */); parseExpected(15 /* OpenBraceToken */); result.type = parseJSDocTopLevelType(); parseExpected(16 /* CloseBraceToken */); @@ -11814,12 +11962,12 @@ var ts; function parseJSDocTopLevelType() { var type = parseJSDocType(); if (token === 47 /* BarToken */) { - var unionType = createNode(255 /* JSDocUnionType */, type.pos); + var unionType = createNode(256 /* JSDocUnionType */, type.pos); unionType.types = parseJSDocTypeList(type); type = finishNode(unionType); } if (token === 56 /* EqualsToken */) { - var optionalType = createNode(262 /* JSDocOptionalType */, type.pos); + var optionalType = createNode(263 /* JSDocOptionalType */, type.pos); nextToken(); optionalType.type = type; type = finishNode(optionalType); @@ -11830,20 +11978,20 @@ var ts; var type = parseBasicTypeExpression(); while (true) { if (token === 19 /* OpenBracketToken */) { - var arrayType = createNode(254 /* JSDocArrayType */, type.pos); + var arrayType = createNode(255 /* JSDocArrayType */, type.pos); arrayType.elementType = type; nextToken(); parseExpected(20 /* CloseBracketToken */); type = finishNode(arrayType); } else if (token === 53 /* QuestionToken */) { - var nullableType = createNode(257 /* JSDocNullableType */, type.pos); + var nullableType = createNode(258 /* JSDocNullableType */, type.pos); nullableType.type = type; nextToken(); type = finishNode(nullableType); } else if (token === 49 /* ExclamationToken */) { - var nonNullableType = createNode(258 /* JSDocNonNullableType */, type.pos); + var nonNullableType = createNode(259 /* JSDocNonNullableType */, type.pos); nonNullableType.type = type; nextToken(); type = finishNode(nonNullableType); @@ -11888,27 +12036,27 @@ var ts; return parseJSDocTypeReference(); } function parseJSDocThisType() { - var result = createNode(266 /* JSDocThisType */); + var result = createNode(267 /* JSDocThisType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocConstructorType() { - var result = createNode(265 /* JSDocConstructorType */); + var result = createNode(266 /* JSDocConstructorType */); nextToken(); parseExpected(54 /* ColonToken */); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocVariadicType() { - var result = createNode(264 /* JSDocVariadicType */); + var result = createNode(265 /* JSDocVariadicType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocFunctionType() { - var result = createNode(263 /* JSDocFunctionType */); + var result = createNode(264 /* JSDocFunctionType */); nextToken(); parseExpected(17 /* OpenParenToken */); result.parameters = parseDelimitedList(22 /* JSDocFunctionParameters */, parseJSDocParameter); @@ -11921,12 +12069,12 @@ var ts; return finishNode(result); } function parseJSDocParameter() { - var parameter = createNode(138 /* Parameter */); + var parameter = createNode(139 /* Parameter */); parameter.type = parseJSDocType(); return finishNode(parameter); } function parseJSDocTypeReference() { - var result = createNode(261 /* JSDocTypeReference */); + var result = createNode(262 /* JSDocTypeReference */); result.name = parseSimplePropertyName(); while (parseOptional(21 /* DotToken */)) { if (token === 25 /* LessThanToken */) { @@ -11956,13 +12104,13 @@ var ts; } } function parseQualifiedName(left) { - var result = createNode(135 /* QualifiedName */, left.pos); + var result = createNode(136 /* QualifiedName */, left.pos); result.left = left; result.right = parseIdentifierName(); return finishNode(result); } function parseJSDocRecordType() { - var result = createNode(259 /* JSDocRecordType */); + var result = createNode(260 /* JSDocRecordType */); nextToken(); result.members = parseDelimitedList(24 /* JSDocRecordMembers */, parseJSDocRecordMember); checkForTrailingComma(result.members); @@ -11970,7 +12118,7 @@ var ts; return finishNode(result); } function parseJSDocRecordMember() { - var result = createNode(260 /* JSDocRecordMember */); + var result = createNode(261 /* JSDocRecordMember */); result.name = parseSimplePropertyName(); if (token === 54 /* ColonToken */) { nextToken(); @@ -11979,13 +12127,13 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(258 /* JSDocNonNullableType */); + var result = createNode(259 /* JSDocNonNullableType */); nextToken(); result.type = parseJSDocType(); return finishNode(result); } function parseJSDocTupleType() { - var result = createNode(256 /* JSDocTupleType */); + var result = createNode(257 /* JSDocTupleType */); nextToken(); result.types = parseDelimitedList(25 /* JSDocTupleTypes */, parseJSDocType); checkForTrailingComma(result.types); @@ -11999,7 +12147,7 @@ var ts; } } function parseJSDocUnionType() { - var result = createNode(255 /* JSDocUnionType */); + var result = createNode(256 /* JSDocUnionType */); nextToken(); result.types = parseJSDocTypeList(parseJSDocType()); parseExpected(18 /* CloseParenToken */); @@ -12017,7 +12165,7 @@ var ts; return types; } function parseJSDocAllType() { - var result = createNode(252 /* JSDocAllType */); + var result = createNode(253 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -12040,11 +12188,11 @@ var ts; token === 27 /* GreaterThanToken */ || token === 56 /* EqualsToken */ || token === 47 /* BarToken */) { - var result = createNode(253 /* JSDocUnknownType */, pos); + var result = createNode(254 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(257 /* JSDocNullableType */, pos); + var result = createNode(258 /* JSDocNullableType */, pos); result.type = parseJSDocType(); return finishNode(result); } @@ -12132,7 +12280,7 @@ var ts; if (!tags) { return undefined; } - var result = createNode(267 /* JSDocComment */, start); + var result = createNode(268 /* JSDocComment */, start); result.tags = tags; return finishNode(result, end); } @@ -12169,7 +12317,7 @@ var ts; return undefined; } function handleUnknownTag(atToken, tagName) { - var result = createNode(268 /* JSDocTag */, atToken.pos); + var result = createNode(269 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result, pos); @@ -12220,7 +12368,7 @@ var ts; if (!typeExpression) { typeExpression = tryParseTypeExpression(); } - var result = createNode(269 /* JSDocParameterTag */, atToken.pos); + var result = createNode(270 /* JSDocParameterTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.preParameterName = preName; @@ -12230,27 +12378,27 @@ var ts; return finishNode(result, pos); } function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 270 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 271 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(270 /* JSDocReturnTag */, atToken.pos); + var result = createNode(271 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 271 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 272 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } - var result = createNode(271 /* JSDocTypeTag */, atToken.pos); + var result = createNode(272 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result, pos); } function handleTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 272 /* JSDocTemplateTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 273 /* JSDocTemplateTag */; })) { parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); } var typeParameters = []; @@ -12263,7 +12411,7 @@ var ts; parseErrorAtPosition(startPos, 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(137 /* TypeParameter */, name_8.pos); + var typeParameter = createNode(138 /* TypeParameter */, name_8.pos); typeParameter.name = name_8; finishNode(typeParameter, pos); typeParameters.push(typeParameter); @@ -12274,7 +12422,7 @@ var ts; pos++; } typeParameters.end = pos; - var result = createNode(272 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(273 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; @@ -12804,16 +12952,16 @@ var ts; function getModuleInstanceState(node) { // A module is uninstantiated if it contains only // 1. interface declarations, type alias declarations - if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 218 /* TypeAliasDeclaration */) { + if (node.kind === 218 /* InterfaceDeclaration */ || node.kind === 219 /* TypeAliasDeclaration */) { return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { + else if ((node.kind === 225 /* ImportDeclaration */ || node.kind === 224 /* ImportEqualsDeclaration */) && !(node.flags & 2 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 221 /* ModuleBlock */) { + else if (node.kind === 222 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -12832,7 +12980,7 @@ var ts; }); return state; } - else if (node.kind === 220 /* ModuleDeclaration */) { + else if (node.kind === 221 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -12882,6 +13030,11 @@ var ts; var labelStack; var labelIndexMap; var implicitLabels; + // state used for emit helpers + var hasClassExtends; + var hasAsyncFunctions; + var hasDecorators; + var hasParameterDecorators; // If this file is an external module, then it is automatically in strict-mode according to // ES6. If it is not an external module, then we'll determine if it is in strict mode or // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). @@ -12911,6 +13064,10 @@ var ts; labelStack = undefined; labelIndexMap = undefined; implicitLabels = undefined; + hasClassExtends = false; + hasAsyncFunctions = false; + hasDecorators = false; + hasParameterDecorators = false; } return bindSourceFile; function createSymbol(flags, name) { @@ -12933,7 +13090,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 220 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 221 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -12943,10 +13100,10 @@ var ts; // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 220 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */) { - return "\"" + node.name.text + "\""; + if (ts.isAmbientModule(node)) { + return ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + node.name.text + "\""; } - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression.kind)) { @@ -12958,21 +13115,21 @@ var ts; return node.name.text; } switch (node.kind) { - case 144 /* Constructor */: + case 145 /* Constructor */: return "__constructor"; - case 152 /* FunctionType */: - case 147 /* CallSignature */: + case 153 /* FunctionType */: + case 148 /* CallSignature */: return "__call"; - case 153 /* ConstructorType */: - case 148 /* ConstructSignature */: + case 154 /* ConstructorType */: + case 149 /* ConstructSignature */: return "__new"; - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: return "__index"; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return "__export"; - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: switch (ts.getSpecialPropertyAssignmentKind(node)) { case 2 /* ModuleExports */: // module.exports = ... @@ -12987,8 +13144,8 @@ var ts; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 215 /* FunctionDeclaration */: - case 216 /* ClassDeclaration */: + case 216 /* FunctionDeclaration */: + case 217 /* ClassDeclaration */: return node.flags & 512 /* Default */ ? "default" : undefined; } } @@ -13065,7 +13222,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 2 /* Export */; if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 232 /* ExportSpecifier */ || (node.kind === 223 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 233 /* ExportSpecifier */ || (node.kind === 224 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -13084,7 +13241,11 @@ var ts; // 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol, // but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way // when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope. - if (hasExportModifier || container.flags & 131072 /* ExportContext */) { + // NOTE: Nested ambient modules always should go to to 'locals' table to prevent their automatic merge + // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation + // and this case is specially handled. Module augmentations should only be merged with original module definition + // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. + if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 131072 /* ExportContext */)) { var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | (symbolFlags & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | (symbolFlags & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); @@ -13148,10 +13309,12 @@ var ts; var flags = node.flags; // reset all reachability check related flags on node (for incremental scenarios) flags &= ~1572864 /* ReachabilityCheckFlags */; - if (kind === 217 /* InterfaceDeclaration */) { + // reset all emit helper flags on node (for incremental scenarios) + flags &= ~62914560 /* EmitHelperFlags */; + if (kind === 218 /* InterfaceDeclaration */) { seenThisKeyword = false; } - var saveState = kind === 250 /* SourceFile */ || kind === 221 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); + var saveState = kind === 251 /* SourceFile */ || kind === 222 /* ModuleBlock */ || ts.isFunctionLikeKind(kind); if (saveState) { savedReachabilityState = currentReachabilityState; savedLabelStack = labelStack; @@ -13169,9 +13332,23 @@ var ts; flags |= 1048576 /* HasExplicitReturn */; } } - if (kind === 217 /* InterfaceDeclaration */) { + if (kind === 218 /* InterfaceDeclaration */) { flags = seenThisKeyword ? flags | 262144 /* ContainsThis */ : flags & ~262144 /* ContainsThis */; } + if (kind === 251 /* SourceFile */) { + if (hasClassExtends) { + flags |= 4194304 /* HasClassExtends */; + } + if (hasDecorators) { + flags |= 8388608 /* HasDecorators */; + } + if (hasParameterDecorators) { + flags |= 16777216 /* HasParamDecorators */; + } + if (hasAsyncFunctions) { + flags |= 33554432 /* HasAsyncFunctions */; + } + } node.flags = flags; if (saveState) { hasExplicitReturn = savedHasExplicitReturn; @@ -13194,40 +13371,40 @@ var ts; return; } switch (node.kind) { - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: bindWhileStatement(node); break; - case 199 /* DoStatement */: + case 200 /* DoStatement */: bindDoStatement(node); break; - case 201 /* ForStatement */: + case 202 /* ForStatement */: bindForStatement(node); break; - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 198 /* IfStatement */: + case 199 /* IfStatement */: bindIfStatement(node); break; - case 206 /* ReturnStatement */: - case 210 /* ThrowStatement */: + case 207 /* ReturnStatement */: + case 211 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 211 /* TryStatement */: + case 212 /* TryStatement */: bindTryStatement(node); break; - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: bindSwitchStatement(node); break; - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: bindCaseBlock(node); break; - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: bindLabeledStatement(node); break; default: @@ -13302,7 +13479,7 @@ var ts; function bindReturnOrThrow(n) { // bind expression (don't affect reachability) bind(n.expression); - if (n.kind === 206 /* ReturnStatement */) { + if (n.kind === 207 /* ReturnStatement */) { hasExplicitReturn = true; } currentReachabilityState = 4 /* Unreachable */; @@ -13311,7 +13488,7 @@ var ts; // call bind on label (don't affect reachability) bind(n.label); // for continue case touch label so it will be marked a used - var isValidJump = jumpToLabel(n.label, n.kind === 205 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); + var isValidJump = jumpToLabel(n.label, n.kind === 206 /* BreakStatement */ ? currentReachabilityState : 4 /* Unreachable */); if (isValidJump) { currentReachabilityState = 4 /* Unreachable */; } @@ -13337,7 +13514,7 @@ var ts; // bind expression (don't affect reachability) bind(n.expression); bind(n.caseBlock); - var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 244 /* DefaultClause */; }); + var hasDefault = ts.forEach(n.caseBlock.clauses, function (c) { return c.kind === 245 /* DefaultClause */; }); // post switch state is unreachable if switch is exaustive (has a default case ) and does not have fallthrough from the last case var postSwitchState = hasDefault && currentReachabilityState !== 2 /* Reachable */ ? 4 /* Unreachable */ : preSwitchState; popImplicitLabel(postSwitchLabel, postSwitchState); @@ -13364,37 +13541,37 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 155 /* TypeLiteral */: - case 167 /* ObjectLiteralExpression */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 156 /* TypeLiteral */: + case 168 /* ObjectLiteralExpression */: return 1 /* IsContainer */; - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 215 /* FunctionDeclaration */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 220 /* ModuleDeclaration */: - case 250 /* SourceFile */: - case 218 /* TypeAliasDeclaration */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 221 /* ModuleDeclaration */: + case 251 /* SourceFile */: + case 219 /* TypeAliasDeclaration */: return 5 /* IsContainerWithLocals */; - case 246 /* CatchClause */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 222 /* CaseBlock */: + case 247 /* CatchClause */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 223 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 194 /* Block */: + case 195 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Othewise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -13431,38 +13608,38 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 155 /* TypeLiteral */: - case 167 /* ObjectLiteralExpression */: - case 217 /* InterfaceDeclaration */: + case 156 /* TypeLiteral */: + case 168 /* ObjectLiteralExpression */: + case 218 /* InterfaceDeclaration */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 218 /* TypeAliasDeclaration */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 219 /* TypeAliasDeclaration */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -13483,11 +13660,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 250 /* SourceFile */ ? node : node.body; - if (body.kind === 250 /* SourceFile */ || body.kind === 221 /* ModuleBlock */) { + var body = node.kind === 251 /* SourceFile */ ? node : node.body; + if (body.kind === 251 /* SourceFile */ || body.kind === 222 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 230 /* ExportDeclaration */ || stat.kind === 229 /* ExportAssignment */) { + if (stat.kind === 231 /* ExportDeclaration */ || stat.kind === 230 /* ExportAssignment */) { return true; } } @@ -13506,7 +13683,10 @@ var ts; } function bindModuleDeclaration(node) { setExportContextFlag(node); - if (node.name.kind === 9 /* StringLiteral */) { + if (ts.isAmbientModule(node)) { + if (node.flags & 2 /* Export */) { + errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); + } declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); } else { @@ -13571,7 +13751,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */ || prop.kind === 143 /* MethodDeclaration */ + var currentKind = prop.kind === 248 /* PropertyAssignment */ || prop.kind === 249 /* ShorthandPropertyAssignment */ || prop.kind === 144 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen[identifier.text]; @@ -13593,10 +13773,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -13756,17 +13936,17 @@ var ts; } function updateStrictMode(node) { switch (node.kind) { - case 250 /* SourceFile */: - case 221 /* ModuleBlock */: + case 251 /* SourceFile */: + case 222 /* ModuleBlock */: updateStrictModeStatementList(node.statements); return; - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionLike(node.parent)) { updateStrictModeStatementList(node.statements); } return; - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return; @@ -13796,7 +13976,7 @@ var ts; /* Strict mode checks */ case 69 /* Identifier */: return checkStrictModeIdentifier(node); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: if (ts.isInJavaScriptFile(node)) { var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { @@ -13820,100 +14000,97 @@ var ts; } } return checkStrictModeBinaryExpression(node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return checkStrictModeCatchClause(node); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return checkStrictModeWithStatement(node); - case 161 /* ThisType */: + case 162 /* ThisType */: seenThisKeyword = true; return; - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return checkTypePredicate(node); - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); - case 138 /* Parameter */: + case 139 /* Parameter */: return bindParameter(node); - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: return bindVariableDeclarationOrBindingElement(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); - case 247 /* PropertyAssignment */: - case 248 /* ShorthandPropertyAssignment */: + case 248 /* PropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 215 /* FunctionDeclaration */: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); - case 144 /* Constructor */: + case 216 /* FunctionDeclaration */: + return bindFunctionDeclaration(node); + case 145 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 145 /* GetAccessor */: + case 146 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 146 /* SetAccessor */: + case 147 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - checkStrictModeFunctionName(node); - var bindingName = node.name ? node.name.text : "__function"; - return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); - case 170 /* CallExpression */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + return bindFunctionExpression(node); + case 171 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: return bindClassLikeDeclaration(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792960 /* InterfaceExcludes */); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Imports and exports - case 223 /* ImportEqualsDeclaration */: - case 226 /* NamespaceImport */: - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 227 /* NamespaceImport */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 225 /* ImportClause */: + case 226 /* ImportClause */: return bindImportClause(node); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return bindExportDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return bindExportAssignment(node); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return bindSourceFileIfExternalModule(); } } @@ -13922,7 +14099,7 @@ var ts; if (parameterName && parameterName.kind === 69 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 161 /* ThisType */) { + if (parameterName && parameterName.kind === 162 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -13937,7 +14114,7 @@ var ts; bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\""); } function bindExportAssignment(node) { - var boundExpression = node.kind === 229 /* ExportAssignment */ ? node.expression : node.right; + var boundExpression = node.kind === 230 /* ExportAssignment */ ? node.expression : node.right; if (!container.symbol || !container.symbol.exports) { // Export assignment in some sort of block construct bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); @@ -13985,7 +14162,7 @@ var ts; } function bindThisPropertyAssignment(node) { // Declare a 'member' in case it turns out the container was an ES5 class - if (container.kind === 175 /* FunctionExpression */ || container.kind === 215 /* FunctionDeclaration */) { + if (container.kind === 176 /* FunctionExpression */ || container.kind === 216 /* FunctionDeclaration */) { container.symbol.members = container.symbol.members || {}; declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } @@ -14014,7 +14191,15 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 216 /* ClassDeclaration */) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.getClassExtendsHeritageClauseElement(node) !== undefined) { + hasClassExtends = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } + if (node.kind === 217 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -14076,6 +14261,12 @@ var ts; } } function bindParameter(node) { + if (!ts.isDeclarationFile(file) && + !ts.isInAmbientContext(node) && + ts.nodeIsDecorated(node)) { + hasDecorators = true; + hasParameterDecorators = true; + } if (inStrictMode) { // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) @@ -14094,7 +14285,34 @@ var ts; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } } + function bindFunctionDeclaration(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); + } + function bindFunctionExpression(node) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.text : "__function"; + return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); + } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + if (!ts.isDeclarationFile(file) && !ts.isInAmbientContext(node)) { + if (ts.isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + if (ts.nodeIsDecorated(node)) { + hasDecorators = true; + } + } return ts.hasDynamicName(node) ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); @@ -14159,13 +14377,13 @@ var ts; case 4 /* Unreachable */: var reportError = // report error on all statements except empty ones - (ts.isStatement(node) && node.kind !== 196 /* EmptyStatement */) || + (ts.isStatement(node) && node.kind !== 197 /* EmptyStatement */) || // report error on class declarations - node.kind === 216 /* ClassDeclaration */ || + node.kind === 217 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 220 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 221 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 219 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 220 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentReachabilityState = 8 /* ReportedUnreachable */; // unreachable code is reported if @@ -14179,7 +14397,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !ts.isInAmbientContext(node) && - (node.kind !== 195 /* VariableStatement */ || + (node.kind !== 196 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 24576 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -14264,6 +14482,7 @@ var ts; getTypeCount: function () { return typeCount; }, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, // The language service will always care about the narrowed type of a symbol, because that is @@ -14280,6 +14499,7 @@ var ts; getSymbolsInScope: getSymbolsInScope, getSymbolAtLocation: getSymbolAtLocation, getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, + getExportSpecifierLocalTargetSymbol: getExportSpecifierLocalTargetSymbol, getTypeAtLocation: getTypeOfNode, typeToString: typeToString, getSymbolDisplayBuilder: getSymbolDisplayBuilder, @@ -14355,11 +14575,6 @@ var ts; var unionTypes = {}; var intersectionTypes = {}; var stringLiteralTypes = {}; - var emitExtends = false; - var emitDecorate = false; - var emitParam = false; - var emitAwaiter = false; - var emitGenerator = false; var resolutionTargets = []; var resolutionResults = []; var resolutionPropertyNames = []; @@ -14504,7 +14719,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 220 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 220 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 221 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 221 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -14559,6 +14774,30 @@ var ts; } } } + function mergeModuleAugmentation(moduleName) { + var moduleAugmentation = moduleName.parent; + if (moduleAugmentation.symbol.valueDeclaration !== moduleAugmentation) { + // this is a combined symbol for multiple augmentations within the same file. + // its symbol already has accumulated information for all declarations + // so we need to add it just once - do the work only for first declaration + ts.Debug.assert(moduleAugmentation.symbol.declarations.length > 1); + return; + } + if (ts.isGlobalScopeAugmentation(moduleAugmentation)) { + mergeSymbolTable(globals, moduleAugmentation.symbol.exports); + } + else { + // find a module that about to be augmented + var mainModule = resolveExternalModuleNameWorker(moduleName, moduleName, ts.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found); + if (!mainModule) { + return; + } + // if module symbol has already been merged - it is safe to use it. + // otherwise clone it + mainModule = mainModule.flags & 33554432 /* Merged */ ? mainModule : cloneSymbol(mainModule); + mergeSymbol(mainModule, moduleAugmentation.symbol); + } + } function addToSymbolTable(target, source, message) { for (var id in source) { if (ts.hasProperty(source, id)) { @@ -14585,18 +14824,8 @@ var ts; var nodeId = getNodeId(node); return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } - function getSourceFile(node) { - return ts.getAncestor(node, 250 /* SourceFile */); - } function isGlobalSourceFile(node) { - return node.kind === 250 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); - } - /** Is this type one of the apparent types created from the primitive types. */ - function isPrimitiveApparentType(type) { - return type === globalStringType || - type === globalNumberType || - type === globalBooleanType || - type === globalESSymbolType; + return node.kind === 251 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -14645,7 +14874,7 @@ var ts; if (declaration.pos <= usage.pos) { // declaration is before usage // still might be illegal if usage is in the initializer of the variable declaration - return declaration.kind !== 213 /* VariableDeclaration */ || + return declaration.kind !== 214 /* VariableDeclaration */ || !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } // declaration is after usage @@ -14653,14 +14882,14 @@ var ts; return isUsedInFunctionOrNonStaticProperty(declaration, usage); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); - if (declaration.parent.parent.kind === 195 /* VariableStatement */ || - declaration.parent.parent.kind === 201 /* ForStatement */) { + if (declaration.parent.parent.kind === 196 /* VariableStatement */ || + declaration.parent.parent.kind === 202 /* ForStatement */) { // variable statement/for statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) return isSameScopeDescendentOf(usage, declaration, container); } - else if (declaration.parent.parent.kind === 203 /* ForOfStatement */ || - declaration.parent.parent.kind === 202 /* ForInStatement */) { + else if (declaration.parent.parent.kind === 204 /* ForOfStatement */ || + declaration.parent.parent.kind === 203 /* ForInStatement */) { // ForIn/ForOf case - use site should not be used in expression part var expression = declaration.parent.parent.expression; return isSameScopeDescendentOf(usage, expression, container); @@ -14677,7 +14906,7 @@ var ts; return true; } var initializerOfNonStaticProperty = current.parent && - current.parent.kind === 141 /* PropertyDeclaration */ && + current.parent.kind === 142 /* PropertyDeclaration */ && (current.parent.flags & 64 /* Static */) === 0 && current.parent.initializer === current; if (initializerOfNonStaticProperty) { @@ -14710,8 +14939,8 @@ var ts; if (meaning & result.flags & 793056 /* Type */) { useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || - lastLocation.kind === 138 /* Parameter */ || - lastLocation.kind === 137 /* TypeParameter */ + lastLocation.kind === 139 /* Parameter */ || + lastLocation.kind === 138 /* TypeParameter */ : false; } if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { @@ -14720,9 +14949,9 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 138 /* Parameter */ || + lastLocation.kind === 139 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 138 /* Parameter */); + result.valueDeclaration.kind === 139 /* Parameter */); } } if (useResult) { @@ -14734,13 +14963,12 @@ var ts; } } switch (location.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 250 /* SourceFile */ || - (location.kind === 220 /* ModuleDeclaration */ && location.name.kind === 9 /* StringLiteral */)) { + if (location.kind === 251 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports["default"]) { @@ -14763,7 +14991,7 @@ var ts; // which is not the desired behavior. if (ts.hasProperty(moduleExports, name) && moduleExports[name].flags === 8388608 /* Alias */ && - ts.getDeclarationOfKind(moduleExports[name], 232 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExports[name], 233 /* ExportSpecifier */)) { break; } } @@ -14771,13 +14999,13 @@ var ts; break loop; } break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -14794,9 +15022,9 @@ var ts; } } break; - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { if (lastLocation && lastLocation.flags & 64 /* Static */) { // TypeScript 1.0 spec (April 2014): 3.4.1 @@ -14807,7 +15035,7 @@ var ts; } break loop; } - if (location.kind === 188 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 189 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.text) { result = location.symbol; @@ -14823,9 +15051,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 217 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 218 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -14833,19 +15061,19 @@ var ts; } } break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 175 /* FunctionExpression */: + case 176 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -14858,7 +15086,7 @@ var ts; } } break; - case 139 /* Decorator */: + case 140 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -14867,7 +15095,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 138 /* Parameter */) { + if (location.parent && location.parent.kind === 139 /* Parameter */) { location = location.parent; } // @@ -14889,7 +15117,9 @@ var ts; } if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + if (!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg)) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + } } return undefined; } @@ -14922,12 +15152,44 @@ var ts; } return result; } + function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { + if (!errorLocation || (errorLocation.kind === 69 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + return false; + } + var container = ts.getThisContainer(errorLocation, /* includeArrowFunctions */ true); + var location = container; + while (location) { + if (ts.isClassLike(location.parent)) { + var classSymbol = getSymbolOfNode(location.parent); + if (!classSymbol) { + break; + } + // Check to see if a static member exists. + var constructorType = getTypeOfSymbol(classSymbol); + if (getPropertyOfType(constructorType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg), symbolToString(classSymbol)); + return true; + } + // No static member is present. + // Check if we're in an instance method and look for a relevant instance member. + if (location === container && !(location.flags & 64 /* Static */)) { + var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; + if (getPropertyOfType(instanceType, name)) { + error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); + return true; + } + } + } + location = location.parent; + } + return false; + } function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); // Block-scoped variables cannot be used before their definition var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 213 /* VariableDeclaration */), errorLocation)) { + if (!isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 214 /* VariableDeclaration */), errorLocation)) { error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } @@ -14948,10 +15210,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 223 /* ImportEqualsDeclaration */) { + if (node.kind === 224 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 224 /* ImportDeclaration */) { + while (node && node.kind !== 225 /* ImportDeclaration */) { node = node.parent; } return node; @@ -14961,7 +15223,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 234 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 235 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -15063,17 +15325,17 @@ var ts; } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 225 /* ImportClause */: + case 226 /* ImportClause */: return getTargetOfImportClause(node); - case 226 /* NamespaceImport */: + case 227 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 228 /* ImportSpecifier */: + case 229 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 232 /* ExportSpecifier */: + case 233 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } @@ -15118,11 +15380,11 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 229 /* ExportAssignment */) { + if (node.kind === 230 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 232 /* ExportSpecifier */) { + else if (node.kind === 233 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -15135,7 +15397,7 @@ var ts; // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 223 /* ImportEqualsDeclaration */); + importDeclaration = ts.getAncestor(entityName, 224 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, @@ -15148,13 +15410,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 69 /* Identifier */ || entityName.parent.kind === 135 /* QualifiedName */) { + if (entityName.kind === 69 /* Identifier */ || entityName.parent.kind === 136 /* QualifiedName */) { return resolveEntityName(entityName, 1536 /* Namespace */); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 223 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 224 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } @@ -15174,9 +15436,9 @@ var ts; return undefined; } } - else if (name.kind === 135 /* QualifiedName */ || name.kind === 168 /* PropertyAccessExpression */) { - var left = name.kind === 135 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 135 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 136 /* QualifiedName */ || name.kind === 169 /* PropertyAccessExpression */) { + var left = name.kind === 136 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 136 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1536 /* Namespace */, ignoreErrors); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; @@ -15196,6 +15458,9 @@ var ts; return symbol.flags & meaning ? symbol : resolveAlias(symbol); } function resolveExternalModuleName(location, moduleReferenceExpression) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + } + function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError) { if (moduleReferenceExpression.kind !== 9 /* StringLiteral */) { return; } @@ -15210,19 +15475,28 @@ var ts; if (!isRelative) { var symbol = getSymbol(globals, "\"" + moduleName + "\"", 512 /* ValueModule */); if (symbol) { - return symbol; + // merged symbol is module declaration symbol combined with all augmentations + return getMergedSymbol(symbol); } } - var resolvedModule = ts.getResolvedModule(getSourceFile(location), moduleReferenceLiteral.text); + var resolvedModule = ts.getResolvedModule(ts.getSourceFileOfNode(location), moduleReferenceLiteral.text); var sourceFile = resolvedModule && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - return sourceFile.symbol; + // merged symbol is module declaration symbol combined with all augmentations + return getMergedSymbol(sourceFile.symbol); } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); - return; + if (moduleNotFoundError) { + // report errors only if it was requested + error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + } + return undefined; } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); + if (moduleNotFoundError) { + // report errors only if it was requested + error(moduleReferenceLiteral, moduleNotFoundError, moduleName); + } + return undefined; } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. @@ -15350,7 +15624,7 @@ var ts; var members = node.members; for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { var member = members_1[_i]; - if (member.kind === 144 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 145 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -15421,17 +15695,17 @@ var ts; } } switch (location_1.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location_1)) { break; } - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -15472,7 +15746,7 @@ var ts; return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=" - && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) { + && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233 /* ExportSpecifier */)) { if (!useOnlyExternalAliasing || // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { @@ -15509,7 +15783,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 232 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 233 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -15582,8 +15856,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 220 /* ModuleDeclaration */ && declaration.name.kind === 9 /* StringLiteral */) || - (declaration.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 251 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -15619,12 +15892,12 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 154 /* TypeQuery */) { + if (entityName.parent.kind === 155 /* TypeQuery */) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 135 /* QualifiedName */ || entityName.kind === 168 /* PropertyAccessExpression */ || - entityName.parent.kind === 223 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 136 /* QualifiedName */ || entityName.kind === 169 /* PropertyAccessExpression */ || + entityName.parent.kind === 224 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1536 /* Namespace */; @@ -15679,15 +15952,20 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 160 /* ParenthesizedType */) { + while (node.kind === 161 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 218 /* TypeAliasDeclaration */) { + if (node.kind === 219 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } return undefined; } + function isTopLevelInExternalModuleAugmentation(node) { + return node && node.parent && + node.parent.kind === 222 /* ModuleBlock */ && + ts.isExternalModuleAugmentation(node.parent.parent); + } function getSymbolDisplayBuilder() { function getNameOfSymbol(symbol) { if (symbol.declarations && symbol.declarations.length) { @@ -15696,10 +15974,10 @@ var ts; return ts.declarationNameToString(declaration.name); } switch (declaration.kind) { - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return "(Anonymous class)"; - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return "(Anonymous function)"; } } @@ -15954,7 +16232,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 250 /* SourceFile */ || declaration.parent.kind === 221 /* ModuleBlock */; + return declaration.parent.kind === 251 /* SourceFile */ || declaration.parent.kind === 222 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -16215,70 +16493,74 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 165 /* BindingElement */: + case 166 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // Otherwise fall through - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 215 /* FunctionDeclaration */: - case 219 /* EnumDeclaration */: - case 223 /* ImportEqualsDeclaration */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 216 /* FunctionDeclaration */: + case 220 /* EnumDeclaration */: + case 224 /* ImportEqualsDeclaration */: + // external module augmentation is always visible + if (ts.isExternalModuleAugmentation(node)) { + return true; + } var parent_4 = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedNodeFlags(node) & 2 /* Export */) && - !(node.kind !== 223 /* ImportEqualsDeclaration */ && parent_4.kind !== 250 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { + !(node.kind !== 224 /* ImportEqualsDeclaration */ && parent_4.kind !== 251 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { return isGlobalSourceFile(parent_4); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent_4); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.flags & (16 /* Private */ | 32 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so const it fall into next case statement - case 144 /* Constructor */: - case 148 /* ConstructSignature */: - case 147 /* CallSignature */: - case 149 /* IndexSignature */: - case 138 /* Parameter */: - case 221 /* ModuleBlock */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 155 /* TypeLiteral */: - case 151 /* TypeReference */: - case 156 /* ArrayType */: - case 157 /* TupleType */: - case 158 /* UnionType */: - case 159 /* IntersectionType */: - case 160 /* ParenthesizedType */: + case 145 /* Constructor */: + case 149 /* ConstructSignature */: + case 148 /* CallSignature */: + case 150 /* IndexSignature */: + case 139 /* Parameter */: + case 222 /* ModuleBlock */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 156 /* TypeLiteral */: + case 152 /* TypeReference */: + case 157 /* ArrayType */: + case 158 /* TupleType */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: + case 161 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: - case 228 /* ImportSpecifier */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: + case 229 /* ImportSpecifier */: return false; // Type parameters are always visible - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: // Source file is always visible - case 250 /* SourceFile */: + case 251 /* SourceFile */: return true; // Export assignments do not create name bindings outside the module - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -16287,10 +16569,10 @@ var ts; } function collectLinkedAliases(node) { var exportSymbol; - if (node.parent && node.parent.kind === 229 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 230 /* ExportAssignment */) { exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 232 /* ExportSpecifier */) { + else if (node.parent.kind === 233 /* ExportSpecifier */) { var exportSpecifier = node.parent; exportSymbol = exportSpecifier.parent.parent.moduleSpecifier ? getExternalModuleMember(exportSpecifier.parent.parent, exportSpecifier) : @@ -16313,7 +16595,9 @@ var ts; var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); - buildVisibleNodeList(importSymbol.declarations); + if (importSymbol) { + buildVisibleNodeList(importSymbol.declarations); + } } }); } @@ -16382,14 +16666,14 @@ var ts; node = ts.getRootDeclaration(node); // Parent chain: // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' - return node.kind === 213 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; + return node.kind === 214 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { // TypeScript 1.0 spec (April 2014): 8.4 // Every class automatically contains a static property member named 'prototype', // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. // It is an error to explicitly declare a static property member with the name 'prototype'. - var classType = getDeclaredTypeOfSymbol(prototype.parent); + var classType = getDeclaredTypeOfSymbol(getMergedSymbol(prototype.parent)); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } // Return the type of the given property in the given type, or undefined if no such property exists @@ -16413,7 +16697,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return name.text; - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: if (ts.isStringOrNumericLiteral(name.expression.kind)) { return name.expression.text; } @@ -16421,7 +16705,7 @@ var ts; return undefined; } function isComputedNonLiteralName(name) { - return name.kind === 136 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression.kind); + return name.kind === 137 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression.kind); } // Return the inferred type for a binding element function getTypeForBindingElement(declaration) { @@ -16441,7 +16725,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 163 /* ObjectBindingPattern */) { + if (pattern.kind === 164 /* ObjectBindingPattern */) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_10 = declaration.propertyName || declaration.name; if (isComputedNonLiteralName(name_10)) { @@ -16489,11 +16773,11 @@ var ts; } // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration) { - // A variable declared in a for..in statement is always of type any - if (declaration.parent.parent.kind === 202 /* ForInStatement */) { - return anyType; + // A variable declared in a for..in statement is always of type string + if (declaration.parent.parent.kind === 203 /* ForInStatement */) { + return stringType; } - if (declaration.parent.parent.kind === 203 /* ForOfStatement */) { + if (declaration.parent.parent.kind === 204 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -16507,11 +16791,11 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138 /* Parameter */) { + if (declaration.kind === 139 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 146 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 145 /* GetAccessor */); + if (func.kind === 147 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 146 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -16527,7 +16811,7 @@ var ts; return checkExpressionCached(declaration.initializer); } // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 248 /* ShorthandPropertyAssignment */) { + if (declaration.kind === 249 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } // If the declaration specifies a binding pattern, use the type implied by the binding pattern @@ -16583,7 +16867,7 @@ var ts; return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType; } // If the pattern has at least one element, and no rest element, then it should imply a tuple type. - var elementTypes = ts.map(elements, function (e) { return e.kind === 189 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); + var elementTypes = ts.map(elements, function (e) { return e.kind === 190 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType); }); if (includePatternInType) { var result = createNewTupleType(elementTypes); result.pattern = pattern; @@ -16599,7 +16883,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType) { - return pattern.kind === 163 /* ObjectBindingPattern */ + return pattern.kind === 164 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType) : getTypeFromArrayBindingPattern(pattern, includePatternInType); } @@ -16621,10 +16905,10 @@ var ts; // During a normal type check we'll never get to here with a property assignment (the check of the containing // object literal uses a different path). We exclude widening only so that language services and type verification // tools see the actual type. - if (declaration.kind === 247 /* PropertyAssignment */) { + if (declaration.kind === 248 /* PropertyAssignment */) { return type; } - if (type.flags & 134217728 /* PredicateType */ && (declaration.kind === 141 /* PropertyDeclaration */ || declaration.kind === 140 /* PropertySignature */)) { + if (type.flags & 134217728 /* PredicateType */ && (declaration.kind === 142 /* PropertyDeclaration */ || declaration.kind === 141 /* PropertySignature */)) { return type; } return getWidenedType(type); @@ -16634,7 +16918,7 @@ var ts; // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && compilerOptions.noImplicitAny) { var root = ts.getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 138 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 139 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -16649,21 +16933,21 @@ var ts; } // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 246 /* CatchClause */) { + if (declaration.parent.kind === 247 /* CatchClause */) { return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 229 /* ExportAssignment */) { + if (declaration.kind === 230 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } // Handle module.exports = expr - if (declaration.kind === 183 /* BinaryExpression */) { + if (declaration.kind === 184 /* BinaryExpression */) { return links.type = checkExpression(declaration.right); } - if (declaration.kind === 168 /* PropertyAccessExpression */) { + if (declaration.kind === 169 /* PropertyAccessExpression */) { // Declarations only exist for property access expressions for certain // special assignment kinds - if (declaration.parent.kind === 183 /* BinaryExpression */) { + if (declaration.parent.kind === 184 /* BinaryExpression */) { // Handle exports.p = expr or this.p = expr or className.prototype.method = expr return links.type = checkExpressionCached(declaration.parent.right); } @@ -16693,7 +16977,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 145 /* GetAccessor */) { + if (accessor.kind === 146 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -16709,8 +16993,8 @@ var ts; if (!pushTypeResolution(symbol, 0 /* Type */)) { return unknownType; } - var getter = ts.getDeclarationOfKind(symbol, 145 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 146 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 146 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 147 /* SetAccessor */); var type; // First try to see if the user specified a return type on the get-accessor. var getterReturnType = getAnnotatedAccessorType(getter); @@ -16739,7 +17023,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 145 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 146 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -16839,9 +17123,9 @@ var ts; if (!node) { return typeParameters; } - if (node.kind === 216 /* ClassDeclaration */ || node.kind === 188 /* ClassExpression */ || - node.kind === 215 /* FunctionDeclaration */ || node.kind === 175 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */ || node.kind === 176 /* ArrowFunction */) { + if (node.kind === 217 /* ClassDeclaration */ || node.kind === 189 /* ClassExpression */ || + node.kind === 216 /* FunctionDeclaration */ || node.kind === 176 /* FunctionExpression */ || + node.kind === 144 /* MethodDeclaration */ || node.kind === 177 /* ArrowFunction */) { var declarations = node.typeParameters; if (declarations) { return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); @@ -16851,7 +17135,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 218 /* InterfaceDeclaration */); return appendOuterTypeParameters(undefined, declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -16860,8 +17144,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 217 /* InterfaceDeclaration */ || node.kind === 216 /* ClassDeclaration */ || - node.kind === 188 /* ClassExpression */ || node.kind === 218 /* TypeAliasDeclaration */) { + if (node.kind === 218 /* InterfaceDeclaration */ || node.kind === 217 /* ClassDeclaration */ || + node.kind === 189 /* ClassExpression */ || node.kind === 219 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -17001,7 +17285,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 218 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -17033,7 +17317,7 @@ var ts; function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 217 /* InterfaceDeclaration */) { + if (declaration.kind === 218 /* InterfaceDeclaration */) { if (declaration.flags & 262144 /* ContainsThis */) { return false; } @@ -17089,7 +17373,7 @@ var ts; if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) { return unknownType; } - var declaration = ts.getDeclarationOfKind(symbol, 218 /* TypeAliasDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 219 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (popTypeResolution()) { links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -17122,7 +17406,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */).constraint) { + if (!ts.getDeclarationOfKind(symbol, 138 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -17178,11 +17462,11 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: return true; - case 156 /* ArrayType */: + case 157 /* ArrayType */: return isIndependentType(node.elementType); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return isIndependentTypeReference(node); } return false; @@ -17195,7 +17479,7 @@ var ts; // A function-like declaration is considered independent (free of this references) if it has a return type // annotation that is considered independent and if each parameter is considered independent. function isIndependentFunctionLikeDeclaration(node) { - if (node.kind !== 144 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { + if (node.kind !== 145 /* Constructor */ && (!node.type || !isIndependentType(node.type))) { return false; } for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { @@ -17216,12 +17500,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return isIndependentVariableLikeDeclaration(declaration); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: return isIndependentFunctionLikeDeclaration(declaration); } } @@ -17783,7 +18067,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 144 /* Constructor */ ? + var classType = declaration.kind === 145 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : @@ -17800,7 +18084,7 @@ var ts; paramSymbol = resolvedSymbol; } parameters.push(paramSymbol); - if (param.type && param.type.kind === 162 /* StringLiteralType */) { + if (param.type && param.type.kind === 163 /* StringLiteralType */) { hasStringLiterals = true; } if (param.initializer || param.questionToken || param.dotDotDotToken) { @@ -17826,8 +18110,8 @@ var ts; else { // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 145 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 146 /* SetAccessor */); + if (declaration.kind === 146 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 147 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -17845,19 +18129,19 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -17944,7 +18228,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 144 /* Constructor */ || signature.declaration.kind === 148 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 145 /* Constructor */ || signature.declaration.kind === 149 /* ConstructSignature */; var type = createObjectType(65536 /* Anonymous */ | 262144 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -17981,7 +18265,7 @@ var ts; : undefined; } function getConstraintDeclaration(type) { - return ts.getDeclarationOfKind(type.symbol, 137 /* TypeParameter */).constraint; + return ts.getDeclarationOfKind(type.symbol, 138 /* TypeParameter */).constraint; } function hasConstraintReferenceTo(type, target) { var checked; @@ -18014,7 +18298,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 137 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 138 /* TypeParameter */).parent); } function getTypeListId(types) { if (types) { @@ -18113,7 +18397,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { // We only support expressions that are simple qualified names. For other expressions this produces undefined. - var typeNameOrExpression = node.kind === 151 /* TypeReference */ ? node.typeName : + var typeNameOrExpression = node.kind === 152 /* TypeReference */ ? node.typeName : ts.isSupportedExpressionWithTypeArguments(node) ? node.expression : undefined; var symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, 793056 /* Type */) || unknownSymbol; @@ -18145,9 +18429,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: return declaration; } } @@ -18388,9 +18672,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 217 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 218 /* InterfaceDeclaration */)) { if (!(container.flags & 64 /* Static */) && - (container.kind !== 144 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) { + (container.kind !== 145 /* Constructor */ || ts.isNodeDescendentOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -18434,36 +18718,36 @@ var ts; return esSymbolType; case 103 /* VoidKeyword */: return voidType; - case 161 /* ThisType */: + case 162 /* ThisType */: return getTypeFromThisTypeNode(node); - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: return getTypeFromStringLiteralTypeNode(node); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return getTypeFromTypeReference(node); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return getTypeFromPredicateTypeNode(node); - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 157 /* TupleType */: + case 158 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 158 /* UnionType */: + case 159 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 159 /* IntersectionType */: + case 160 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return getTypeFromTypeNode(node.type); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 155 /* TypeLiteral */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 156 /* TypeLiteral */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 69 /* Identifier */: - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -18654,27 +18938,27 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return node.operatorToken.kind === 52 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 247 /* PropertyAssignment */: + case 248 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -18703,6 +18987,9 @@ var ts; function compareTypesIdentical(source, target) { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? -1 /* True */ : 0 /* False */; } + function compareTypesAssignable(source, target) { + return checkTypeRelatedTo(source, target, assignableRelation, /*errorNode*/ undefined) ? -1 /* True */ : 0 /* False */; + } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined); } @@ -18715,47 +19002,60 @@ var ts; function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + return compareSignaturesRelated(source, target, ignoreReturnTypes, /*reportErrors*/ false, /*errorReporter*/ undefined, compareTypesAssignable) !== 0 /* False */; + } /** * See signatureRelatedTo, compareSignaturesIdentical */ - function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + function compareSignaturesRelated(source, target, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) { // TODO (drosen): De-duplicate code between related functions. if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } // Spec 1.0 Section 3.8.3 & 3.8.4: // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; var sourceMax = getNumNonRestParameters(source); var targetMax = getNumNonRestParameters(target); var checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + var sourceParams = source.parameters; + var targetParams = target.parameters; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + var s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); + var t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); + var related = compareTypes(t, s, /*reportErrors*/ false) || compareTypes(s, t, reportErrors); if (!related) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); + } + return 0 /* False */; } + result &= related; } if (!ignoreReturnTypes) { var targetReturnType = getReturnTypeOfSignature(target); if (targetReturnType === voidType) { - return true; + return result; } var sourceReturnType = getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { - return false; + if (reportErrors) { + errorReporter(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); + } + return 0 /* False */; } } - return isTypeAssignableTo(sourceReturnType, targetReturnType); + result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); } - return true; + return result; } function isImplementationCompatibleWithOverload(implementation, overload) { var erasedSource = getErasedSignature(implementation); @@ -18812,22 +19112,12 @@ var ts; var expandingFlags; var depth = 0; var overflow = false; - var elaborateErrors = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); + var result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { - // If we already computed this relation, but in a context where we didn't want to report errors (e.g. overload resolution), - // then we'll only have a top-level error (e.g. 'Class X does not implement interface Y') without any details. If this happened, - // request a recompuation to get a complete error message. This will be skipped if we've already done this computation in a context - // where errors were being reported. - if (errorInfo.next === undefined) { - errorInfo = undefined; - elaborateErrors = true; - isRelatedTo(source, target, errorNode !== undefined, headMessage); - } if (containingMessageChain) { errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); } @@ -18835,6 +19125,7 @@ var ts; } return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { + ts.Debug.assert(!!errorNode); errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } function reportRelationError(message, source, target) { @@ -18973,14 +19264,14 @@ var ts; } // Even if relationship doesn't hold for unions, intersections, or generic type references, // it may hold in a structural comparison. - var apparentType = getApparentType(source); + var apparentSource = getApparentType(source); // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates // to X. Failing both of those we want to check if the aggregation of A and B's members structurally // relates to X. Thus, we include intersection types on the source side here. - if (apparentType.flags & (80896 /* ObjectType */ | 32768 /* Intersection */) && target.flags & 80896 /* ObjectType */) { + if (apparentSource.flags & (80896 /* ObjectType */ | 32768 /* Intersection */) && target.flags & 80896 /* ObjectType */) { // Report structural errors only if we haven't reported any errors yet - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & 16777726 /* Primitive */); + if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } @@ -19043,6 +19334,7 @@ var ts; // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. + ts.Debug.assert(!!errorNode); errorNode = prop.valueDeclaration; reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); } @@ -19140,7 +19432,7 @@ var ts; var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; if (related !== undefined) { - if (elaborateErrors && related === 2 /* Failed */) { + if (reportErrors && related === 2 /* Failed */) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. relation[id] = 3 /* FailedAndReported */; @@ -19354,7 +19646,7 @@ var ts; } // don't elaborate the primitive apparent types (like Number) // because the actual primitives will have already been reported. - if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + if (shouldElaborateErrors) { reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); } return 0 /* False */; @@ -19363,72 +19655,10 @@ var ts; return result; } /** - * See signatureAssignableTo, signatureAssignableTo + * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source, target, reportErrors) { - // TODO (drosen): De-duplicate code between related functions. - if (source === target) { - return -1 /* True */; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return 0 /* False */; - } - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var checkCount; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - // Spec 1.0 Section 3.8.3 & 3.8.4: - // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N - source = getErasedSignature(source); - target = getErasedSignature(target); - var result = -1 /* True */; - for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); - if (!related) { - related = isRelatedTo(t, s, /*reportErrors*/ false); - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); - } - return 0 /* False */; - } - errorInfo = saveErrorInfo; - } - result &= related; - } - var targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) { - return result; - } - var sourceReturnType = getReturnTypeOfSignature(source); - // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions - if (targetReturnType.flags & 134217728 /* PredicateType */ && targetReturnType.predicate.kind === 1 /* Identifier */) { - if (!(sourceReturnType.flags & 134217728 /* PredicateType */)) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0 /* False */; - } - } - return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); + return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -19844,22 +20074,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 138 /* Parameter */: + case 139 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -20196,10 +20426,10 @@ var ts; // The expression is restricted to a single identifier or a sequence of identifiers separated by periods while (node) { switch (node.kind) { - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return true; case 69 /* Identifier */: - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: node = node.parent; continue; default: @@ -20241,55 +20471,55 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: - case 166 /* ArrayLiteralExpression */: - case 167 /* ObjectLiteralExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: - case 174 /* ParenthesizedExpression */: - case 181 /* PrefixUnaryExpression */: - case 177 /* DeleteExpression */: - case 180 /* AwaitExpression */: - case 178 /* TypeOfExpression */: - case 179 /* VoidExpression */: - case 182 /* PostfixUnaryExpression */: - case 186 /* YieldExpression */: - case 184 /* ConditionalExpression */: - case 187 /* SpreadElementExpression */: - case 194 /* Block */: - case 195 /* VariableStatement */: - case 197 /* ExpressionStatement */: - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 206 /* ReturnStatement */: - case 207 /* WithStatement */: - case 208 /* SwitchStatement */: - case 243 /* CaseClause */: - case 244 /* DefaultClause */: - case 209 /* LabeledStatement */: - case 210 /* ThrowStatement */: - case 211 /* TryStatement */: - case 246 /* CatchClause */: - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: - case 240 /* JsxAttribute */: - case 241 /* JsxSpreadAttribute */: - case 237 /* JsxOpeningElement */: - case 242 /* JsxExpression */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: + case 167 /* ArrayLiteralExpression */: + case 168 /* ObjectLiteralExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: + case 175 /* ParenthesizedExpression */: + case 182 /* PrefixUnaryExpression */: + case 178 /* DeleteExpression */: + case 181 /* AwaitExpression */: + case 179 /* TypeOfExpression */: + case 180 /* VoidExpression */: + case 183 /* PostfixUnaryExpression */: + case 187 /* YieldExpression */: + case 185 /* ConditionalExpression */: + case 188 /* SpreadElementExpression */: + case 195 /* Block */: + case 196 /* VariableStatement */: + case 198 /* ExpressionStatement */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 207 /* ReturnStatement */: + case 208 /* WithStatement */: + case 209 /* SwitchStatement */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: + case 210 /* LabeledStatement */: + case 211 /* ThrowStatement */: + case 212 /* TryStatement */: + case 247 /* CatchClause */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: + case 241 /* JsxAttribute */: + case 242 /* JsxSpreadAttribute */: + case 238 /* JsxOpeningElement */: + case 243 /* JsxExpression */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -20301,7 +20531,7 @@ var ts; // Only narrow when symbol is variable of type any or an object, union, or type parameter type if (node && symbol.flags & 3 /* Variable */) { if (isTypeAny(type) || type.flags & (80896 /* ObjectType */ | 16384 /* Union */ | 512 /* TypeParameter */)) { - var declaration = ts.getDeclarationOfKind(symbol, 213 /* VariableDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 214 /* VariableDeclaration */); var top_1 = declaration && getDeclarationContainer(declaration); var originalType = type; var nodeStack = []; @@ -20309,13 +20539,13 @@ var ts; var child = node; node = node.parent; switch (node.kind) { - case 198 /* IfStatement */: - case 184 /* ConditionalExpression */: - case 183 /* BinaryExpression */: + case 199 /* IfStatement */: + case 185 /* ConditionalExpression */: + case 184 /* BinaryExpression */: nodeStack.push({ node: node, child: child }); break; - case 250 /* SourceFile */: - case 220 /* ModuleDeclaration */: + case 251 /* SourceFile */: + case 221 /* ModuleDeclaration */: // Stop at the first containing file or module declaration break loop; } @@ -20327,19 +20557,19 @@ var ts; while (nodes = nodeStack.pop()) { var node_1 = nodes.node, child = nodes.child; switch (node_1.kind) { - case 198 /* IfStatement */: + case 199 /* IfStatement */: // In a branch of an if statement, narrow based on controlling expression if (child !== node_1.expression) { type = narrowType(type, node_1.expression, /*assumeTrue*/ child === node_1.thenStatement); } break; - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: // In a branch of a conditional expression, narrow based on controlling condition if (child !== node_1.condition) { type = narrowType(type, node_1.condition, /*assumeTrue*/ child === node_1.whenTrue); } break; - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: // In the right operand of an && or ||, narrow based on left operand if (child === node_1.right) { if (node_1.operatorToken.kind === 51 /* AmpersandAmpersandToken */) { @@ -20367,7 +20597,7 @@ var ts; return type; function narrowTypeByEquality(type, expr, assumeTrue) { // Check that we have 'typeof ' on the left and string literal on the right - if (expr.left.kind !== 178 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { + if (expr.left.kind !== 179 /* TypeOfExpression */ || expr.right.kind !== 9 /* StringLiteral */) { return type; } var left = expr.left; @@ -20383,10 +20613,6 @@ var ts; if (typeInfo && typeInfo.type === undefinedType) { return type; } - // If the type to be narrowed is any and we're checking a primitive with assumeTrue=true, return the primitive - if (!!(type.flags & 1 /* Any */) && typeInfo && assumeTrue) { - return typeInfo.type; - } var flags; if (typeInfo) { flags = typeInfo.flags; @@ -20397,6 +20623,10 @@ var ts; } // At this point we can bail if it's not a union if (!(type.flags & 16384 /* Union */)) { + // If we're on the true branch and the type is a subtype, we should return the primitive type + if (assumeTrue && typeInfo && isTypeSubtypeOf(typeInfo.type, type)) { + return typeInfo.type; + } // If the active non-union type would be removed from a union by this type guard, return an empty union return filterUnion(type) ? type : emptyUnionType; } @@ -20525,7 +20755,7 @@ var ts; return narrowTypeByThisTypePredicate(type, memberType.predicate, expr, assumeTrue); } function narrowTypeByThisTypePredicate(type, predicate, expression, assumeTrue) { - if (expression.kind === 169 /* ElementAccessExpression */ || expression.kind === 168 /* PropertyAccessExpression */) { + if (expression.kind === 170 /* ElementAccessExpression */ || expression.kind === 169 /* PropertyAccessExpression */) { var accessExpression = expression; var possibleIdentifier = skipParenthesizedNodes(accessExpression.expression); if (possibleIdentifier.kind === 69 /* Identifier */ && getSymbolAtTypePredicatePosition(possibleIdentifier) === symbol) { @@ -20538,8 +20768,8 @@ var ts; expr = skipParenthesizedNodes(expr); switch (expr.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(expr); } } @@ -20547,11 +20777,11 @@ var ts; // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 170 /* CallExpression */: + case 171 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: var operator = expr.operatorToken.kind; if (operator === 32 /* EqualsEqualsEqualsToken */ || operator === 33 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -20566,20 +20796,20 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: if (expr.operator === 49 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; - case 169 /* ElementAccessExpression */: - case 168 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 169 /* PropertyAccessExpression */: return narrowTypeByTypePredicateMember(type, expr, assumeTrue); } return type; } } function skipParenthesizedNodes(expression) { - while (expression.kind === 174 /* ParenthesizedExpression */) { + while (expression.kind === 175 /* ParenthesizedExpression */) { expression = expression.expression; } return expression; @@ -20594,7 +20824,7 @@ var ts; // can explicitly bound arguments objects if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); - if (container.kind === 176 /* ArrowFunction */) { + if (container.kind === 177 /* ArrowFunction */) { if (languageVersion < 2 /* ES6 */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } @@ -20625,7 +20855,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 /* ES6 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 246 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 247 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -20641,12 +20871,12 @@ var ts; // nesting structure: // (variable declaration or binding element) -> variable declaration list -> container container = symbol.valueDeclaration; - while (container.kind !== 214 /* VariableDeclarationList */) { + while (container.kind !== 215 /* VariableDeclarationList */) { container = container.parent; } // get the parent of variable declaration list container = container.parent; - if (container.kind === 195 /* VariableStatement */) { + if (container.kind === 196 /* VariableStatement */) { // if parent is variable statement - get its parent container = container.parent; } @@ -20667,7 +20897,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 141 /* PropertyDeclaration */ || container.kind === 144 /* Constructor */) { + if (container.kind === 142 /* PropertyDeclaration */ || container.kind === 145 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -20681,32 +20911,32 @@ var ts; var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 176 /* ArrowFunction */) { + if (container.kind === 177 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES6 */); } switch (container.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 144 /* Constructor */: + case 145 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: if (container.flags & 64 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -20719,7 +20949,7 @@ var ts; } // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (ts.isInJavaScriptFile(node) && container.kind === 175 /* FunctionExpression */) { + if (ts.isInJavaScriptFile(node) && container.kind === 176 /* FunctionExpression */) { if (ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.protoype.y = f @@ -20736,19 +20966,19 @@ var ts; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 138 /* Parameter */) { + if (n.kind === 139 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 171 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; if (!isCallExpression) { // adjust the container reference in case if super is used inside arrow functions with arbitrary deep nesting - while (container && container.kind === 176 /* ArrowFunction */) { + while (container && container.kind === 177 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } @@ -20762,16 +20992,16 @@ var ts; // [super.foo()]() {} // } var current = node; - while (current && current !== container && current.kind !== 136 /* ComputedPropertyName */) { + while (current && current !== container && current.kind !== 137 /* ComputedPropertyName */) { current = current.parent; } - if (current && current.kind === 136 /* ComputedPropertyName */) { + if (current && current.kind === 137 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 168 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -20792,7 +21022,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 167 /* ObjectLiteralExpression */) { + if (container.parent.kind === 168 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES6 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -20812,7 +21042,7 @@ var ts; } return unknownType; } - if (container.kind === 144 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 145 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -20827,7 +21057,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 144 /* Constructor */; + return container.kind === 145 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -20835,21 +21065,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 167 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 168 /* ObjectLiteralExpression */) { if (container.flags & 64 /* Static */) { - return container.kind === 143 /* MethodDeclaration */ || - container.kind === 142 /* MethodSignature */ || - container.kind === 145 /* GetAccessor */ || - container.kind === 146 /* SetAccessor */; + return container.kind === 144 /* MethodDeclaration */ || + container.kind === 143 /* MethodSignature */ || + container.kind === 146 /* GetAccessor */ || + container.kind === 147 /* SetAccessor */; } else { - return container.kind === 143 /* MethodDeclaration */ || - container.kind === 142 /* MethodSignature */ || - container.kind === 145 /* GetAccessor */ || - container.kind === 146 /* SetAccessor */ || - container.kind === 141 /* PropertyDeclaration */ || - container.kind === 140 /* PropertySignature */ || - container.kind === 144 /* Constructor */; + return container.kind === 144 /* MethodDeclaration */ || + container.kind === 143 /* MethodSignature */ || + container.kind === 146 /* GetAccessor */ || + container.kind === 147 /* SetAccessor */ || + container.kind === 142 /* PropertyDeclaration */ || + container.kind === 141 /* PropertySignature */ || + container.kind === 145 /* Constructor */; } } } @@ -20891,7 +21121,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 138 /* Parameter */) { + if (declaration.kind === 139 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -20924,7 +21154,7 @@ var ts; } function isInParameterInitializerBeforeContainingFunction(node) { while (node.parent && !ts.isFunctionLike(node.parent)) { - if (node.parent.kind === 138 /* Parameter */ && node.parent.initializer === node) { + if (node.parent.kind === 139 /* Parameter */ && node.parent.initializer === node) { return true; } node = node.parent; @@ -20935,8 +21165,8 @@ var ts; // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed if (functionDecl.type || - functionDecl.kind === 144 /* Constructor */ || - functionDecl.kind === 145 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 146 /* SetAccessor */))) { + functionDecl.kind === 145 /* Constructor */ || + functionDecl.kind === 146 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 147 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); } // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature @@ -20958,7 +21188,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 172 /* TaggedTemplateExpression */) { + if (template.parent.kind === 173 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -21089,13 +21319,13 @@ var ts; var kind = attribute.kind; var jsxElement = attribute.parent; var attrsType = getJsxElementAttributesType(jsxElement); - if (attribute.kind === 240 /* JsxAttribute */) { + if (attribute.kind === 241 /* JsxAttribute */) { if (!attrsType || isTypeAny(attrsType)) { return undefined; } return getTypeOfPropertyOfType(attrsType, attribute.name.text); } - else if (attribute.kind === 241 /* JsxSpreadAttribute */) { + else if (attribute.kind === 242 /* JsxSpreadAttribute */) { return attrsType; } ts.Debug.fail("Expected JsxAttribute or JsxSpreadAttribute, got ts.SyntaxKind[" + kind + "]"); @@ -21133,40 +21363,40 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 213 /* VariableDeclaration */: - case 138 /* Parameter */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 139 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 166 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 176 /* ArrowFunction */: - case 206 /* ReturnStatement */: + case 177 /* ArrowFunction */: + case 207 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 247 /* PropertyAssignment */: + case 248 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 192 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 185 /* TemplateExpression */); + case 193 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 186 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return getContextualType(parent); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return getContextualType(parent); - case 240 /* JsxAttribute */: - case 241 /* JsxSpreadAttribute */: + case 241 /* JsxAttribute */: + case 242 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); } return undefined; @@ -21183,7 +21413,7 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 175 /* FunctionExpression */ || node.kind === 176 /* ArrowFunction */; + return node.kind === 176 /* FunctionExpression */ || node.kind === 177 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -21197,7 +21427,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getApparentTypeOfContextualType(node); @@ -21260,13 +21490,13 @@ var ts; // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 183 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { + if (parent.kind === 184 /* BinaryExpression */ && parent.operatorToken.kind === 56 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 247 /* PropertyAssignment */) { + if (parent.kind === 248 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 166 /* ArrayLiteralExpression */) { + if (parent.kind === 167 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; @@ -21282,8 +21512,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false); } function hasDefaultValue(node) { - return (node.kind === 165 /* BindingElement */ && !!node.initializer) || - (node.kind === 183 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); + return (node.kind === 166 /* BindingElement */ && !!node.initializer) || + (node.kind === 184 /* BinaryExpression */ && node.operatorToken.kind === 56 /* EqualsToken */); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -21292,7 +21522,7 @@ var ts; var inDestructuringPattern = isAssignmentTarget(node); for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { var e = elements_1[_i]; - if (inDestructuringPattern && e.kind === 187 /* SpreadElementExpression */) { + if (inDestructuringPattern && e.kind === 188 /* SpreadElementExpression */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -21316,7 +21546,7 @@ var ts; var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 187 /* SpreadElementExpression */; + hasSpreadElement = hasSpreadElement || e.kind === 188 /* SpreadElementExpression */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -21331,7 +21561,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 164 /* ArrayBindingPattern */ || pattern.kind === 166 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 165 /* ArrayBindingPattern */ || pattern.kind === 167 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -21339,7 +21569,7 @@ var ts; elementTypes.push(contextualType.elementTypes[i]); } else { - if (patternElement.kind !== 189 /* OmittedExpression */) { + if (patternElement.kind !== 190 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(unknownType); @@ -21354,7 +21584,7 @@ var ts; return createArrayType(elementTypes.length ? getUnionType(elementTypes) : undefinedType); } function isNumericName(name) { - return name.kind === 136 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 137 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { // It seems odd to consider an expression of type Any to result in a numeric name, @@ -21411,24 +21641,24 @@ var ts; var propertiesArray = []; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 163 /* ObjectBindingPattern */ || contextualType.pattern.kind === 167 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 164 /* ObjectBindingPattern */ || contextualType.pattern.kind === 168 /* ObjectLiteralExpression */); var typeFlags = 0; var patternWithComputedProperties = false; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 247 /* PropertyAssignment */ || - memberDecl.kind === 248 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 248 /* PropertyAssignment */ || + memberDecl.kind === 249 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 247 /* PropertyAssignment */) { + if (memberDecl.kind === 248 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 143 /* MethodDeclaration */) { + else if (memberDecl.kind === 144 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 248 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 249 /* ShorthandPropertyAssignment */); type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; @@ -21436,8 +21666,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 247 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 248 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 248 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 249 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 536870912 /* Optional */; } @@ -21471,7 +21701,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 145 /* GetAccessor */ || memberDecl.kind === 146 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 146 /* GetAccessor */ || memberDecl.kind === 147 /* SetAccessor */); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -21538,13 +21768,13 @@ var ts; for (var _i = 0, _a = node.children; _i < _a.length; _i++) { var child = _a[_i]; switch (child.kind) { - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: checkJsxExpression(child); break; - case 235 /* JsxElement */: + case 236 /* JsxElement */: checkJsxElement(child); break; - case 236 /* JsxSelfClosingElement */: + case 237 /* JsxSelfClosingElement */: checkJsxSelfClosingElement(child); break; } @@ -21562,7 +21792,7 @@ var ts; * Returns true iff React would emit this tag name as a string rather than an identifier or qualified name */ function isJsxIntrinsicIdentifier(tagName) { - if (tagName.kind === 135 /* QualifiedName */) { + if (tagName.kind === 136 /* QualifiedName */) { return false; } else { @@ -21672,6 +21902,7 @@ var ts; if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } + return unknownSymbol; } } function lookupClassTag(node) { @@ -21771,21 +22002,25 @@ var ts; if (links.jsxFlags & 4 /* ValueElement */) { // Get the element instance type (the result of newing or invoking this tag) var elemInstanceType = getJsxElementInstanceType(node); - // Is this is a stateless function component? See if its single signature is - // assignable to the JSX Element Type - var callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); - var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & 80896 /* ObjectType */)) { - // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); + var elemClassType = getJsxGlobalElementClassType(); + if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { + // Is this is a stateless function component? See if its single signature's return type is + // assignable to the JSX Element Type + var elemType = getTypeOfSymbol(sym); + var callSignatures = elemType && getSignaturesOfType(elemType, 0 /* Call */); + var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; + var callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { + // Intersect in JSX.IntrinsicAttributes if it exists + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return links.resolvedJsxType = paramType; } - return paramType; } // Issue an error if this return type isn't assignable to JSX.ElementClass - var elemClassType = getJsxGlobalElementClassType(); if (elemClassType) { checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } @@ -21902,11 +22137,11 @@ var ts; // thus should have their types ignored var sawSpreadedAny = false; for (var i = node.attributes.length - 1; i >= 0; i--) { - if (node.attributes[i].kind === 240 /* JsxAttribute */) { + if (node.attributes[i].kind === 241 /* JsxAttribute */) { checkJsxAttribute((node.attributes[i]), targetAttributesType, nameTable); } else { - ts.Debug.assert(node.attributes[i].kind === 241 /* JsxSpreadAttribute */); + ts.Debug.assert(node.attributes[i].kind === 242 /* JsxSpreadAttribute */); var spreadType = checkJsxSpreadAttribute((node.attributes[i]), targetAttributesType, nameTable); if (isTypeAny(spreadType)) { sawSpreadedAny = true; @@ -21936,7 +22171,7 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 141 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 142 /* PropertyDeclaration */; } function getDeclarationFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 8 /* Public */ | 64 /* Static */ : 0; @@ -21953,7 +22188,7 @@ var ts; var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (left.kind === 95 /* SuperKeyword */) { - var errorNode = node.kind === 168 /* PropertyAccessExpression */ ? + var errorNode = node.kind === 169 /* PropertyAccessExpression */ ? node.name : node.right; // TS 1.0 spec (April 2014): 4.8.2 @@ -21963,7 +22198,7 @@ var ts; // - In a static member function or static member accessor // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. - if (languageVersion < 2 /* ES6 */ && getDeclarationKindFromSymbol(prop) !== 143 /* MethodDeclaration */) { + if (languageVersion < 2 /* ES6 */ && getDeclarationKindFromSymbol(prop) !== 144 /* MethodDeclaration */) { // `prop` refers to a *property* declared in the super class // rather than a *method*, so it does not satisfy the above criteria. error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); @@ -22050,7 +22285,7 @@ var ts; return getTypeOfSymbol(prop); } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 168 /* PropertyAccessExpression */ + var left = node.kind === 169 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpression(left); @@ -22062,11 +22297,58 @@ var ts; } return true; } + /** + * Return the symbol of the for-in variable declared or referenced by the given for-in statement. + */ + function getForInVariableSymbol(node) { + var initializer = node.initializer; + if (initializer.kind === 215 /* VariableDeclarationList */) { + var variable = initializer.declarations[0]; + if (variable && !ts.isBindingPattern(variable.name)) { + return getSymbolOfNode(variable); + } + } + else if (initializer.kind === 69 /* Identifier */) { + return getResolvedSymbol(initializer); + } + return undefined; + } + /** + * Return true if the given type is considered to have numeric property names. + */ + function hasNumericPropertyNames(type) { + return getIndexTypeOfType(type, 1 /* Number */) && !getIndexTypeOfType(type, 0 /* String */); + } + /** + * Return true if given node is an expression consisting of an identifier (possibly parenthesized) + * that references a for-in variable for an object with numeric property names. + */ + function isForInVariableForNumericPropertyNames(expr) { + var e = skipParenthesizedNodes(expr); + if (e.kind === 69 /* Identifier */) { + var symbol = getResolvedSymbol(e); + if (symbol.flags & 3 /* Variable */) { + var child = expr; + var node = expr.parent; + while (node) { + if (node.kind === 203 /* ForInStatement */ && + child === node.statement && + getForInVariableSymbol(node) === symbol && + hasNumericPropertyNames(checkExpression(node.expression))) { + return true; + } + child = node; + node = node.parent; + } + } + } + return false; + } function checkIndexedAccess(node) { // Grammar checking if (!node.argumentExpression) { - var sourceFile = getSourceFile(node); - if (node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node) { + var sourceFile = ts.getSourceFileOfNode(node); + if (node.parent.kind === 172 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -22115,7 +22397,7 @@ var ts; // Check for compatible indexer types. if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 258 /* StringLike */ | 132 /* NumberLike */ | 16777216 /* ESSymbol */)) { // Try to use a number indexer. - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132 /* NumberLike */)) { + if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132 /* NumberLike */) || isForInVariableForNumericPropertyNames(node.argumentExpression)) { var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; @@ -22128,7 +22410,9 @@ var ts; } // Fall back to any. if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !isTypeAny(objectType)) { - error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); + error(node, getIndexTypeOfType(objectType, 1 /* Number */) ? + ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number : + ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; } @@ -22147,7 +22431,7 @@ var ts; if (indexArgumentExpression.kind === 9 /* StringLiteral */ || indexArgumentExpression.kind === 8 /* NumericLiteral */) { return indexArgumentExpression.text; } - if (indexArgumentExpression.kind === 169 /* ElementAccessExpression */ || indexArgumentExpression.kind === 168 /* PropertyAccessExpression */) { + if (indexArgumentExpression.kind === 170 /* ElementAccessExpression */ || indexArgumentExpression.kind === 169 /* PropertyAccessExpression */) { var value = getConstantValue(indexArgumentExpression); if (value !== undefined) { return value.toString(); @@ -22202,10 +22486,10 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 139 /* Decorator */) { + else if (node.kind !== 140 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -22271,7 +22555,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 187 /* SpreadElementExpression */) { + if (arg && arg.kind === 188 /* SpreadElementExpression */) { return i; } } @@ -22283,13 +22567,13 @@ var ts; var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments var isDecorator; var spreadArgIndex = -1; - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { var tagExpression = node; // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 185 /* TemplateExpression */) { + if (tagExpression.template.kind === 186 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; @@ -22306,7 +22590,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 139 /* Decorator */) { + else if (node.kind === 140 /* Decorator */) { isDecorator = true; typeArguments = undefined; adjustedArgCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); @@ -22315,7 +22599,7 @@ var ts; var callExpression = node; if (!callExpression.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 171 /* NewExpression */); + ts.Debug.assert(callExpression.kind === 172 /* NewExpression */); return signature.minArgumentCount === 0; } // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. @@ -22394,7 +22678,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 190 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); // If the effective argument type is 'undefined', there is no synthetic type @@ -22454,7 +22738,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 189 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 190 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i, arg); @@ -22486,16 +22770,16 @@ var ts; */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 172 /* TaggedTemplateExpression */) { + if (node.kind === 173 /* TaggedTemplateExpression */) { var template = node.template; args = [undefined]; - if (template.kind === 185 /* TemplateExpression */) { + if (template.kind === 186 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); } } - else if (node.kind === 139 /* Decorator */) { + else if (node.kind === 140 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. @@ -22520,19 +22804,19 @@ var ts; * Otherwise, the argument count is the length of the 'args' array. */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 139 /* Decorator */) { + if (node.kind === 140 /* Decorator */) { switch (node.parent.kind) { - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -22542,7 +22826,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 138 /* Parameter */: + case 139 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -22566,25 +22850,25 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 138 /* Parameter */) { + if (node.kind === 139 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 144 /* Constructor */) { + if (node.kind === 145 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 141 /* PropertyDeclaration */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 142 /* PropertyDeclaration */ || + node.kind === 144 /* MethodDeclaration */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -22611,21 +22895,21 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 138 /* Parameter */) { + if (node.kind === 139 /* Parameter */) { node = node.parent; - if (node.kind === 144 /* Constructor */) { + if (node.kind === 145 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } } - if (node.kind === 141 /* PropertyDeclaration */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 142 /* PropertyDeclaration */ || + node.kind === 144 /* MethodDeclaration */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -22636,7 +22920,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getStringLiteralTypeForText(element.name.text); - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) { return nameType; @@ -22662,21 +22946,21 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a paramter decorator - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 138 /* Parameter */) { + if (node.kind === 139 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 141 /* PropertyDeclaration */) { + if (node.kind === 142 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 143 /* MethodDeclaration */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 144 /* MethodDeclaration */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -22708,10 +22992,10 @@ var ts; // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 139 /* Decorator */) { + if (node.kind === 140 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 173 /* TaggedTemplateExpression */) { return globalTemplateStringsArrayType; } // This is not a synthetic argument, so we return 'undefined' @@ -22723,8 +23007,8 @@ var ts; */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 139 /* Decorator */ || - (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */)) { + if (node.kind === 140 /* Decorator */ || + (argIndex === 0 && node.kind === 173 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -22733,11 +23017,11 @@ var ts; * Gets the error node to use when reporting errors for an effective argument. */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 139 /* Decorator */) { + if (node.kind === 140 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 172 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 173 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -22746,8 +23030,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, headMessage) { - var isTaggedTemplate = node.kind === 172 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 139 /* Decorator */; + var isTaggedTemplate = node.kind === 173 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 140 /* Decorator */; var typeArguments; if (!isTaggedTemplate && !isDecorator) { typeArguments = node.typeArguments; @@ -23093,16 +23377,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 138 /* Parameter */: + case 139 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -23139,16 +23423,16 @@ var ts; // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 170 /* CallExpression */) { + if (node.kind === 171 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 171 /* NewExpression */) { + else if (node.kind === 172 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 172 /* TaggedTemplateExpression */) { + else if (node.kind === 173 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } - else if (node.kind === 139 /* Decorator */) { + else if (node.kind === 140 /* Decorator */) { links.resolvedSignature = resolveDecorator(node, candidatesOutArray); } else { @@ -23176,12 +23460,12 @@ var ts; if (node.expression.kind === 95 /* SuperKeyword */) { return voidType; } - if (node.kind === 171 /* NewExpression */) { + if (node.kind === 172 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 144 /* Constructor */ && - declaration.kind !== 148 /* ConstructSignature */ && - declaration.kind !== 153 /* ConstructorType */) { + declaration.kind !== 145 /* Constructor */ && + declaration.kind !== 149 /* ConstructSignature */ && + declaration.kind !== 154 /* ConstructorType */) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations // in a JS file @@ -23242,7 +23526,7 @@ var ts; if (ts.isBindingPattern(node.name)) { for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189 /* OmittedExpression */) { + if (element.kind !== 190 /* OmittedExpression */) { if (element.name.kind === 69 /* Identifier */) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -23307,7 +23591,7 @@ var ts; } var isAsync = ts.isAsyncFunctionLike(func); var type; - if (func.body.kind !== 194 /* Block */) { + if (func.body.kind !== 195 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -23437,7 +23721,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 194 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { + if (ts.nodeIsMissing(func.body) || func.body.kind !== 195 /* Block */ || !(func.flags & 524288 /* HasImplicitReturn */)) { return; } var hasExplicitReturn = func.flags & 1048576 /* HasExplicitReturn */; @@ -23463,20 +23747,16 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 175 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 176 /* FunctionExpression */) { checkGrammarForGenerator(node); } // The identityMapper object is used to indicate that function expressions are wildcards if (contextualMapper === identityMapper && isContextSensitive(node)) { return anyFunctionType; } - var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); var contextSensitive = isContextSensitive(node); @@ -23510,18 +23790,15 @@ var ts; } } } - if (produceDiagnostics && node.kind !== 143 /* MethodDeclaration */ && node.kind !== 142 /* MethodSignature */) { + if (produceDiagnostics && node.kind !== 144 /* MethodDeclaration */ && node.kind !== 143 /* MethodSignature */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 143 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 144 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } var returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); if (!node.asteriskToken) { // return is not necessary in the body of generators @@ -23536,7 +23813,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 194 /* Block */) { + if (node.body.kind === 195 /* Block */) { checkSourceElement(node.body); } else { @@ -23588,17 +23865,17 @@ var ts; // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; } - case 168 /* PropertyAccessExpression */: { + case 169 /* PropertyAccessExpression */: { var symbol = findSymbol(n); // TypeScript 1.0 spec (April 2014): 4.10 // A property access expression is always classified as a reference. // NOTE (not in spec): assignment to enum members should not be allowed return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; } - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: // old compiler doesn't check indexed access return true; - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -23607,11 +23884,11 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: { + case 169 /* PropertyAccessExpression */: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 16384 /* Const */) !== 0; } - case 169 /* ElementAccessExpression */: { + case 170 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); if (symbol && index && index.kind === 9 /* StringLiteral */) { @@ -23621,7 +23898,7 @@ var ts; } return false; } - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -23767,9 +24044,9 @@ var ts; var properties = node.properties; for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { var p = properties_3[_i]; - if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { + if (p.kind === 248 /* PropertyAssignment */ || p.kind === 249 /* ShorthandPropertyAssignment */) { var name_13 = p.name; - if (name_13.kind === 136 /* ComputedPropertyName */) { + if (name_13.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(name_13); } if (isComputedNonLiteralName(name_13)) { @@ -23782,7 +24059,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(sourceType, 1 /* Number */) || getIndexTypeOfType(sourceType, 0 /* String */); if (type) { - if (p.kind === 248 /* ShorthandPropertyAssignment */) { + if (p.kind === 249 /* ShorthandPropertyAssignment */) { checkDestructuringAssignment(p, type); } else { @@ -23808,8 +24085,8 @@ var ts; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189 /* OmittedExpression */) { - if (e.kind !== 187 /* SpreadElementExpression */) { + if (e.kind !== 190 /* OmittedExpression */) { + if (e.kind !== 188 /* SpreadElementExpression */) { var propName = "" + i; var type = isTypeAny(sourceType) ? sourceType @@ -23834,7 +24111,7 @@ var ts; } else { var restExpression = e.expression; - if (restExpression.kind === 183 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { + if (restExpression.kind === 184 /* BinaryExpression */ && restExpression.operatorToken.kind === 56 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -23848,7 +24125,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, contextualMapper) { var target; - if (exprOrAssignment.kind === 248 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 249 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper); @@ -23858,14 +24135,14 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + if (target.kind === 184 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 167 /* ObjectLiteralExpression */) { + if (target.kind === 168 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 166 /* ArrayLiteralExpression */) { + if (target.kind === 167 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -23882,7 +24159,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, contextualMapper, errorNode) { var operator = operatorToken.kind; - if (operator === 56 /* EqualsToken */ && (left.kind === 167 /* ObjectLiteralExpression */ || left.kind === 166 /* ArrayLiteralExpression */)) { + if (operator === 56 /* EqualsToken */ && (left.kind === 168 /* ObjectLiteralExpression */ || left.kind === 167 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, contextualMapper), contextualMapper); } var leftType = checkExpression(left, contextualMapper); @@ -24151,7 +24428,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); @@ -24162,7 +24439,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -24192,7 +24469,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpression(node, contextualMapper) { var type; - if (node.kind === 135 /* QualifiedName */) { + if (node.kind === 136 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -24204,9 +24481,9 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 170 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 69 /* Identifier */ || node.kind === 136 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } @@ -24233,7 +24510,7 @@ var ts; return booleanType; case 8 /* NumericLiteral */: return checkNumericLiteral(node); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: return checkTemplateExpression(node); case 9 /* StringLiteral */: return checkStringLiteralExpression(node); @@ -24241,58 +24518,58 @@ var ts; return stringType; case 10 /* RegularExpressionLiteral */: return globalRegExpType; - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return checkCallExpression(node); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return checkClassExpression(node); - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 178 /* TypeOfExpression */: + case 179 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 173 /* TypeAssertionExpression */: - case 191 /* AsExpression */: + case 174 /* TypeAssertionExpression */: + case 192 /* AsExpression */: return checkAssertion(node); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return checkDeleteExpression(node); - case 179 /* VoidExpression */: + case 180 /* VoidExpression */: return checkVoidExpression(node); - case 180 /* AwaitExpression */: + case 181 /* AwaitExpression */: return checkAwaitExpression(node); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 187 /* SpreadElementExpression */: + case 188 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 189 /* OmittedExpression */: + case 190 /* OmittedExpression */: return undefinedType; - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return checkYieldExpression(node); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return checkJsxExpression(node); - case 235 /* JsxElement */: + case 236 /* JsxElement */: return checkJsxElement(node); - case 236 /* JsxSelfClosingElement */: + case 237 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node); - case 237 /* JsxOpeningElement */: + case 238 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -24320,7 +24597,7 @@ var ts; var func = ts.getContainingFunction(node); if (node.flags & 56 /* AccessibilityModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 144 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 145 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -24337,9 +24614,9 @@ var ts; if (!node.asteriskToken || !node.body) { return false; } - return node.kind === 143 /* MethodDeclaration */ || - node.kind === 215 /* FunctionDeclaration */ || - node.kind === 175 /* FunctionExpression */; + return node.kind === 144 /* MethodDeclaration */ || + node.kind === 216 /* FunctionDeclaration */ || + node.kind === 176 /* FunctionExpression */; } function getTypePredicateParameterIndex(parameterList, parameter) { if (parameterList) { @@ -24353,105 +24630,98 @@ var ts; } return -1; } - function isInLegalParameterTypePredicatePosition(node) { - switch (node.parent.kind) { - case 176 /* ArrowFunction */: - case 147 /* CallSignature */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 152 /* FunctionType */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - return node === node.parent.type; + function checkTypePredicate(node) { + var parent = getTypePredicateParent(node); + if (!parent) { + return; + } + var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(parent)); + if (!returnType || !(returnType.flags & 134217728 /* PredicateType */)) { + return; + } + var parameterName = node.parameterName; + if (parameterName.kind === 162 /* ThisType */) { + getTypeFromThisTypeNode(parameterName); + } + else { + var typePredicate = returnType.predicate; + if (typePredicate.parameterIndex >= 0) { + if (parent.parameters[typePredicate.parameterIndex].dotDotDotToken) { + error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + } + else { + checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type); + } + } + else if (parameterName) { + var hasReportedError = false; + for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) { + var name_14 = _a[_i].name; + if ((name_14.kind === 164 /* ObjectBindingPattern */ || + name_14.kind === 165 /* ArrayBindingPattern */) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_14, parameterName, typePredicate.parameterName)) { + hasReportedError = true; + break; + } + } + if (!hasReportedError) { + error(node.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + } + } } - return false; } - function isInLegalThisTypePredicatePosition(node) { - if (isInLegalParameterTypePredicatePosition(node)) { - return true; - } + function getTypePredicateParent(node) { switch (node.parent.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 145 /* GetAccessor */: - return node === node.parent.type; + case 177 /* ArrowFunction */: + case 148 /* CallSignature */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 153 /* FunctionType */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + var parent_6 = node.parent; + if (node === parent_6.type) { + return parent_6; + } + } + } + function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern, predicateVariableNode, predicateVariableName) { + for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { + var name_15 = _a[_i].name; + if (name_15.kind === 69 /* Identifier */ && + name_15.text === predicateVariableName) { + error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); + return true; + } + else if (name_15.kind === 165 /* ArrayBindingPattern */ || + name_15.kind === 164 /* ObjectBindingPattern */) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name_15, predicateVariableNode, predicateVariableName)) { + return true; + } + } } - return false; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 149 /* IndexSignature */) { + if (node.kind === 150 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 152 /* FunctionType */ || node.kind === 215 /* FunctionDeclaration */ || node.kind === 153 /* ConstructorType */ || - node.kind === 147 /* CallSignature */ || node.kind === 144 /* Constructor */ || - node.kind === 148 /* ConstructSignature */) { + else if (node.kind === 153 /* FunctionType */ || node.kind === 216 /* FunctionDeclaration */ || node.kind === 154 /* ConstructorType */ || + node.kind === 148 /* CallSignature */ || node.kind === 145 /* Constructor */ || + node.kind === 149 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); ts.forEach(node.parameters, checkParameter); - if (node.type) { - if (node.type.kind === 150 /* TypePredicate */) { - var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - if (!returnType || !(returnType.flags & 134217728 /* PredicateType */)) { - return; - } - var typePredicate = returnType.predicate; - var typePredicateNode = node.type; - checkSourceElement(typePredicateNode); - if (ts.isIdentifierTypePredicate(typePredicate)) { - if (typePredicate.parameterIndex >= 0) { - if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); - } - else { - checkTypeAssignableTo(typePredicate.type, getTypeOfNode(node.parameters[typePredicate.parameterIndex]), typePredicateNode.type); - } - } - else if (typePredicateNode.parameterName) { - var hasReportedError = false; - for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { - var param = _a[_i]; - if (hasReportedError) { - break; - } - if (param.name.kind === 163 /* ObjectBindingPattern */ || - param.name.kind === 164 /* ArrayBindingPattern */) { - (function checkBindingPattern(pattern) { - for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (element.name.kind === 69 /* Identifier */ && - element.name.text === typePredicate.parameterName) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, typePredicate.parameterName); - hasReportedError = true; - break; - } - else if (element.name.kind === 164 /* ArrayBindingPattern */ || - element.name.kind === 163 /* ObjectBindingPattern */) { - checkBindingPattern(element.name); - } - } - })(param.name); - } - } - if (!hasReportedError) { - error(typePredicateNode.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); - } - } - } - } - else { - checkSourceElement(node.type); - } - } + checkSourceElement(node.type); if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 147 /* CallSignature */: + case 148 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -24479,7 +24749,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 217 /* InterfaceDeclaration */) { + if (node.kind === 218 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -24556,7 +24826,7 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 170 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; + return n.kind === 171 /* CallExpression */ && n.expression.kind === 95 /* SuperKeyword */; } function containsSuperCallAsComputedPropertyName(n) { return n.name && containsSuperCall(n.name); @@ -24577,12 +24847,12 @@ var ts; if (n.kind === 97 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 175 /* FunctionExpression */ && n.kind !== 215 /* FunctionDeclaration */) { + else if (n.kind !== 176 /* FunctionExpression */ && n.kind !== 216 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 141 /* PropertyDeclaration */ && + return n.kind === 142 /* PropertyDeclaration */ && !(n.flags & 64 /* Static */) && !!n.initializer; } @@ -24612,7 +24882,7 @@ var ts; var superCallStatement; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 197 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { + if (statement.kind === 198 /* ExpressionStatement */ && isSuperCallExpression(statement.expression)) { superCallStatement = statement; break; } @@ -24640,7 +24910,7 @@ var ts; checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 145 /* GetAccessor */) { + if (node.kind === 146 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && (node.flags & 524288 /* HasImplicitReturn */)) { if (node.flags & 1048576 /* HasExplicitReturn */) { if (compilerOptions.noImplicitReturns) { @@ -24655,13 +24925,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 145 /* GetAccessor */ ? 146 /* SetAccessor */ : 145 /* GetAccessor */; + var otherKind = node.kind === 146 /* GetAccessor */ ? 147 /* SetAccessor */ : 146 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { if (((node.flags & 56 /* AccessibilityModifier */) !== (otherAccessor.flags & 56 /* AccessibilityModifier */))) { @@ -24680,7 +24950,7 @@ var ts; } getTypeOfAccessors(getSymbolOfNode(node)); } - if (node.parent.kind !== 167 /* ObjectLiteralExpression */) { + if (node.parent.kind !== 168 /* ObjectLiteralExpression */) { checkSourceElement(node.body); } else { @@ -24771,9 +25041,9 @@ var ts; var signaturesToCheck; // Unnamed (call\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer. // Use declaring type to obtain full list of signatures. - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 217 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 147 /* CallSignature */ || signatureDeclarationNode.kind === 148 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 147 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 218 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 148 /* CallSignature */ || signatureDeclarationNode.kind === 149 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 148 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -24793,9 +25063,9 @@ var ts; var flags = ts.getCombinedNodeFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 217 /* InterfaceDeclaration */ && - n.parent.kind !== 216 /* ClassDeclaration */ && - n.parent.kind !== 188 /* ClassExpression */ && + if (n.parent.kind !== 218 /* InterfaceDeclaration */ && + n.parent.kind !== 217 /* ClassDeclaration */ && + n.parent.kind !== 189 /* ClassExpression */ && ts.isInAmbientContext(n)) { if (!(flags & 4 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -24883,7 +25153,7 @@ var ts; var errorNode_1 = subsequentNode.name || subsequentNode; // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) && + var reportError = (node.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */) && (node.flags & 64 /* Static */) !== (subsequentNode.flags & 64 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -24925,7 +25195,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 217 /* InterfaceDeclaration */ || node.parent.kind === 155 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 218 /* InterfaceDeclaration */ || node.parent.kind === 156 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -24936,7 +25206,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 215 /* FunctionDeclaration */ || node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */ || node.kind === 144 /* Constructor */) { + if (node.kind === 216 /* FunctionDeclaration */ || node.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */ || node.kind === 145 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -25076,16 +25346,16 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return 2097152 /* ExportType */; - case 220 /* ModuleDeclaration */: - return d.name.kind === 9 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ + case 221 /* ModuleDeclaration */: + return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ : 4194304 /* ExportNamespace */; - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -25335,22 +25605,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 138 /* Parameter */: + case 139 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -25363,9 +25633,9 @@ var ts; // When we are emitting type metadata for decorators, we need to try to check the type // as if it were an expression so that we can emit the type in a value position when we // serialize the type metadata. - if (node && node.kind === 151 /* TypeReference */) { + if (node && node.kind === 152 /* TypeReference */) { var root = getFirstIdentifier(node.typeName); - var meaning = root.parent.kind === 151 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = root.parent.kind === 152 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; // Resolve type so we know which symbol is referenced var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); // Resolved symbol is alias @@ -25412,28 +25682,24 @@ var ts; if (compilerOptions.emitDecoratorMetadata) { // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { checkParameterTypeAnnotationsAsExpressions(constructor); } break; - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: checkParameterTypeAnnotationsAsExpressions(node); checkReturnTypeAnnotationAsExpression(node); break; - case 141 /* PropertyDeclaration */: - case 138 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 139 /* Parameter */: checkTypeAnnotationAsExpression(node); break; } } - emitDecorate = true; - if (node.kind === 138 /* Parameter */) { - emitParam = true; - } ts.forEach(node.decorators, checkDecorator); } function checkFunctionDeclaration(node) { @@ -25448,13 +25714,10 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var isAsync = ts.isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 137 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -25470,7 +25733,7 @@ var ts; // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. var firstDeclaration = ts.forEach(localSymbol.declarations, // Get first non javascript function declaration - function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(getSourceFile(declaration)) ? + function (declaration) { return declaration.kind === node.kind && !ts.isSourceFileJavaScript(ts.getSourceFileOfNode(declaration)) ? declaration : undefined; }); // Only type check the symbol once if (node === firstDeclaration) { @@ -25505,7 +25768,7 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 194 /* Block */) { + if (node.kind === 195 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); @@ -25525,12 +25788,12 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 141 /* PropertyDeclaration */ || - node.kind === 140 /* PropertySignature */ || - node.kind === 143 /* MethodDeclaration */ || - node.kind === 142 /* MethodSignature */ || - node.kind === 145 /* GetAccessor */ || - node.kind === 146 /* SetAccessor */) { + if (node.kind === 142 /* PropertyDeclaration */ || + node.kind === 141 /* PropertySignature */ || + node.kind === 144 /* MethodDeclaration */ || + node.kind === 143 /* MethodSignature */ || + node.kind === 146 /* GetAccessor */ || + node.kind === 147 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -25539,7 +25802,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 138 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 139 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -25592,12 +25855,12 @@ var ts; return; } // Uninstantiated modules shouldnt do this check - if (node.kind === 220 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 221 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 250 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 251 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -25632,7 +25895,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 213 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 214 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -25642,24 +25905,24 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 24576 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 214 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 195 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 215 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 196 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 194 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 221 /* ModuleBlock */ || - container.kind === 220 /* ModuleDeclaration */ || - container.kind === 250 /* SourceFile */); + (container.kind === 195 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 222 /* ModuleBlock */ || + container.kind === 221 /* ModuleDeclaration */ || + container.kind === 251 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail // since LHS will be block scoped name instead of function scoped if (!namesShareScope) { - var name_14 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_14, name_14); + var name_16 = symbolToString(localDeclarationSymbol); + error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_16, name_16); } } } @@ -25667,7 +25930,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 138 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 139 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -25678,7 +25941,7 @@ var ts; // check FunctionLikeDeclaration.locals (stores parameters\function local variable) // if it contains entry with a specified name and if this entry matches the resolved symbol if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 138 /* Parameter */) { + if (referencedSymbol.valueDeclaration.kind === 139 /* Parameter */) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; @@ -25704,15 +25967,15 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 136 /* ComputedPropertyName */) { + if (node.name.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 165 /* BindingElement */) { + if (node.kind === 166 /* BindingElement */) { // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 136 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 137 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } } @@ -25721,13 +25984,14 @@ var ts; ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 138 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 139 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - if (node.initializer) { + // Don't validate for-in initializer as it is already an error + if (node.initializer && node.parent.parent.kind !== 203 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -25737,7 +26001,8 @@ var ts; var type = getTypeOfVariableOrParameterOrProperty(symbol); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer - if (node.initializer) { + // Don't validate for-in initializer as it is already an error + if (node.initializer && node.parent.parent.kind !== 203 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -25753,10 +26018,10 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined); } } - if (node.kind !== 141 /* PropertyDeclaration */ && node.kind !== 140 /* PropertySignature */) { + if (node.kind !== 142 /* PropertyDeclaration */ && node.kind !== 141 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { + if (node.kind === 214 /* VariableDeclaration */ || node.kind === 166 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -25779,7 +26044,7 @@ var ts; } function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 167 /* ObjectLiteralExpression */) { + if (node.modifiers && node.parent.kind === 168 /* ObjectLiteralExpression */) { if (ts.isAsyncFunctionLike(node)) { if (node.modifiers.length > 1) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -25800,7 +26065,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 196 /* EmptyStatement */) { + if (node.thenStatement.kind === 197 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -25820,12 +26085,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 215 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -25845,14 +26110,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); // There may be a destructuring assignment on the left side - if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { + if (varExpr.kind === 167 /* ArrayLiteralExpression */ || varExpr.kind === 168 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -25881,7 +26146,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -25895,7 +26160,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 166 /* ArrayLiteralExpression */ || varExpr.kind === 167 /* ObjectLiteralExpression */) { + if (varExpr.kind === 167 /* ArrayLiteralExpression */ || varExpr.kind === 168 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258 /* StringLike */)) { @@ -26140,7 +26405,7 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 145 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 146 /* SetAccessor */))); + return !!(node.kind === 146 /* GetAccessor */ && ts.getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 147 /* SetAccessor */))); } function checkReturnStatement(node) { // Grammar checking @@ -26163,10 +26428,10 @@ var ts; // for generators. return; } - if (func.kind === 146 /* SetAccessor */) { + if (func.kind === 147 /* SetAccessor */) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } - else if (func.kind === 144 /* Constructor */) { + else if (func.kind === 145 /* Constructor */) { if (!checkTypeAssignableTo(exprType, returnType, node.expression)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -26208,7 +26473,7 @@ var ts; var expressionTypeIsStringLike = someConstituentTypeHasKind(expressionType, 258 /* StringLike */); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 244 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 245 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -26220,7 +26485,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 243 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 244 /* CaseClause */) { var caseClause = clause; // TypeScript 1.0 spec (April 2014):5.9 // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. @@ -26245,7 +26510,7 @@ var ts; if (ts.isFunctionLike(current)) { break; } - if (current.kind === 209 /* LabeledStatement */ && current.label.text === node.label.text) { + if (current.kind === 210 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -26350,7 +26615,7 @@ var ts; // perform property check if property or indexer is declared in 'type' // this allows to rule out cases when both property and indexer are inherited from the base class var errorNode; - if (prop.valueDeclaration.name.kind === 136 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 137 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { @@ -26431,7 +26696,6 @@ var ts; var staticType = getTypeOfSymbol(symbol); var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitExtends = emitExtends || !ts.isInAmbientContext(node); var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType = baseTypes[0]; @@ -26532,7 +26796,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !(derivedClassDecl.flags & 128 /* Abstract */))) { - if (derivedClassDecl.kind === 188 /* ClassExpression */) { + if (derivedClassDecl.kind === 189 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -26580,7 +26844,7 @@ var ts; } } function isAccessor(kind) { - return kind === 145 /* GetAccessor */ || kind === 146 /* SetAccessor */; + return kind === 146 /* GetAccessor */ || kind === 147 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -26650,7 +26914,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 217 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 218 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -26760,7 +27024,7 @@ var ts; return value; function evalConstant(e) { switch (e.kind) { - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: var value_1 = evalConstant(e.operand); if (value_1 === undefined) { return undefined; @@ -26771,7 +27035,7 @@ var ts; case 50 /* TildeToken */: return ~value_1; } return undefined; - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -26796,11 +27060,11 @@ var ts; return undefined; case 8 /* NumericLiteral */: return +e.text; - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return evalConstant(e.expression); case 69 /* Identifier */: - case 169 /* ElementAccessExpression */: - case 168 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 169 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType_1; @@ -26813,7 +27077,7 @@ var ts; } else { var expression; - if (e.kind === 169 /* ElementAccessExpression */) { + if (e.kind === 170 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || e.argumentExpression.kind !== 9 /* StringLiteral */) { return undefined; @@ -26831,7 +27095,7 @@ var ts; if (current.kind === 69 /* Identifier */) { break; } - else if (current.kind === 168 /* PropertyAccessExpression */) { + else if (current.kind === 169 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -26902,7 +27166,7 @@ var ts; var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 219 /* EnumDeclaration */) { + if (declaration.kind !== 220 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -26925,8 +27189,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { var declaration = declarations_5[_i]; - if ((declaration.kind === 216 /* ClassDeclaration */ || - (declaration.kind === 215 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 217 /* ClassDeclaration */ || + (declaration.kind === 216 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -26949,7 +27213,12 @@ var ts; function checkModuleDeclaration(node) { if (produceDiagnostics) { // Grammar checking - var isAmbientExternalModule = node.name.kind === 9 /* StringLiteral */; + var isGlobalAugmentation = ts.isGlobalScopeAugmentation(node); + var inAmbientContext = ts.isInAmbientContext(node); + if (isGlobalAugmentation && !inAmbientContext) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + } + var isAmbientExternalModule = ts.isAmbientModule(node); var contextErrorMessage = isAmbientExternalModule ? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : ts.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module; @@ -26958,7 +27227,7 @@ var ts; return; } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!ts.isInAmbientContext(node) && node.name.kind === 9 /* StringLiteral */) { + if (!inAmbientContext && node.name.kind === 9 /* StringLiteral */) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } } @@ -26969,7 +27238,7 @@ var ts; // The following checks only apply on a non-ambient instantiated module declaration. if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) + && !inAmbientContext && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) { var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { @@ -26982,30 +27251,120 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 216 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 217 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; } } - // Checks for ambient external modules. if (isAmbientExternalModule) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + if (ts.isExternalModuleAugmentation(node)) { + // body of the augmentation should be checked for consistency only if augmentation was applied to its target (either global scope or module) + // otherwise we'll be swamped in cascading errors. + // We can detect if augmentation was applied using following rules: + // - augmentation for a global scope is always applied + // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module). + var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432 /* Merged */); + if (checkBody) { + // body of ambient external module is always a module block + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + checkModuleAugmentationElement(statement, isGlobalAugmentation); + } + } } - if (ts.isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + else if (isGlobalSourceFile(node.parent)) { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else if (ts.isExternalModuleNameRelative(node.name.text)) { + error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + } + } + else { + if (isGlobalAugmentation) { + error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else { + // Node is not an augmentation and is not located on the script level. + // This means that this is declaration of ambient module that is located in other module or namespace which is prohibited. + error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + } } } } checkSourceElement(node.body); } + function checkModuleAugmentationElement(node, isGlobalAugmentation) { + switch (node.kind) { + case 196 /* VariableStatement */: + // error each individual name in variable statement instead of marking the entire variable statement + for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { + var decl = _a[_i]; + checkModuleAugmentationElement(decl, isGlobalAugmentation); + } + break; + case 230 /* ExportAssignment */: + case 231 /* ExportDeclaration */: + grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); + break; + case 224 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind !== 9 /* StringLiteral */) { + error(node.name, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + break; + } + // fallthrough + case 225 /* ImportDeclaration */: + grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); + break; + case 166 /* BindingElement */: + case 214 /* VariableDeclaration */: + var name_17 = node.name; + if (ts.isBindingPattern(name_17)) { + for (var _b = 0, _c = name_17.elements; _b < _c.length; _b++) { + var el = _c[_b]; + // mark individual names in binding pattern + checkModuleAugmentationElement(el, isGlobalAugmentation); + } + break; + } + // fallthrough + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 216 /* FunctionDeclaration */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 219 /* TypeAliasDeclaration */: + var symbol = getSymbolOfNode(node); + if (symbol) { + // module augmentations cannot introduce new names on the top level scope of the module + // this is done it two steps + // 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error + // 2. main check - report error if value declaration of the parent symbol is module augmentation) + var reportError = !(symbol.flags & 33554432 /* Merged */); + if (!reportError) { + if (isGlobalAugmentation) { + // global symbol should not have parent since it is not explicitly exported + reportError = symbol.parent !== undefined; + } + else { + // symbol should not originate in augmentation + reportError = ts.isExternalModuleAugmentation(symbol.parent.valueDeclaration); + } + } + if (reportError) { + error(node, ts.Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + } + } + break; + } + } function getFirstIdentifier(node) { while (true) { - if (node.kind === 135 /* QualifiedName */) { + if (node.kind === 136 /* QualifiedName */) { node = node.left; } - else if (node.kind === 168 /* PropertyAccessExpression */) { + else if (node.kind === 169 /* PropertyAccessExpression */) { node = node.expression; } else { @@ -27021,20 +27380,24 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 230 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 222 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 231 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } if (inAmbientExternalModule && ts.isExternalModuleNameRelative(moduleName.text)) { - // TypeScript 1.0 spec (April 2013): 12.1.6 - // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference - // other external modules only through top - level external module names. - // Relative external module names are not permitted. - error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); - return false; + // we have already reported errors on top level imports\exports in external module augmentations in checkModuleDeclaration + // no need to do this again. + if (!isTopLevelInExternalModuleAugmentation(node)) { + // TypeScript 1.0 spec (April 2013): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference + // other external modules only through top - level external module names. + // Relative external module names are not permitted. + error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + return false; + } } return true; } @@ -27046,7 +27409,7 @@ var ts; (symbol.flags & 793056 /* Type */ ? 793056 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 232 /* ExportSpecifier */ ? + var message = node.kind === 233 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -27073,7 +27436,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 227 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -27130,8 +27493,8 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 221 /* ModuleBlock */ && node.parent.parent.name.kind === 9 /* StringLiteral */; - if (node.parent.kind !== 250 /* SourceFile */ && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 222 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 251 /* SourceFile */ && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -27145,14 +27508,23 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 250 /* SourceFile */ && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 220 /* ModuleDeclaration */) { + if (node.parent.kind !== 251 /* SourceFile */ && node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 221 /* ModuleDeclaration */) { return grammarErrorOnFirstToken(node, errorMessage); } } function checkExportSpecifier(node) { checkAliasSymbol(node); if (!node.parent.parent.moduleSpecifier) { - markExportAsReferenced(node); + var exportedName = node.propertyName || node.name; + // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases) + var symbol = resolveName(exportedName, exportedName.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */, + /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + if (symbol && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0]))) { + error(exportedName, ts.Diagnostics.Cannot_re_export_name_that_is_not_defined_in_the_module); + } + else { + markExportAsReferenced(node); + } } } function checkExportAssignment(node) { @@ -27160,8 +27532,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 250 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 220 /* ModuleDeclaration */ && container.name.kind === 69 /* Identifier */) { + var container = node.parent.kind === 251 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 221 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -27202,7 +27574,9 @@ var ts; var exportEqualsSymbol = moduleSymbol.exports["export="]; if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + if (!isTopLevelInExternalModuleAugmentation(declaration)) { + error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } } // Checks for export * conflicts var exports = getExportsOfModule(moduleSymbol); @@ -27225,21 +27599,7 @@ var ts; links.exportsChecked = true; } function isNotOverload(declaration) { - return declaration.kind !== 215 /* FunctionDeclaration */ || !!declaration.body; - } - } - function checkTypePredicate(node) { - var parameterName = node.parameterName; - if (parameterName.kind === 69 /* Identifier */ && !isInLegalParameterTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } - else if (parameterName.kind === 161 /* ThisType */) { - if (!isInLegalThisTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); - } - else { - getTypeFromThisTypeNode(parameterName); - } + return declaration.kind !== 216 /* FunctionDeclaration */ || !!declaration.body; } } function checkSourceElement(node) { @@ -27251,118 +27611,118 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessivly // hitting the cancellation token on every node we check. switch (kind) { - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: return checkTypeParameter(node); - case 138 /* Parameter */: + case 139 /* Parameter */: return checkParameter(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return checkPropertyDeclaration(node); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: return checkSignatureDeclaration(node); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return checkMethodDeclaration(node); - case 144 /* Constructor */: + case 145 /* Constructor */: return checkConstructorDeclaration(node); - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return checkAccessorDeclaration(node); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return checkTypeReferenceNode(node); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return checkTypePredicate(node); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return checkTypeQuery(node); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return checkTypeLiteral(node); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return checkArrayType(node); - case 157 /* TupleType */: + case 158 /* TupleType */: return checkTupleType(node); - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return checkSourceElement(node.type); - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return checkBlock(node); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return checkVariableStatement(node); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return checkExpressionStatement(node); - case 198 /* IfStatement */: + case 199 /* IfStatement */: return checkIfStatement(node); - case 199 /* DoStatement */: + case 200 /* DoStatement */: return checkDoStatement(node); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: return checkWhileStatement(node); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return checkForStatement(node); - case 202 /* ForInStatement */: + case 203 /* ForInStatement */: return checkForInStatement(node); - case 203 /* ForOfStatement */: + case 204 /* ForOfStatement */: return checkForOfStatement(node); - case 204 /* ContinueStatement */: - case 205 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 206 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return checkReturnStatement(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return checkWithStatement(node); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return checkSwitchStatement(node); - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return checkLabeledStatement(node); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: return checkThrowStatement(node); - case 211 /* TryStatement */: + case 212 /* TryStatement */: return checkTryStatement(node); - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 165 /* BindingElement */: + case 166 /* BindingElement */: return checkBindingElement(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return checkClassDeclaration(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return checkImportDeclaration(node); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return checkExportDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return checkExportAssignment(node); - case 196 /* EmptyStatement */: + case 197 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 212 /* DebuggerStatement */: + case 213 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 233 /* MissingDeclaration */: + case 234 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -27384,17 +27744,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: checkAccessorDeferred(node); break; - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -27420,10 +27780,6 @@ var ts; } // Grammar checking checkGrammarSourceFile(node); - emitExtends = false; - emitDecorate = false; - emitParam = false; - emitAwaiter = false; potentialThisCollisions.length = 0; deferredNodes = []; ts.forEach(node.statements, checkSourceElement); @@ -27436,21 +27792,6 @@ var ts; ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); potentialThisCollisions.length = 0; } - if (emitExtends) { - links.flags |= 8 /* EmitExtends */; - } - if (emitDecorate) { - links.flags |= 16 /* EmitDecorate */; - } - if (emitParam) { - links.flags |= 32 /* EmitParam */; - } - if (emitAwaiter) { - links.flags |= 64 /* EmitAwaiter */; - } - if (emitGenerator || (emitAwaiter && languageVersion < 2 /* ES6 */)) { - links.flags |= 128 /* EmitGenerator */; - } links.flags |= 1 /* TypeChecked */; } } @@ -27488,7 +27829,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 207 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 208 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -27511,25 +27852,25 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } // fall through; this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -27538,7 +27879,7 @@ var ts; copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 175 /* FunctionExpression */: + case 176 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -27587,37 +27928,37 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 137 /* TypeParameter */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 219 /* EnumDeclaration */: + case 138 /* TypeParameter */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 220 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 135 /* QualifiedName */) { + while (node.parent && node.parent.kind === 136 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 151 /* TypeReference */; + return node.parent && node.parent.kind === 152 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 168 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 169 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 190 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 191 /* ExpressionWithTypeArguments */; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 135 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 136 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 223 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 224 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 229 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 230 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -27629,11 +27970,11 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 229 /* ExportAssignment */) { + if (entityName.parent.kind === 230 /* ExportAssignment */) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 168 /* PropertyAccessExpression */) { + if (entityName.kind !== 169 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); @@ -27645,7 +27986,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 190 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 191 /* ExpressionWithTypeArguments */) { meaning = 793056 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -27658,9 +27999,9 @@ var ts; meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if ((entityName.parent.kind === 237 /* JsxOpeningElement */) || - (entityName.parent.kind === 236 /* JsxSelfClosingElement */) || - (entityName.parent.kind === 239 /* JsxClosingElement */)) { + else if ((entityName.parent.kind === 238 /* JsxOpeningElement */) || + (entityName.parent.kind === 237 /* JsxSelfClosingElement */) || + (entityName.parent.kind === 240 /* JsxClosingElement */)) { return getJsxElementTagSymbol(entityName.parent); } else if (ts.isExpression(entityName)) { @@ -27674,14 +28015,14 @@ var ts; var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 168 /* PropertyAccessExpression */) { + else if (entityName.kind === 169 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 135 /* QualifiedName */) { + else if (entityName.kind === 136 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -27690,16 +28031,16 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 151 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + var meaning = entityName.parent.kind === 152 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead // return the alias symbol. meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.parent.kind === 240 /* JsxAttribute */) { + else if (entityName.parent.kind === 241 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 150 /* TypePredicate */) { + if (entityName.parent.kind === 151 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? @@ -27716,12 +28057,12 @@ var ts; } if (node.kind === 69 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 229 /* ExportAssignment */ + return node.parent.kind === 230 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } - else if (node.parent.kind === 165 /* BindingElement */ && - node.parent.parent.kind === 163 /* ObjectBindingPattern */ && + else if (node.parent.kind === 166 /* BindingElement */ && + node.parent.parent.kind === 164 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.text); @@ -27732,19 +28073,19 @@ var ts; } switch (node.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 97 /* ThisKeyword */: case 95 /* SuperKeyword */: var type = ts.isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; - case 161 /* ThisType */: + case 162 /* ThisType */: return getTypeFromTypeNode(node).symbol; case 121 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 144 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 145 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -27752,14 +28093,14 @@ var ts; // External module name in an import declaration if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 224 /* ImportDeclaration */ || node.parent.kind === 230 /* ExportDeclaration */) && + ((node.parent.kind === 225 /* ImportDeclaration */ || node.parent.kind === 231 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } // Fall through case 8 /* NumericLiteral */: // index access - if (node.parent.kind === 169 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { + if (node.parent.kind === 170 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -27776,11 +28117,17 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 248 /* ShorthandPropertyAssignment */) { - return resolveEntityName(location.name, 107455 /* Value */); + if (location && location.kind === 249 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location.name, 107455 /* Value */ | 8388608 /* Alias */); } return undefined; } + /** Returns the target of an export specifier without following aliases */ + function getExportSpecifierLocalTargetSymbol(node) { + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); + } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { // We cannot answer semantic questions within a with block, do not proceed any further @@ -27858,9 +28205,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456 /* SyntheticProperty */) { var symbols = []; - var name_15 = symbol.name; + var name_18 = symbol.name; ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_15); + var symbol = getPropertyOfType(t, name_18); if (symbol) { symbols.push(symbol); } @@ -27920,11 +28267,11 @@ var ts; } var parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 250 /* SourceFile */) { + if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 251 /* SourceFile */) { return parentSymbol.valueDeclaration; } for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 220 /* ModuleDeclaration */ || n.kind === 219 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { + if ((n.kind === 221 /* ModuleDeclaration */ || n.kind === 220 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { return n; } } @@ -27939,11 +28286,11 @@ var ts; } function isStatementWithLocals(node) { switch (node.kind) { - case 194 /* Block */: - case 222 /* CaseBlock */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 195 /* Block */: + case 223 /* CaseBlock */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: return true; } return false; @@ -27973,22 +28320,22 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 223 /* ImportEqualsDeclaration */: - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return node.expression && node.expression.kind === 69 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 250 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 251 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -28050,7 +28397,7 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 249 /* EnumMember */) { + if (node.kind === 250 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -28172,23 +28519,38 @@ var ts; } function getExternalModuleFileFromDeclaration(declaration) { var specifier = ts.getExternalModuleName(declaration); - var moduleSymbol = getSymbolAtLocation(specifier); + var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 250 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 251 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file, compilerOptions); }); + var augmentations; // Initialize global symbol table ts.forEach(host.getSourceFiles(), function (file) { if (!ts.isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } + if (file.moduleAugmentations) { + (augmentations || (augmentations = [])).push(file.moduleAugmentations); + } }); + if (augmentations) { + // merge module augmentations. + // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed + for (var _i = 0, augmentations_1 = augmentations; _i < augmentations_1.length; _i++) { + var list = augmentations_1[_i]; + for (var _a = 0, list_2 = list; _a < list_2.length; _a++) { + var augmentation = list_2[_a]; + mergeModuleAugmentation(augmentation); + } + } + } // Setup global builtins addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); getSymbolLinks(undefinedSymbol).type = undefinedType; @@ -28262,14 +28624,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node)) { - if (node.kind === 143 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 144 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 145 /* GetAccessor */ || node.kind === 146 /* SetAccessor */) { + else if (node.kind === 146 /* GetAccessor */ || node.kind === 147 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -28279,38 +28641,38 @@ var ts; } function checkGrammarModifiers(node) { switch (node.kind) { - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 149 /* IndexSignature */: - case 220 /* ModuleDeclaration */: - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 230 /* ExportDeclaration */: - case 229 /* ExportAssignment */: - case 138 /* Parameter */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 145 /* Constructor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 150 /* IndexSignature */: + case 221 /* ModuleDeclaration */: + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 231 /* ExportDeclaration */: + case 230 /* ExportAssignment */: + case 139 /* Parameter */: break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 118 /* AsyncKeyword */) && - node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { + node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 251 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 195 /* VariableStatement */: - case 218 /* TypeAliasDeclaration */: - if (node.modifiers && node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 196 /* VariableStatement */: + case 219 /* TypeAliasDeclaration */: + if (node.modifiers && node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 251 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 74 /* ConstKeyword */) && - node.parent.kind !== 221 /* ModuleBlock */ && node.parent.kind !== 250 /* SourceFile */) { + node.parent.kind !== 222 /* ModuleBlock */ && node.parent.kind !== 251 /* SourceFile */) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } break; @@ -28326,7 +28688,7 @@ var ts; var modifier = _a[_i]; switch (modifier.kind) { case 74 /* ConstKeyword */: - if (node.kind !== 219 /* EnumDeclaration */ && node.parent.kind === 216 /* ClassDeclaration */) { + if (node.kind !== 220 /* EnumDeclaration */ && node.parent.kind === 217 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(74 /* ConstKeyword */)); } break; @@ -28354,7 +28716,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { + else if (node.parent.kind === 222 /* ModuleBlock */ || node.parent.kind === 251 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } else if (flags & 128 /* Abstract */) { @@ -28374,10 +28736,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { + else if (node.parent.kind === 222 /* ModuleBlock */ || node.parent.kind === 251 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -28399,10 +28761,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 2 /* Export */; @@ -28414,13 +28776,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 221 /* ModuleBlock */) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 222 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 4 /* Ambient */; @@ -28430,11 +28792,11 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 216 /* ClassDeclaration */) { - if (node.kind !== 143 /* MethodDeclaration */) { + if (node.kind !== 217 /* ClassDeclaration */) { + if (node.kind !== 144 /* MethodDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_or_method_declaration); } - if (!(node.parent.kind === 216 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { + if (!(node.parent.kind === 217 /* ClassDeclaration */ && node.parent.flags & 128 /* Abstract */)) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 64 /* Static */) { @@ -28453,7 +28815,7 @@ var ts; else if (flags & 4 /* Ambient */ || ts.isInAmbientContext(node.parent)) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 138 /* Parameter */) { + else if (node.kind === 139 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -28461,7 +28823,7 @@ var ts; break; } } - if (node.kind === 144 /* Constructor */) { + if (node.kind === 145 /* Constructor */) { if (flags & 64 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -28479,10 +28841,10 @@ var ts; } return; } - else if ((node.kind === 224 /* ImportDeclaration */ || node.kind === 223 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { + else if ((node.kind === 225 /* ImportDeclaration */ || node.kind === 224 /* ImportEqualsDeclaration */) && flags & 4 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 138 /* Parameter */ && (flags & 56 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 139 /* Parameter */ && (flags & 56 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } if (flags & 256 /* Async */) { @@ -28494,10 +28856,10 @@ var ts; return grammarErrorOnNode(asyncModifier, ts.Diagnostics.Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher); } switch (node.kind) { - case 143 /* MethodDeclaration */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: if (!node.asteriskToken) { return false; } @@ -28563,7 +28925,7 @@ var ts; checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 176 /* ArrowFunction */) { + if (node.kind === 177 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -28631,7 +28993,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0, args_1 = args; _i < args_1.length; _i++) { var arg = args_1[_i]; - if (arg.kind === 189 /* OmittedExpression */) { + if (arg.kind === 190 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -28705,19 +29067,19 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 136 /* ComputedPropertyName */) { + if (node.kind !== 137 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 183 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { + if (computedPropertyName.expression.kind === 184 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 24 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 215 /* FunctionDeclaration */ || - node.kind === 175 /* FunctionExpression */ || - node.kind === 143 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 216 /* FunctionDeclaration */ || + node.kind === 176 /* FunctionExpression */ || + node.kind === 144 /* MethodDeclaration */); if (ts.isInAmbientContext(node)) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -28741,21 +29103,21 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var _loop_1 = function(prop) { - var name_16 = prop.name; - if (prop.kind === 189 /* OmittedExpression */ || - name_16.kind === 136 /* ComputedPropertyName */) { + var name_19 = prop.name; + if (prop.kind === 190 /* OmittedExpression */ || + name_19.kind === 137 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it - checkGrammarComputedPropertyName(name_16); + checkGrammarComputedPropertyName(name_19); return "continue"; } - if (prop.kind === 248 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 249 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) }; } // Modifiers are never allowed on properties except for 'async' on a method declaration ts.forEach(prop.modifiers, function (mod) { - if (mod.kind !== 118 /* AsyncKeyword */ || prop.kind !== 143 /* MethodDeclaration */) { + if (mod.kind !== 118 /* AsyncKeyword */ || prop.kind !== 144 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } }); @@ -28768,44 +29130,44 @@ var ts; // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 247 /* PropertyAssignment */ || prop.kind === 248 /* ShorthandPropertyAssignment */) { + if (prop.kind === 248 /* PropertyAssignment */ || prop.kind === 249 /* ShorthandPropertyAssignment */) { // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_16.kind === 8 /* NumericLiteral */) { - checkGrammarNumericLiteral(name_16); + if (name_19.kind === 8 /* NumericLiteral */) { + checkGrammarNumericLiteral(name_19); } currentKind = Property; } - else if (prop.kind === 143 /* MethodDeclaration */) { + else if (prop.kind === 144 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 145 /* GetAccessor */) { + else if (prop.kind === 146 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 146 /* SetAccessor */) { + else if (prop.kind === 147 /* SetAccessor */) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_16.text)) { - seen[name_16.text] = currentKind; + if (!ts.hasProperty(seen, name_19.text)) { + seen[name_19.text] = currentKind; } else { - var existingKind = seen[name_16.text]; + var existingKind = seen[name_19.text]; if (currentKind === Property && existingKind === Property) { return "continue"; } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name_16.text] = currentKind | existingKind; + seen[name_19.text] = currentKind | existingKind; } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) }; } } else { - return { value: grammarErrorOnNode(name_16, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; + return { value: grammarErrorOnNode(name_19, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name) }; } } }; @@ -28820,19 +29182,19 @@ var ts; var seen = {}; for (var _i = 0, _a = node.attributes; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 241 /* JsxSpreadAttribute */) { + if (attr.kind === 242 /* JsxSpreadAttribute */) { continue; } var jsxAttr = attr; - var name_17 = jsxAttr.name; - if (!ts.hasProperty(seen, name_17.text)) { - seen[name_17.text] = true; + var name_20 = jsxAttr.name; + if (!ts.hasProperty(seen, name_20.text)) { + seen[name_20.text] = true; } else { - return grammarErrorOnNode(name_17, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + return grammarErrorOnNode(name_20, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 242 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 243 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -28841,7 +29203,7 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 214 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 215 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -28856,20 +29218,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 203 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 203 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 202 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 203 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -28892,10 +29254,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 145 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 146 /* GetAccessor */ && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 146 /* SetAccessor */) { + else if (kind === 147 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -28930,12 +29292,12 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 167 /* ObjectLiteralExpression */) { + if (node.parent.kind === 168 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } else if (node.body === undefined) { - return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } if (ts.isClassLike(node.parent)) { @@ -28954,10 +29316,10 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 217 /* InterfaceDeclaration */) { + else if (node.parent.kind === 218 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 155 /* TypeLiteral */) { + else if (node.parent.kind === 156 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } @@ -28968,11 +29330,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 204 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 205 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -28980,8 +29342,8 @@ var ts; return false; } break; - case 208 /* SwitchStatement */: - if (node.kind === 205 /* BreakStatement */ && !node.label) { + case 209 /* SwitchStatement */: + if (node.kind === 206 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -28996,13 +29358,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 205 /* BreakStatement */ + var message = node.kind === 206 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 205 /* BreakStatement */ + var message = node.kind === 206 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -29014,7 +29376,7 @@ var ts; if (node !== ts.lastOrUndefined(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } - if (node.name.kind === 164 /* ArrayBindingPattern */ || node.name.kind === 163 /* ObjectBindingPattern */) { + if (node.name.kind === 165 /* ArrayBindingPattern */ || node.name.kind === 164 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.initializer) { @@ -29024,7 +29386,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 202 /* ForInStatement */ && node.parent.parent.kind !== 203 /* ForOfStatement */) { + if (node.parent.parent.kind !== 203 /* ForInStatement */ && node.parent.parent.kind !== 204 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { // Error on equals token which immediate precedes the initializer @@ -29060,7 +29422,7 @@ var ts; var elements = name.elements; for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { var element = elements_2[_i]; - if (element.kind !== 189 /* OmittedExpression */) { + if (element.kind !== 190 /* OmittedExpression */) { checkGrammarNameInLetOrConstDeclarations(element.name); } } @@ -29077,15 +29439,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 198 /* IfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 199 /* IfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: return false; - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -29141,7 +29503,7 @@ var ts; return true; } } - else if (node.parent.kind === 217 /* InterfaceDeclaration */) { + else if (node.parent.kind === 218 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -29149,7 +29511,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 155 /* TypeLiteral */) { + else if (node.parent.kind === 156 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -29174,12 +29536,12 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 217 /* InterfaceDeclaration */ || - node.kind === 218 /* TypeAliasDeclaration */ || - node.kind === 224 /* ImportDeclaration */ || - node.kind === 223 /* ImportEqualsDeclaration */ || - node.kind === 230 /* ExportDeclaration */ || - node.kind === 229 /* ExportAssignment */ || + if (node.kind === 218 /* InterfaceDeclaration */ || + node.kind === 219 /* TypeAliasDeclaration */ || + node.kind === 225 /* ImportDeclaration */ || + node.kind === 224 /* ImportEqualsDeclaration */ || + node.kind === 231 /* ExportDeclaration */ || + node.kind === 230 /* ExportAssignment */ || (node.flags & 4 /* Ambient */) || (node.flags & (2 /* Export */ | 512 /* Default */))) { return false; @@ -29189,7 +29551,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 195 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 196 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -29215,7 +29577,7 @@ var ts; // to prevent noisyness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 194 /* Block */ || node.parent.kind === 221 /* ModuleBlock */ || node.parent.kind === 250 /* SourceFile */) { + if (node.parent.kind === 195 /* Block */ || node.parent.kind === 222 /* ModuleBlock */ || node.parent.kind === 251 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -29255,8 +29617,9 @@ var ts; getSourceMapData: function () { return undefined; }, setSourceFile: function (sourceFile) { }, emitStart: function (range) { }, - emitEnd: function (range) { }, + emitEnd: function (range, stopOverridingSpan) { }, emitPos: function (pos) { }, + changeEmitSourcePos: function () { }, getText: function () { return undefined; }, getSourceMappingURL: function () { return undefined; }, initialize: function (filePath, sourceMapFilePath, sourceFiles, isBundledEmit) { }, @@ -29270,6 +29633,8 @@ var ts; var compilerOptions = host.getCompilerOptions(); var currentSourceFile; var sourceMapDir; // The directory in which sourcemap will be + var stopOverridingSpan = false; + var modifyLastSourcePos = false; // Current source map file and its index in the sources list var sourceMapSourceIndex; // Last recorded and encoded spans @@ -29284,6 +29649,7 @@ var ts; emitPos: emitPos, emitStart: emitStart, emitEnd: emitEnd, + changeEmitSourcePos: changeEmitSourcePos, getText: getText, getSourceMappingURL: getSourceMappingURL, initialize: initialize, @@ -29358,6 +29724,39 @@ var ts; lastEncodedNameIndex = undefined; sourceMapData = undefined; } + function updateLastEncodedAndRecordedSpans() { + if (modifyLastSourcePos) { + // Reset the source pos + modifyLastSourcePos = false; + // Change Last recorded Map with last encoded emit line and character + lastRecordedSourceMapSpan.emittedLine = lastEncodedSourceMapSpan.emittedLine; + lastRecordedSourceMapSpan.emittedColumn = lastEncodedSourceMapSpan.emittedColumn; + // Pop sourceMapDecodedMappings to remove last entry + sourceMapData.sourceMapDecodedMappings.pop(); + // Change the last encoded source map + lastEncodedSourceMapSpan = sourceMapData.sourceMapDecodedMappings.length ? + sourceMapData.sourceMapDecodedMappings[sourceMapData.sourceMapDecodedMappings.length - 1] : + undefined; + // TODO: Update lastEncodedNameIndex + // Since we dont support this any more, lets not worry about it right now. + // When we start supporting nameIndex, we will get back to this + // Change the encoded source map + var sourceMapMappings = sourceMapData.sourceMapMappings; + var lenthToSet = sourceMapMappings.length - 1; + for (; lenthToSet >= 0; lenthToSet--) { + var currentChar = sourceMapMappings.charAt(lenthToSet); + if (currentChar === ",") { + // Separator for the entry found + break; + } + if (currentChar === ";" && lenthToSet !== 0 && sourceMapMappings.charAt(lenthToSet - 1) !== ";") { + // Last line separator found + break; + } + } + sourceMapData.sourceMapMappings = sourceMapMappings.substr(0, Math.max(0, lenthToSet)); + } + } // Encoding for sourcemap span function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { @@ -29388,6 +29787,7 @@ var ts; sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); // 5. Relative namePosition 0 based if (lastRecordedSourceMapSpan.nameIndex >= 0) { + ts.Debug.assert(false, "We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this"); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; } @@ -29421,20 +29821,30 @@ var ts; sourceColumn: sourceLinePos.character, sourceIndex: sourceMapSourceIndex }; + stopOverridingSpan = false; } - else { + else if (!stopOverridingSpan) { // Take the new pos instead since there is no change in emittedLine and column since last location lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } + updateLastEncodedAndRecordedSpans(); + } + function getStartPos(range) { + var rangeHasDecorators = !!range.decorators; + return range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1; } function emitStart(range) { - var rangeHasDecorators = !!range.decorators; - emitPos(range.pos !== -1 ? ts.skipTrivia(currentSourceFile.text, rangeHasDecorators ? range.decorators.end : range.pos) : -1); + emitPos(getStartPos(range)); } - function emitEnd(range) { + function emitEnd(range, stopOverridingEnd) { emitPos(range.end); + stopOverridingSpan = stopOverridingEnd; + } + function changeEmitSourcePos() { + ts.Debug.assert(!modifyLastSourcePos); + modifyLastSourcePos = true; } function setSourceFile(sourceFile) { currentSourceFile = sourceFile; @@ -29536,6 +29946,7 @@ var ts; var writeTextOfNode; var writer = createAndSetNewTextWriterWithSymbolWriter(); var enclosingDeclaration; + var resultHasExternalModuleIndicator; var currentText; var currentLineMap; var currentIdentifiers; @@ -29577,6 +29988,7 @@ var ts; } }); } + resultHasExternalModuleIndicator = false; if (!isBundledEmit || !ts.isExternalModule(sourceFile)) { noDeclare = false; emitSourceFile(sourceFile); @@ -29596,7 +30008,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 224 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 225 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -29613,6 +30025,13 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } + if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { + // if file was external module with augmentations - this fact should be preserved in .d.ts as well. + // in case if we didn't write any external module specifiers in .d.ts we need to emit something + // that will force compiler to think that this file is an external module - 'export {}' is a reasonable choice here. + write("export {};"); + writeLine(); + } }); return { reportedDeclarationError: reportedDeclarationError, @@ -29659,10 +30078,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 213 /* VariableDeclaration */) { + if (declaration.kind === 214 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 227 /* NamedImports */ || declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 225 /* ImportClause */) { + else if (declaration.kind === 228 /* NamedImports */ || declaration.kind === 229 /* ImportSpecifier */ || declaration.kind === 226 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -29680,7 +30099,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 224 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 225 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -29690,12 +30109,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 221 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 220 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 221 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -29803,35 +30222,35 @@ var ts; case 120 /* BooleanKeyword */: case 131 /* SymbolKeyword */: case 103 /* VoidKeyword */: - case 161 /* ThisType */: - case 162 /* StringLiteralType */: + case 162 /* ThisType */: + case 163 /* StringLiteralType */: return writeTextOfNode(currentText, type); - case 190 /* ExpressionWithTypeArguments */: + case 191 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 151 /* TypeReference */: + case 152 /* TypeReference */: return emitTypeReference(type); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return emitTypeQuery(type); - case 156 /* ArrayType */: + case 157 /* ArrayType */: return emitArrayType(type); - case 157 /* TupleType */: + case 158 /* TupleType */: return emitTupleType(type); - case 158 /* UnionType */: + case 159 /* UnionType */: return emitUnionType(type); - case 159 /* IntersectionType */: + case 160 /* IntersectionType */: return emitIntersectionType(type); - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: return emitParenType(type); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 155 /* TypeLiteral */: + case 156 /* TypeLiteral */: return emitTypeLiteral(type); case 69 /* Identifier */: return emitEntityName(type); - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return emitEntityName(type); - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -29839,8 +30258,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 135 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 135 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 136 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 136 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -29849,13 +30268,13 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 223 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 224 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 168 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 69 /* Identifier */ || node.expression.kind === 169 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -29934,9 +30353,9 @@ var ts; var count = 0; while (true) { count++; - var name_18 = baseName + "_" + count; - if (!ts.hasProperty(currentIdentifiers, name_18)) { - return name_18; + var name_21 = baseName + "_" + count; + if (!ts.hasProperty(currentIdentifiers, name_21)) { + return name_21; } } } @@ -29980,10 +30399,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 223 /* ImportEqualsDeclaration */ || - (node.parent.kind === 250 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 224 /* ImportEqualsDeclaration */ || + (node.parent.kind === 251 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 250 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 251 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -29993,7 +30412,7 @@ var ts; }); } else { - if (node.kind === 224 /* ImportDeclaration */) { + if (node.kind === 225 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -30011,23 +30430,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return writeVariableStatement(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return writeClassDeclaration(node); - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -30035,7 +30454,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 250 /* SourceFile */) { + if (node.parent.kind === 251 /* SourceFile */) { // If the node is exported if (node.flags & 2 /* Export */) { write("export "); @@ -30043,7 +30462,7 @@ var ts; if (node.flags & 512 /* Default */) { write("default "); } - else if (node.kind !== 217 /* InterfaceDeclaration */ && !noDeclare) { + else if (node.kind !== 218 /* InterfaceDeclaration */ && !noDeclare) { write("declare "); } } @@ -30092,7 +30511,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 226 /* NamespaceImport */) { + if (namedBindings.kind === 227 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -30120,7 +30539,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 227 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -30137,11 +30556,19 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { + // emitExternalModuleSpecifier is usually called when we emit something in the.d.ts file that will make it an external module (i.e. import/export declarations). + // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered + // external modules since they are indistingushable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' + // so compiler will treat them as external modules. + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 221 /* ModuleDeclaration */; var moduleSpecifier; - if (parent.kind === 223 /* ImportEqualsDeclaration */) { + if (parent.kind === 224 /* ImportEqualsDeclaration */) { var node = parent; moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); } + else if (parent.kind === 221 /* ModuleDeclaration */) { + moduleSpecifier = parent.name; + } else { var node = parent; moduleSpecifier = node.moduleSpecifier; @@ -30192,14 +30619,24 @@ var ts; function writeModuleDeclaration(node) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); - if (node.flags & 65536 /* Namespace */) { - write("namespace "); + if (ts.isGlobalScopeAugmentation(node)) { + write("global "); } else { - write("module "); + if (node.flags & 65536 /* Namespace */) { + write("namespace "); + } + else { + write("module "); + } + if (ts.isExternalModuleAugmentation(node)) { + emitExternalModuleSpecifier(node); + } + else { + writeTextOfNode(currentText, node.name); + } } - writeTextOfNode(currentText, node.name); - while (node.body.kind !== 221 /* ModuleBlock */) { + while (node.body.kind !== 222 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -30264,7 +30701,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 143 /* MethodDeclaration */ && (node.parent.flags & 16 /* Private */); + return node.parent.kind === 144 /* MethodDeclaration */ && (node.parent.flags & 16 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -30275,15 +30712,15 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 152 /* FunctionType */ || - node.parent.kind === 153 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 155 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 143 /* MethodDeclaration */ || - node.parent.kind === 142 /* MethodSignature */ || - node.parent.kind === 152 /* FunctionType */ || - node.parent.kind === 153 /* ConstructorType */ || - node.parent.kind === 147 /* CallSignature */ || - node.parent.kind === 148 /* ConstructSignature */); + if (node.parent.kind === 153 /* FunctionType */ || + node.parent.kind === 154 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 156 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 144 /* MethodDeclaration */ || + node.parent.kind === 143 /* MethodSignature */ || + node.parent.kind === 153 /* FunctionType */ || + node.parent.kind === 154 /* ConstructorType */ || + node.parent.kind === 148 /* CallSignature */ || + node.parent.kind === 149 /* ConstructSignature */); emitType(node.constraint); } else { @@ -30294,31 +30731,31 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 147 /* CallSignature */: + case 148 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.parent.flags & 64 /* Static */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 217 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -30352,7 +30789,7 @@ var ts; function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 216 /* ClassDeclaration */) { + if (node.parent.parent.kind === 217 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -30436,7 +30873,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 213 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 214 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -30446,10 +30883,10 @@ var ts; // what we want, namely the name expression enclosed in brackets. writeTextOfNode(currentText, node.name); // If optional property emit ? - if ((node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) && ts.hasQuestionToken(node)) { + if ((node.kind === 142 /* PropertyDeclaration */ || node.kind === 141 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) && node.parent.kind === 155 /* TypeLiteral */) { + if ((node.kind === 142 /* PropertyDeclaration */ || node.kind === 141 /* PropertySignature */) && node.parent.kind === 156 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.flags & 16 /* Private */)) { @@ -30458,14 +30895,14 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 213 /* VariableDeclaration */) { + if (node.kind === 214 /* VariableDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 141 /* PropertyDeclaration */ || node.kind === 140 /* PropertySignature */) { + else if (node.kind === 142 /* PropertyDeclaration */ || node.kind === 141 /* PropertySignature */) { // TODO(jfreeman): Deal with computed properties in error reporting. if (node.flags & 64 /* Static */) { return symbolAccesibilityResult.errorModuleName ? @@ -30474,7 +30911,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -30506,7 +30943,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 189 /* OmittedExpression */) { + if (element.kind !== 190 /* OmittedExpression */) { elements.push(element); } } @@ -30576,7 +31013,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 145 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 146 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -30589,7 +31026,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 145 /* GetAccessor */ + return accessor.kind === 146 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -30598,7 +31035,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 146 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 147 /* SetAccessor */) { // Setters have to have type named and cannot infer it so, the type should always be named if (accessorWithTypeAnnotation.parent.flags & 64 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? @@ -30648,17 +31085,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 143 /* MethodDeclaration */) { + else if (node.kind === 144 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 144 /* Constructor */) { + else if (node.kind === 145 /* Constructor */) { write("constructor"); } else { @@ -30678,11 +31115,11 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; // Construct signature or constructor type write new Signature - if (node.kind === 148 /* ConstructSignature */ || node.kind === 153 /* ConstructorType */) { + if (node.kind === 149 /* ConstructSignature */ || node.kind === 154 /* ConstructorType */) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 149 /* IndexSignature */) { + if (node.kind === 150 /* IndexSignature */) { write("["); } else { @@ -30690,22 +31127,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 149 /* IndexSignature */) { + if (node.kind === 150 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 152 /* FunctionType */ || node.kind === 153 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 155 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 153 /* FunctionType */ || node.kind === 154 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 156 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 144 /* Constructor */ && !(node.flags & 16 /* Private */)) { + else if (node.kind !== 145 /* Constructor */ && !(node.flags & 16 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -30716,26 +31153,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 147 /* CallSignature */: + case 148 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.flags & 64 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -30743,7 +31180,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.kind === 217 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -30757,7 +31194,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -30792,9 +31229,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 152 /* FunctionType */ || - node.parent.kind === 153 /* ConstructorType */ || - node.parent.parent.kind === 155 /* TypeLiteral */) { + if (node.parent.kind === 153 /* FunctionType */ || + node.parent.kind === 154 /* ConstructorType */ || + node.parent.parent.kind === 156 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 16 /* Private */)) { @@ -30810,24 +31247,24 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 144 /* Constructor */: + case 145 /* Constructor */: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 147 /* CallSignature */: + case 148 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (node.parent.flags & 64 /* Static */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -30835,7 +31272,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 216 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 217 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -30848,7 +31285,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -30860,12 +31297,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 163 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 164 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 164 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 165 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -30876,7 +31313,7 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 189 /* OmittedExpression */) { + if (bindingElement.kind === 190 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -30885,7 +31322,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 165 /* BindingElement */) { + else if (bindingElement.kind === 166 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -30924,40 +31361,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: - case 220 /* ModuleDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 217 /* InterfaceDeclaration */: - case 216 /* ClassDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 219 /* EnumDeclaration */: + case 216 /* FunctionDeclaration */: + case 221 /* ModuleDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 218 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 220 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return emitExportDeclaration(node); - case 144 /* Constructor */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 145 /* Constructor */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return writeFunctionDeclaration(node); - case 148 /* ConstructSignature */: - case 147 /* CallSignature */: - case 149 /* IndexSignature */: + case 149 /* ConstructSignature */: + case 148 /* CallSignature */: + case 150 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return emitAccessorDeclaration(node); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return emitPropertyDeclaration(node); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return emitExportAssignment(node); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return emitSourceFile(node); } } @@ -31317,7 +31754,7 @@ var ts; var metadataHelper = "\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; // emit output for the __param helper function var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; - var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {\n return new Promise(function (resolve, reject) {\n generator = generator.call(thisArg, _arguments);\n function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }\n function onfulfill(value) { try { step(\"next\", value); } catch (e) { reject(e); } }\n function onreject(value) { try { step(\"throw\", value); } catch (e) { reject(e); } }\n function step(verb, value) {\n var result = generator[verb](value);\n result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);\n }\n step(\"next\", void 0);\n });\n};"; + var awaiterHelper = "\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new P(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.call(thisArg, _arguments)).next());\n });\n};"; var compilerOptions = host.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); var modulekind = ts.getEmitModuleKind(compilerOptions); @@ -31415,6 +31852,7 @@ var ts; var isOwnFileEmit; /** If removeComments is true, no leading-comments needed to be emitted **/ var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfPositionWorker; + var setSourceMapWriterEmit = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? changeSourceMapEmit : function (writer) { }; var moduleEmitDelegates = (_a = {}, _a[5 /* ES6 */] = emitES6Module, _a[2 /* AMD */] = emitAMDModule, @@ -31499,10 +31937,10 @@ var ts; // Note that names generated by makeTempVariableName and makeUniqueName will never conflict. function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { - var name_19 = flags === 268435456 /* _i */ ? "_i" : "_n"; - if (isUniqueName(name_19)) { + var name_22 = flags === 268435456 /* _i */ ? "_i" : "_n"; + if (isUniqueName(name_22)) { tempFlags |= flags; - return name_19; + return name_22; } } while (true) { @@ -31510,9 +31948,9 @@ var ts; tempFlags++; // Skip over 'i' and 'n' if (count !== 8 && count !== 13) { - var name_20 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - if (isUniqueName(name_20)) { - return name_20; + var name_23 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); + if (isUniqueName(name_23)) { + return name_23; } } } @@ -31556,17 +31994,17 @@ var ts; switch (node.kind) { case 69 /* Identifier */: return makeUniqueName(node.text); - case 220 /* ModuleDeclaration */: - case 219 /* EnumDeclaration */: + case 221 /* ModuleDeclaration */: + case 220 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 224 /* ImportDeclaration */: - case 230 /* ExportDeclaration */: + case 225 /* ImportDeclaration */: + case 231 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 215 /* FunctionDeclaration */: - case 216 /* ClassDeclaration */: - case 229 /* ExportAssignment */: + case 216 /* FunctionDeclaration */: + case 217 /* ClassDeclaration */: + case 230 /* ExportAssignment */: return generateNameForExportDefault(); - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return generateNameForClassExpression(); } } @@ -31836,10 +32274,10 @@ var ts; write("("); emit(tempVariable); // Now we emit the expressions - if (node.template.kind === 185 /* TemplateExpression */) { + if (node.template.kind === 186 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 183 /* BinaryExpression */ + var needsParens = templateSpan.expression.kind === 184 /* BinaryExpression */ && templateSpan.expression.operatorToken.kind === 24 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); @@ -31874,7 +32312,7 @@ var ts; // ("abc" + 1) << (2 + "") // rather than // "abc" + (1 << 2) + "" - var needsParens = templateSpan.expression.kind !== 174 /* ParenthesizedExpression */ + var needsParens = templateSpan.expression.kind !== 175 /* ParenthesizedExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; if (i > 0 || headEmitted) { // If this is the first span and the head was not emitted, then this templateSpan's @@ -31916,11 +32354,11 @@ var ts; } function templateNeedsParens(template, parent) { switch (parent.kind) { - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: return parent.expression === template; - case 172 /* TaggedTemplateExpression */: - case 174 /* ParenthesizedExpression */: + case 173 /* TaggedTemplateExpression */: + case 175 /* ParenthesizedExpression */: return false; default: return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; @@ -31941,7 +32379,7 @@ var ts; // TODO (drosen): Note that we need to account for the upcoming 'yield' and // spread ('...') unary operators that are anticipated for ES6. switch (expression.kind) { - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: switch (expression.operatorToken.kind) { case 37 /* AsteriskToken */: case 39 /* SlashToken */: @@ -31953,8 +32391,8 @@ var ts; default: return -1 /* LessThan */; } - case 186 /* YieldExpression */: - case 184 /* ConditionalExpression */: + case 187 /* YieldExpression */: + case 185 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -32021,38 +32459,38 @@ var ts; // Either emit one big object literal (no spread attribs), or // a call to React.__spread var attrs = openingNode.attributes; - if (ts.forEach(attrs, function (attr) { return attr.kind === 241 /* JsxSpreadAttribute */; })) { + if (ts.forEach(attrs, function (attr) { return attr.kind === 242 /* JsxSpreadAttribute */; })) { emitExpressionIdentifier(syntheticReactRef); write(".__spread("); var haveOpenedObjectLiteral = false; - for (var i_1 = 0; i_1 < attrs.length; i_1++) { - if (attrs[i_1].kind === 241 /* JsxSpreadAttribute */) { + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].kind === 242 /* JsxSpreadAttribute */) { // If this is the first argument, we need to emit a {} as the first argument - if (i_1 === 0) { + if (i === 0) { write("{}, "); } if (haveOpenedObjectLiteral) { write("}"); haveOpenedObjectLiteral = false; } - if (i_1 > 0) { + if (i > 0) { write(", "); } - emit(attrs[i_1].expression); + emit(attrs[i].expression); } else { - ts.Debug.assert(attrs[i_1].kind === 240 /* JsxAttribute */); + ts.Debug.assert(attrs[i].kind === 241 /* JsxAttribute */); if (haveOpenedObjectLiteral) { write(", "); } else { haveOpenedObjectLiteral = true; - if (i_1 > 0) { + if (i > 0) { write(", "); } write("{"); } - emitJsxAttribute(attrs[i_1]); + emitJsxAttribute(attrs[i]); } } if (haveOpenedObjectLiteral) @@ -32062,7 +32500,7 @@ var ts; else { // One object literal with all the attributes in them write("{"); - for (var i = 0; i < attrs.length; i++) { + for (var i = 0, n = attrs.length; i < n; i++) { if (i > 0) { write(", "); } @@ -32075,11 +32513,11 @@ var ts; if (children) { for (var i = 0; i < children.length; i++) { // Don't emit empty expressions - if (children[i].kind === 242 /* JsxExpression */ && !(children[i].expression)) { + if (children[i].kind === 243 /* JsxExpression */ && !(children[i].expression)) { continue; } // Don't emit empty strings - if (children[i].kind === 238 /* JsxText */) { + if (children[i].kind === 239 /* JsxText */) { var text = getTextToEmit(children[i]); if (text !== undefined) { write(", \""); @@ -32097,11 +32535,11 @@ var ts; write(")"); // closes "React.createElement(" emitTrailingComments(openingNode); } - if (node.kind === 235 /* JsxElement */) { + if (node.kind === 236 /* JsxElement */) { emitJsxElement(node.openingElement, node.children); } else { - ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 237 /* JsxSelfClosingElement */); emitJsxElement(node); } } @@ -32123,11 +32561,11 @@ var ts; if (i > 0) { write(" "); } - if (attribs[i].kind === 241 /* JsxSpreadAttribute */) { + if (attribs[i].kind === 242 /* JsxSpreadAttribute */) { emitJsxSpreadAttribute(attribs[i]); } else { - ts.Debug.assert(attribs[i].kind === 240 /* JsxAttribute */); + ts.Debug.assert(attribs[i].kind === 241 /* JsxAttribute */); emitJsxAttribute(attribs[i]); } } @@ -32135,11 +32573,11 @@ var ts; function emitJsxOpeningOrSelfClosingElement(node) { write("<"); emit(node.tagName); - if (node.attributes.length > 0 || (node.kind === 236 /* JsxSelfClosingElement */)) { + if (node.attributes.length > 0 || (node.kind === 237 /* JsxSelfClosingElement */)) { write(" "); } emitAttributes(node.attributes); - if (node.kind === 236 /* JsxSelfClosingElement */) { + if (node.kind === 237 /* JsxSelfClosingElement */) { write("/>"); } else { @@ -32158,11 +32596,11 @@ var ts; } emitJsxClosingElement(node.closingElement); } - if (node.kind === 235 /* JsxElement */) { + if (node.kind === 236 /* JsxElement */) { emitJsxElement(node); } else { - ts.Debug.assert(node.kind === 236 /* JsxSelfClosingElement */); + ts.Debug.assert(node.kind === 237 /* JsxSelfClosingElement */); emitJsxOpeningOrSelfClosingElement(node); } } @@ -32170,11 +32608,11 @@ var ts; // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. // For example, this is utilized when feeding in a result to Object.defineProperty. function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 165 /* BindingElement */); + ts.Debug.assert(node.kind !== 166 /* BindingElement */); if (node.kind === 9 /* StringLiteral */) { emitLiteral(node); } - else if (node.kind === 136 /* ComputedPropertyName */) { + else if (node.kind === 137 /* ComputedPropertyName */) { // if this is a decorated computed property, we will need to capture the result // of the property expression so that we can apply decorators later. This is to ensure // we don't introduce unintended side effects: @@ -32218,62 +32656,62 @@ var ts; function isExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 166 /* ArrayLiteralExpression */: - case 191 /* AsExpression */: - case 183 /* BinaryExpression */: - case 170 /* CallExpression */: - case 243 /* CaseClause */: - case 136 /* ComputedPropertyName */: - case 184 /* ConditionalExpression */: - case 139 /* Decorator */: - case 177 /* DeleteExpression */: - case 199 /* DoStatement */: - case 169 /* ElementAccessExpression */: - case 229 /* ExportAssignment */: - case 197 /* ExpressionStatement */: - case 190 /* ExpressionWithTypeArguments */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 198 /* IfStatement */: - case 239 /* JsxClosingElement */: - case 236 /* JsxSelfClosingElement */: - case 237 /* JsxOpeningElement */: - case 241 /* JsxSpreadAttribute */: - case 242 /* JsxExpression */: - case 171 /* NewExpression */: - case 174 /* ParenthesizedExpression */: - case 182 /* PostfixUnaryExpression */: - case 181 /* PrefixUnaryExpression */: - case 206 /* ReturnStatement */: - case 248 /* ShorthandPropertyAssignment */: - case 187 /* SpreadElementExpression */: - case 208 /* SwitchStatement */: - case 172 /* TaggedTemplateExpression */: - case 192 /* TemplateSpan */: - case 210 /* ThrowStatement */: - case 173 /* TypeAssertionExpression */: - case 178 /* TypeOfExpression */: - case 179 /* VoidExpression */: - case 200 /* WhileStatement */: - case 207 /* WithStatement */: - case 186 /* YieldExpression */: + case 167 /* ArrayLiteralExpression */: + case 192 /* AsExpression */: + case 184 /* BinaryExpression */: + case 171 /* CallExpression */: + case 244 /* CaseClause */: + case 137 /* ComputedPropertyName */: + case 185 /* ConditionalExpression */: + case 140 /* Decorator */: + case 178 /* DeleteExpression */: + case 200 /* DoStatement */: + case 170 /* ElementAccessExpression */: + case 230 /* ExportAssignment */: + case 198 /* ExpressionStatement */: + case 191 /* ExpressionWithTypeArguments */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 199 /* IfStatement */: + case 240 /* JsxClosingElement */: + case 237 /* JsxSelfClosingElement */: + case 238 /* JsxOpeningElement */: + case 242 /* JsxSpreadAttribute */: + case 243 /* JsxExpression */: + case 172 /* NewExpression */: + case 175 /* ParenthesizedExpression */: + case 183 /* PostfixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: + case 207 /* ReturnStatement */: + case 249 /* ShorthandPropertyAssignment */: + case 188 /* SpreadElementExpression */: + case 209 /* SwitchStatement */: + case 173 /* TaggedTemplateExpression */: + case 193 /* TemplateSpan */: + case 211 /* ThrowStatement */: + case 174 /* TypeAssertionExpression */: + case 179 /* TypeOfExpression */: + case 180 /* VoidExpression */: + case 201 /* WhileStatement */: + case 208 /* WithStatement */: + case 187 /* YieldExpression */: return true; - case 165 /* BindingElement */: - case 249 /* EnumMember */: - case 138 /* Parameter */: - case 247 /* PropertyAssignment */: - case 141 /* PropertyDeclaration */: - case 213 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 250 /* EnumMember */: + case 139 /* Parameter */: + case 248 /* PropertyAssignment */: + case 142 /* PropertyDeclaration */: + case 214 /* VariableDeclaration */: return parent.initializer === node; - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return parent.expression === node; - case 176 /* ArrowFunction */: - case 175 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 176 /* FunctionExpression */: return parent.body === node; - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return parent.moduleReference === node; - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return parent.left === node; } return false; @@ -32285,7 +32723,7 @@ var ts; } var container = resolver.getReferencedExportContainer(node); if (container) { - if (container.kind === 250 /* SourceFile */) { + if (container.kind === 251 /* SourceFile */) { // Identifier references module export if (modulekind !== 5 /* ES6 */ && modulekind !== 4 /* System */) { write("exports."); @@ -32301,17 +32739,17 @@ var ts; if (modulekind !== 5 /* ES6 */) { var declaration = resolver.getReferencedImportDeclaration(node); if (declaration) { - if (declaration.kind === 225 /* ImportClause */) { + if (declaration.kind === 226 /* ImportClause */) { // Identifier references default import write(getGeneratedNameForNode(declaration.parent)); write(languageVersion === 0 /* ES3 */ ? "[\"default\"]" : ".default"); return; } - else if (declaration.kind === 228 /* ImportSpecifier */) { + else if (declaration.kind === 229 /* ImportSpecifier */) { // Identifier references named import write(getGeneratedNameForNode(declaration.parent.parent.parent)); - var name_21 = declaration.propertyName || declaration.name; - var identifier = ts.getTextOfNodeFromSourceText(currentText, name_21); + var name_24 = declaration.propertyName || declaration.name; + var identifier = ts.getTextOfNodeFromSourceText(currentText, name_24); if (languageVersion === 0 /* ES3 */ && identifier === "default") { write("[\"default\"]"); } @@ -32340,13 +32778,13 @@ var ts; } function isNameOfNestedRedeclaration(node) { if (languageVersion < 2 /* ES6 */) { - var parent_6 = node.parent; - switch (parent_6.kind) { - case 165 /* BindingElement */: - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 213 /* VariableDeclaration */: - return parent_6.name === node && resolver.isNestedRedeclaration(parent_6); + var parent_7 = node.parent; + switch (parent_7.kind) { + case 166 /* BindingElement */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 214 /* VariableDeclaration */: + return parent_7.name === node && resolver.isNestedRedeclaration(parent_7); } } return false; @@ -32355,8 +32793,8 @@ var ts; if (convertedLoopState) { if (node.text == "arguments" && resolver.isArgumentsLocalBinding(node)) { // in converted loop body arguments cannot be used directly. - var name_22 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); - write(name_22); + var name_25 = convertedLoopState.argumentsName || (convertedLoopState.argumentsName = makeUniqueName("arguments")); + write(name_25); return; } } @@ -32456,10 +32894,10 @@ var ts; } } function needsParenthesisForAwaitExpressionAsYield(node) { - if (node.parent.kind === 183 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { + if (node.parent.kind === 184 /* BinaryExpression */ && !ts.isAssignmentOperator(node.parent.operatorToken.kind)) { return true; } - else if (node.parent.kind === 184 /* ConditionalExpression */ && node.parent.condition === node) { + else if (node.parent.kind === 185 /* ConditionalExpression */ && node.parent.condition === node) { return true; } return false; @@ -32467,11 +32905,11 @@ var ts; function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 69 /* Identifier */: - case 166 /* ArrayLiteralExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: - case 170 /* CallExpression */: - case 174 /* ParenthesizedExpression */: + case 167 /* ArrayLiteralExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 175 /* ParenthesizedExpression */: // This list is not exhaustive and only includes those cases that are relevant // to the check in emitArrayLiteral. More cases can be added as needed. return false; @@ -32491,17 +32929,17 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 187 /* SpreadElementExpression */) { + if (e.kind === 188 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 166 /* ArrayLiteralExpression */) { + if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 167 /* ArrayLiteralExpression */) { write(".slice()"); } } else { var i = pos; - while (i < length && elements[i].kind !== 187 /* SpreadElementExpression */) { + while (i < length && elements[i].kind !== 188 /* SpreadElementExpression */) { i++; } write("["); @@ -32524,7 +32962,7 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 187 /* SpreadElementExpression */; + return node.kind === 188 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; @@ -32594,7 +33032,7 @@ var ts; writeComma(); var property = properties[i]; emitStart(property); - if (property.kind === 145 /* GetAccessor */ || property.kind === 146 /* SetAccessor */) { + if (property.kind === 146 /* GetAccessor */ || property.kind === 147 /* SetAccessor */) { // TODO (drosen): Reconcile with 'emitMemberFunctions'. var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property !== accessors.firstAccessor) { @@ -32646,13 +33084,13 @@ var ts; emitMemberAccessForPropertyName(property.name); emitEnd(property.name); write(" = "); - if (property.kind === 247 /* PropertyAssignment */) { + if (property.kind === 248 /* PropertyAssignment */) { emit(property.initializer); } - else if (property.kind === 248 /* ShorthandPropertyAssignment */) { + else if (property.kind === 249 /* ShorthandPropertyAssignment */) { emitExpressionIdentifier(property.name); } - else if (property.kind === 143 /* MethodDeclaration */) { + else if (property.kind === 144 /* MethodDeclaration */) { emitFunctionDeclaration(property); } else { @@ -32686,7 +33124,7 @@ var ts; // Everything until that point can be emitted as part of the initial object literal. var numInitialNonComputedProperties = numProperties; for (var i = 0, n = properties.length; i < n; i++) { - if (properties[i].name.kind === 136 /* ComputedPropertyName */) { + if (properties[i].name.kind === 137 /* ComputedPropertyName */) { numInitialNonComputedProperties = i; break; } @@ -32702,21 +33140,21 @@ var ts; emitObjectLiteralBody(node, properties.length); } function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(183 /* BinaryExpression */, startsOnNewLine); + var result = ts.createSynthesizedNode(184 /* BinaryExpression */, startsOnNewLine); result.operatorToken = ts.createSynthesizedNode(operator); result.left = left; result.right = right; return result; } function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(168 /* PropertyAccessExpression */); + var result = ts.createSynthesizedNode(169 /* PropertyAccessExpression */); result.expression = parenthesizeForAccess(expression); result.dotToken = ts.createSynthesizedNode(21 /* DotToken */); result.name = name; return result; } function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(169 /* ElementAccessExpression */); + var result = ts.createSynthesizedNode(170 /* ElementAccessExpression */); result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; @@ -32724,7 +33162,7 @@ var ts; function parenthesizeForAccess(expr) { // When diagnosing whether the expression needs parentheses, the decision should be based // on the innermost expression in a chain of nested type assertions. - while (expr.kind === 173 /* TypeAssertionExpression */ || expr.kind === 191 /* AsExpression */) { + while (expr.kind === 174 /* TypeAssertionExpression */ || expr.kind === 192 /* AsExpression */) { expr = expr.expression; } // isLeftHandSideExpression is almost the correct criterion for when it is not necessary @@ -32736,11 +33174,11 @@ var ts; // 1.x -> not the same as (1).x // if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 171 /* NewExpression */ && + expr.kind !== 172 /* NewExpression */ && expr.kind !== 8 /* NumericLiteral */) { return expr; } - var node = ts.createSynthesizedNode(174 /* ParenthesizedExpression */); + var node = ts.createSynthesizedNode(175 /* ParenthesizedExpression */); node.expression = expr; return node; } @@ -32775,7 +33213,7 @@ var ts; // Return true if identifier resolves to an exported member of a namespace function isNamespaceExportReference(node) { var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 250 /* SourceFile */; + return container && container.kind !== 251 /* SourceFile */; } function emitShorthandPropertyAssignment(node) { // The name property of a short-hand property assignment is considered an expression position, so here @@ -32805,7 +33243,7 @@ var ts; if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 168 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 169 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; @@ -32816,7 +33254,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return node.kind === 168 /* PropertyAccessExpression */ || node.kind === 169 /* ElementAccessExpression */ + return node.kind === 169 /* PropertyAccessExpression */ || node.kind === 170 /* ElementAccessExpression */ ? resolver.getConstantValue(node) : undefined; } @@ -32905,7 +33343,7 @@ var ts; } emitExpressionIdentifier(node); break; - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: emitQualifiedNameAsExpression(node, useFallback); break; default: @@ -32923,10 +33361,10 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 187 /* SpreadElementExpression */; }); + return ts.forEach(elements, function (e) { return e.kind === 188 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 174 /* ParenthesizedExpression */ || node.kind === 173 /* TypeAssertionExpression */ || node.kind === 191 /* AsExpression */) { + while (node.kind === 175 /* ParenthesizedExpression */ || node.kind === 174 /* TypeAssertionExpression */ || node.kind === 192 /* AsExpression */) { node = node.expression; } return node; @@ -32947,13 +33385,13 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 168 /* PropertyAccessExpression */) { + if (expr.kind === 169 /* PropertyAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 169 /* ElementAccessExpression */) { + else if (expr.kind === 170 /* ElementAccessExpression */) { // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); @@ -32998,7 +33436,7 @@ var ts; } else { emit(node.expression); - superCall = node.expression.kind === 168 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; + superCall = node.expression.kind === 169 /* PropertyAccessExpression */ && node.expression.expression.kind === 95 /* SuperKeyword */; } if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); @@ -33067,12 +33505,12 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 176 /* ArrowFunction */) { - if (node.expression.kind === 173 /* TypeAssertionExpression */ || node.expression.kind === 191 /* AsExpression */) { + if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 177 /* ArrowFunction */) { + if (node.expression.kind === 174 /* TypeAssertionExpression */ || node.expression.kind === 192 /* AsExpression */) { var operand = node.expression.expression; // Make sure we consider all nested cast expressions, e.g.: // (-A).x; - while (operand.kind === 173 /* TypeAssertionExpression */ || operand.kind === 191 /* AsExpression */) { + while (operand.kind === 174 /* TypeAssertionExpression */ || operand.kind === 192 /* AsExpression */) { operand = operand.expression; } // We have an expression of the form: (SubExpr) @@ -33083,15 +33521,15 @@ var ts; // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() // new (A()) should be emitted as new (A()) and not new A() // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () - if (operand.kind !== 181 /* PrefixUnaryExpression */ && - operand.kind !== 179 /* VoidExpression */ && - operand.kind !== 178 /* TypeOfExpression */ && - operand.kind !== 177 /* DeleteExpression */ && - operand.kind !== 182 /* PostfixUnaryExpression */ && - operand.kind !== 171 /* NewExpression */ && - !(operand.kind === 170 /* CallExpression */ && node.parent.kind === 171 /* NewExpression */) && - !(operand.kind === 175 /* FunctionExpression */ && node.parent.kind === 170 /* CallExpression */) && - !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 168 /* PropertyAccessExpression */)) { + if (operand.kind !== 182 /* PrefixUnaryExpression */ && + operand.kind !== 180 /* VoidExpression */ && + operand.kind !== 179 /* TypeOfExpression */ && + operand.kind !== 178 /* DeleteExpression */ && + operand.kind !== 183 /* PostfixUnaryExpression */ && + operand.kind !== 172 /* NewExpression */ && + !(operand.kind === 171 /* CallExpression */ && node.parent.kind === 172 /* NewExpression */) && + !(operand.kind === 176 /* FunctionExpression */ && node.parent.kind === 171 /* CallExpression */) && + !(operand.kind === 8 /* NumericLiteral */ && node.parent.kind === 169 /* PropertyAccessExpression */)) { emit(operand); return; } @@ -33120,7 +33558,7 @@ var ts; if (!isCurrentFileSystemExternalModule() || node.kind !== 69 /* Identifier */ || ts.nodeIsSynthesized(node)) { return false; } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 213 /* VariableDeclaration */ || node.parent.kind === 165 /* BindingElement */); + var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 214 /* VariableDeclaration */ || node.parent.kind === 166 /* BindingElement */); var targetDeclaration = isVariableDeclarationOrBindingElement ? node.parent : resolver.getReferencedValueDeclaration(node); @@ -33151,7 +33589,7 @@ var ts; // the resulting expression a prefix increment operation. And in the second, it will make the resulting // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. - if (node.operand.kind === 181 /* PrefixUnaryExpression */) { + if (node.operand.kind === 182 /* PrefixUnaryExpression */) { var operand = node.operand; if (node.operator === 35 /* PlusToken */ && (operand.operator === 35 /* PlusToken */ || operand.operator === 41 /* PlusPlusToken */)) { write(" "); @@ -33207,10 +33645,10 @@ var ts; } var current = node; while (current) { - if (current.kind === 250 /* SourceFile */) { + if (current.kind === 251 /* SourceFile */) { return !isExported || ((ts.getCombinedNodeFlags(node) & 2 /* Export */) !== 0); } - else if (ts.isFunctionLike(current) || current.kind === 221 /* ModuleBlock */) { + else if (ts.isFunctionLike(current) || current.kind === 222 /* ModuleBlock */) { return false; } else { @@ -33230,14 +33668,14 @@ var ts; if (ts.isElementAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(169 /* ElementAccessExpression */, /*startsOnNewLine*/ false); + synthesizedLHS = ts.createSynthesizedNode(170 /* ElementAccessExpression */, /*startsOnNewLine*/ false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; if (leftHandSideExpression.argumentExpression.kind !== 8 /* NumericLiteral */ && leftHandSideExpression.argumentExpression.kind !== 9 /* StringLiteral */) { var tempArgumentExpression = createAndRecordTempVariable(268435456 /* _i */); synthesizedLHS.argumentExpression = tempArgumentExpression; - emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true); + emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true, leftHandSideExpression.expression); } else { synthesizedLHS.argumentExpression = leftHandSideExpression.argumentExpression; @@ -33247,7 +33685,7 @@ var ts; else if (ts.isPropertyAccessExpression(leftHandSideExpression)) { shouldEmitParentheses = true; write("("); - synthesizedLHS = ts.createSynthesizedNode(168 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); + synthesizedLHS = ts.createSynthesizedNode(169 /* PropertyAccessExpression */, /*startsOnNewLine*/ false); var identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false); synthesizedLHS.expression = identifier; synthesizedLHS.dotToken = leftHandSideExpression.dotToken; @@ -33275,8 +33713,8 @@ var ts; } function emitBinaryExpression(node) { if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 56 /* EqualsToken */ && - (node.left.kind === 167 /* ObjectLiteralExpression */ || node.left.kind === 166 /* ArrayLiteralExpression */)) { - emitDestructuring(node, node.parent.kind === 197 /* ExpressionStatement */); + (node.left.kind === 168 /* ObjectLiteralExpression */ || node.left.kind === 167 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 198 /* ExpressionStatement */); } else { var exportChanged = node.operatorToken.kind >= 56 /* FirstAssignment */ && @@ -33341,7 +33779,7 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 194 /* Block */) { + if (node && node.kind === 195 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } @@ -33355,12 +33793,12 @@ var ts; } emitToken(15 /* OpenBraceToken */, node.pos); increaseIndent(); - if (node.kind === 221 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 220 /* ModuleDeclaration */); + if (node.kind === 222 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 221 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 221 /* ModuleBlock */) { + if (node.kind === 222 /* ModuleBlock */) { emitTempDeclarations(/*newLine*/ true); } decreaseIndent(); @@ -33368,7 +33806,7 @@ var ts; emitToken(16 /* CloseBraceToken */, node.statements.end); } function emitEmbeddedStatement(node) { - if (node.kind === 194 /* Block */) { + if (node.kind === 195 /* Block */) { write(" "); emit(node); } @@ -33380,7 +33818,7 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 176 /* ArrowFunction */); + emitParenthesizedIf(node.expression, /*parenthesized*/ node.expression.kind === 177 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { @@ -33393,7 +33831,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(80 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 198 /* IfStatement */) { + if (node.elseStatement.kind === 199 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -33413,7 +33851,7 @@ var ts; else { emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true); } - if (node.statement.kind === 194 /* Block */) { + if (node.statement.kind === 195 /* Block */) { write(" "); } else { @@ -33442,7 +33880,7 @@ var ts; * Returns false if nothing was written - this can happen for source file level variable declarations * in system modules where such variable declarations are hoisted. */ - function tryEmitStartOfVariableDeclarationList(decl, startPos) { + function tryEmitStartOfVariableDeclarationList(decl) { if (shouldHoistVariable(decl, /*checkIfSourceFileLevelDecl*/ true)) { // variables in variable declaration list were already hoisted return false; @@ -33456,32 +33894,23 @@ var ts; } return false; } - var tokenKind = 102 /* VarKeyword */; + emitStart(decl); if (decl && languageVersion >= 2 /* ES6 */) { if (ts.isLet(decl)) { - tokenKind = 108 /* LetKeyword */; + write("let "); } else if (ts.isConst(decl)) { - tokenKind = 74 /* ConstKeyword */; + write("const "); + } + else { + write("var "); } - } - if (startPos !== undefined) { - emitToken(tokenKind, startPos); - write(" "); } else { - switch (tokenKind) { - case 102 /* VarKeyword */: - write("var "); - break; - case 108 /* LetKeyword */: - write("let "); - break; - case 74 /* ConstKeyword */: - write("const "); - break; - } + write("var "); } + // Note here we specifically dont emit end so that if we are going to emit binding pattern + // we can alter the source map correctly return true; } function emitVariableDeclarationListSkippingUninitializedEntries(list) { @@ -33512,7 +33941,7 @@ var ts; } else { var loop = convertLoopBody(node); - if (node.parent.kind === 209 /* LabeledStatement */) { + if (node.parent.kind === 210 /* LabeledStatement */) { // if parent of the loop was labeled statement - attach the label to loop skipping converted loop body emitLabelAndColon(node.parent); } @@ -33523,10 +33952,11 @@ var ts; var functionName = makeUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + var initializer = node.initializer; + if (initializer && initializer.kind === 215 /* VariableDeclarationList */) { loopInitializer = node.initializer; } break; @@ -33540,7 +33970,7 @@ var ts; collectNames(varDeclaration.name); } } - var bodyIsBlock = node.statement.kind === 194 /* Block */; + var bodyIsBlock = node.statement.kind === 195 /* Block */; var paramList = loopParameters ? loopParameters.join(", ") : ""; writeLine(); write("var " + functionName + " = function(" + paramList + ")"); @@ -33661,7 +34091,7 @@ var ts; if (emitAsEmbeddedStatement) { emitEmbeddedStatement(node.statement); } - else if (node.statement.kind === 194 /* Block */) { + else if (node.statement.kind === 195 /* Block */) { emitLines(node.statement.statements); } else { @@ -33771,9 +34201,9 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer && node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 215 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; - var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList); if (startIsEmitted) { emitCommaList(variableDeclarationList.declarations); } @@ -33797,7 +34227,7 @@ var ts; } } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 /* ES6 */ && node.kind === 203 /* ForOfStatement */) { + if (languageVersion < 2 /* ES6 */ && node.kind === 204 /* ForOfStatement */) { emitLoop(node, emitDownLevelForOfStatementWorker); } else { @@ -33808,17 +34238,17 @@ var ts; var endPos = emitToken(86 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(17 /* OpenParenToken */, endPos); - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + tryEmitStartOfVariableDeclarationList(variableDeclarationList); emit(variableDeclarationList.declarations[0]); } } else { emit(node.initializer); } - if (node.kind === 202 /* ForInStatement */) { + if (node.kind === 203 /* ForInStatement */) { write(" in "); } else { @@ -33887,18 +34317,18 @@ var ts; emitEnd(node.expression); write("; "); // _i < _a.length; - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write(" < "); emitNodeWithCommentsAndWithoutSourcemap(rhsReference); write(".length"); - emitEnd(node.initializer); + emitEnd(node.expression); write("; "); // _i++) - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write("++"); - emitEnd(node.initializer); + emitEnd(node.expression); emitToken(18 /* CloseParenToken */, node.expression.end); // Body write(" {"); @@ -33908,7 +34338,7 @@ var ts; // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 214 /* VariableDeclarationList */) { + if (node.initializer.kind === 215 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -33938,7 +34368,7 @@ var ts; // Initializer is an expression. Emit the expression in the body, so that it's // evaluated on every iteration. var assignmentExpression = createBinaryExpression(node.initializer, 56 /* EqualsToken */, rhsIterationValue, /*startsOnNewLine*/ false); - if (node.initializer.kind === 166 /* ArrayLiteralExpression */ || node.initializer.kind === 167 /* ObjectLiteralExpression */) { + if (node.initializer.kind === 167 /* ArrayLiteralExpression */ || node.initializer.kind === 168 /* ObjectLiteralExpression */) { // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined); @@ -33966,12 +34396,12 @@ var ts; // it is possible if either // - break\continue is statement labeled and label is located inside the converted loop // - break\continue is non-labeled and located in non-converted loop\switch statement - var jump = node.kind === 205 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 206 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { if (!node.label) { - if (node.kind === 205 /* BreakStatement */) { + if (node.kind === 206 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; write("return \"break\";"); } @@ -33982,7 +34412,7 @@ var ts; } else { var labelMarker; - if (node.kind === 205 /* BreakStatement */) { + if (node.kind === 206 /* BreakStatement */) { labelMarker = "break-" + node.label.text; setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker); } @@ -33995,7 +34425,7 @@ var ts; return; } } - emitToken(node.kind === 205 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 206 /* BreakStatement */ ? 70 /* BreakKeyword */ : 75 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -34061,7 +34491,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap(currentLineMap, ts.skipTrivia(currentText, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 243 /* CaseClause */) { + if (node.kind === 244 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -34130,7 +34560,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 220 /* ModuleDeclaration */); + } while (node && node.kind !== 221 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -34155,13 +34585,13 @@ var ts; function createVoidZero() { var zero = ts.createSynthesizedNode(8 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(179 /* VoidExpression */); + var result = ts.createSynthesizedNode(180 /* VoidExpression */); result.expression = zero; return result; } function emitEs6ExportDefaultCompat(node) { - if (node.parent.kind === 250 /* SourceFile */) { - ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 229 /* ExportAssignment */); + if (node.parent.kind === 251 /* SourceFile */) { + ts.Debug.assert(!!(node.flags & 512 /* Default */) || node.kind === 230 /* ExportAssignment */); // only allow export default at a source file level if (modulekind === 1 /* CommonJS */ || modulekind === 2 /* AMD */ || modulekind === 3 /* UMD */) { if (!isEs6Module) { @@ -34257,7 +34687,7 @@ var ts; * @param value an expression as a right-hand-side operand of the assignment * @param shouldEmitCommaBeforeAssignment a boolean indicating whether to prefix an assignment with comma */ - function emitAssignment(name, value, shouldEmitCommaBeforeAssignment) { + function emitAssignment(name, value, shouldEmitCommaBeforeAssignment, nodeForSourceMap) { if (shouldEmitCommaBeforeAssignment) { write(", "); } @@ -34267,15 +34697,21 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(name); write("\", "); } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 213 /* VariableDeclaration */ || name.parent.kind === 165 /* BindingElement */); - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } - write(" = "); - emit(value); + var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 214 /* VariableDeclaration */ || name.parent.kind === 166 /* BindingElement */); + // If this is first var declaration, we need to start at var/let/const keyword instead + // otherwise use nodeForSourceMap as the start position + emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap); + withTemporaryNoSourceMap(function () { + if (isVariableDeclarationOrBindingElement) { + emitModuleMemberName(name.parent); + } + else { + emit(name); + } + write(" = "); + emit(value); + }); + emitEnd(nodeForSourceMap, /*stopOverridingSpan*/ true); if (exportChanged) { write(")"); } @@ -34286,14 +34722,19 @@ var ts; * @param canDefineTempVariablesInPlace a boolean indicating whether you can define the temporary variable at an assignment location * @param shouldEmitCommaBeforeAssignment a boolean indicating whether an assignment should prefix with comma */ - function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment) { + function emitTempVariableAssignment(expression, canDefineTempVariablesInPlace, shouldEmitCommaBeforeAssignment, sourceMapNode) { var identifier = createTempVariable(0 /* Auto */); if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); + emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment, sourceMapNode || expression.parent); return identifier; } + function isFirstVariableDeclaration(root) { + return root.kind === 214 /* VariableDeclaration */ && + root.parent.kind === 215 /* VariableDeclarationList */ && + root.parent.declarations[0] === root; + } function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; // An exported declaration is actually emitted as an assignment (to a property on the module object), so @@ -34301,19 +34742,24 @@ var ts; // Also temporary variables should be explicitly allocated for source level declarations when module target is system // because actual variable declarations are hoisted var canDefineTempVariablesInPlace = false; - if (root.kind === 213 /* VariableDeclaration */) { + if (root.kind === 214 /* VariableDeclaration */) { var isExported = ts.getCombinedNodeFlags(root) & 2 /* Export */; var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; } - else if (root.kind === 138 /* Parameter */) { + else if (root.kind === 139 /* Parameter */) { canDefineTempVariablesInPlace = true; } - if (root.kind === 183 /* BinaryExpression */) { + if (root.kind === 184 /* BinaryExpression */) { emitAssignmentExpression(root); } else { ts.Debug.assert(!isAssignmentExpressionStatement); + // If first variable declaration of variable statement correct the start location + if (isFirstVariableDeclaration(root)) { + // Use emit location of "var " as next emit start entry + sourceMap.changeEmitSourcePos(); + } emitBindingElement(root, value); } /** @@ -34325,27 +34771,28 @@ var ts; * @param reuseIdentifierExpressions true if identifier expressions can simply be returned; * false if it is necessary to always emit an identifier. */ - function ensureIdentifier(expr, reuseIdentifierExpressions) { + function ensureIdentifier(expr, reuseIdentifierExpressions, sourceMapNode) { if (expr.kind === 69 /* Identifier */ && reuseIdentifierExpressions) { return expr; } - var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0); + var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0, sourceMapNode); emitCount++; return identifier; } - function createDefaultValueCheck(value, defaultValue) { + function createDefaultValueCheck(value, defaultValue, sourceMapNode) { // The value expression will be evaluated twice, so for anything but a simple identifier // we need to generate a temporary variable - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // If the temporary variable needs to be emitted use the source Map node for assignment of that statement + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); // Return the expression 'value === void 0 ? defaultValue : value' - var equals = ts.createSynthesizedNode(183 /* BinaryExpression */); + var equals = ts.createSynthesizedNode(184 /* BinaryExpression */); equals.left = value; equals.operatorToken = ts.createSynthesizedNode(32 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(184 /* ConditionalExpression */); + var cond = ts.createSynthesizedNode(185 /* ConditionalExpression */); cond.condition = condition; cond.questionToken = ts.createSynthesizedNode(53 /* QuestionToken */); cond.whenTrue = whenTrue; @@ -34360,9 +34807,10 @@ var ts; } function createPropertyAccessForDestructuringProperty(object, propName) { var index; - var nameIsComputed = propName.kind === 136 /* ComputedPropertyName */; + var nameIsComputed = propName.kind === 137 /* ComputedPropertyName */; if (nameIsComputed) { - index = ensureIdentifier(propName.expression, /*reuseIdentifierExpressions*/ false); + // TODO to handle when we look into sourcemaps for computed properties, for now use propName + index = ensureIdentifier(propName.expression, /*reuseIdentifierExpressions*/ false, propName); } else { // We create a synthetic copy of the identifier in order to avoid the rewriting that might @@ -34375,7 +34823,7 @@ var ts; : createElementAccessExpression(object, index); } function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(170 /* CallExpression */); + var call = ts.createSynthesizedNode(171 /* CallExpression */); var sliceIdentifier = ts.createSynthesizedNode(69 /* Identifier */); sliceIdentifier.text = "slice"; call.expression = createPropertyAccessExpression(value, sliceIdentifier); @@ -34383,60 +34831,65 @@ var ts; call.arguments[0] = createNumericLiteral(sliceIndex); return call; } - function emitObjectLiteralAssignment(target, value) { + function emitObjectLiteralAssignment(target, value, sourceMapNode) { var properties = target.properties; if (properties.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (var _a = 0, properties_5 = properties; _a < properties_5.length; _a++) { var p = properties_5[_a]; - if (p.kind === 247 /* PropertyAssignment */ || p.kind === 248 /* ShorthandPropertyAssignment */) { + if (p.kind === 248 /* PropertyAssignment */ || p.kind === 249 /* ShorthandPropertyAssignment */) { var propName = p.name; - var target_1 = p.kind === 248 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; - emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName)); + var target_1 = p.kind === 249 /* ShorthandPropertyAssignment */ ? p : p.initializer || propName; + // Assignment for target = value.propName should highligh whole property, hence use p as source map node + emitDestructuringAssignment(target_1, createPropertyAccessForDestructuringProperty(value, propName), p); } } } - function emitArrayLiteralAssignment(target, value) { + function emitArrayLiteralAssignment(target, value, sourceMapNode) { var elements = target.elements; if (elements.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 189 /* OmittedExpression */) { - if (e.kind !== 187 /* SpreadElementExpression */) { - emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); + if (e.kind !== 190 /* OmittedExpression */) { + // Assignment for target = value.propName should highligh whole property, hence use e as source map node + if (e.kind !== 188 /* SpreadElementExpression */) { + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)), e); } else if (i === elements.length - 1) { - emitDestructuringAssignment(e.expression, createSliceCall(value, i)); + emitDestructuringAssignment(e.expression, createSliceCall(value, i), e); } } } } - function emitDestructuringAssignment(target, value) { - if (target.kind === 248 /* ShorthandPropertyAssignment */) { + function emitDestructuringAssignment(target, value, sourceMapNode) { + // When emitting target = value use source map node to highlight, including any temporary assignments needed for this + if (target.kind === 249 /* ShorthandPropertyAssignment */) { if (target.objectAssignmentInitializer) { - value = createDefaultValueCheck(value, target.objectAssignmentInitializer); + value = createDefaultValueCheck(value, target.objectAssignmentInitializer, sourceMapNode); } target = target.name; } - else if (target.kind === 183 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { - value = createDefaultValueCheck(value, target.right); + else if (target.kind === 184 /* BinaryExpression */ && target.operatorToken.kind === 56 /* EqualsToken */) { + value = createDefaultValueCheck(value, target.right, sourceMapNode); target = target.left; } - if (target.kind === 167 /* ObjectLiteralExpression */) { - emitObjectLiteralAssignment(target, value); + if (target.kind === 168 /* ObjectLiteralExpression */) { + emitObjectLiteralAssignment(target, value, sourceMapNode); } - else if (target.kind === 166 /* ArrayLiteralExpression */) { - emitArrayLiteralAssignment(target, value); + else if (target.kind === 167 /* ArrayLiteralExpression */) { + emitArrayLiteralAssignment(target, value, sourceMapNode); } else { - emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, sourceMapNode); emitCount++; } } @@ -34447,25 +34900,32 @@ var ts; emit(value); } else if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + // Source map node for root.left = root.right is root + // but if root is synthetic, which could be in below case, use the target which is { a } + // for ({a} of {a: string}) { + // } + emitDestructuringAssignment(target, value, ts.nodeIsSynthesized(root) ? target : root); } else { - if (root.parent.kind !== 174 /* ParenthesizedExpression */) { + if (root.parent.kind !== 175 /* ParenthesizedExpression */) { write("("); } - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); - emitDestructuringAssignment(target, value); + // Temporary assignment needed to emit root should highlight whole binary expression + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, root); + // Source map node for root.left = root.right is root + emitDestructuringAssignment(target, value, root); write(", "); emit(value); - if (root.parent.kind !== 174 /* ParenthesizedExpression */) { + if (root.parent.kind !== 175 /* ParenthesizedExpression */) { write(")"); } } } function emitBindingElement(target, value) { + // Any temporary assignments needed to emit target = value should point to target if (target.initializer) { // Combine value and initializer - value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; + value = value ? createDefaultValueCheck(value, target.initializer, target) : target.initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer @@ -34480,16 +34940,16 @@ var ts; // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, // so in that case, we'll intentionally create that temporary. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0); + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0, target); } for (var i = 0; i < numElements; i++) { var element = elements[i]; - if (pattern.kind === 163 /* ObjectBindingPattern */) { + if (pattern.kind === 164 /* ObjectBindingPattern */) { // Rewrite element to a declaration with an initializer that fetches property var propName = element.propertyName || element.name; emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 189 /* OmittedExpression */) { + else if (element.kind !== 190 /* OmittedExpression */) { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); @@ -34501,7 +34961,7 @@ var ts; } } else { - emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, target); emitCount++; } } @@ -34529,8 +34989,8 @@ var ts; (getCombinedFlagsForIdentifier(node.name) & 8192 /* Let */); // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isLetDefinedInLoop && - node.parent.parent.kind !== 202 /* ForInStatement */ && - node.parent.parent.kind !== 203 /* ForOfStatement */) { + node.parent.parent.kind !== 203 /* ForInStatement */ && + node.parent.parent.kind !== 204 /* ForOfStatement */) { initializer = createVoidZero(); } } @@ -34548,7 +35008,7 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 189 /* OmittedExpression */) { + if (node.kind === 190 /* OmittedExpression */) { return; } var name = node.name; @@ -34560,7 +35020,7 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 213 /* VariableDeclaration */ && node.parent.kind !== 165 /* BindingElement */)) { + if (!node.parent || (node.parent.kind !== 214 /* VariableDeclaration */ && node.parent.kind !== 166 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); @@ -34568,7 +35028,7 @@ var ts; function isES6ExportedDeclaration(node) { return !!(node.flags & 2 /* Export */) && modulekind === 5 /* ES6 */ && - node.parent.kind === 250 /* SourceFile */; + node.parent.kind === 251 /* SourceFile */; } function emitVariableStatement(node) { var startIsEmitted = false; @@ -34619,12 +35079,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2 /* ES6 */) { if (ts.isBindingPattern(node.name)) { - var name_23 = createTempVariable(0 /* Auto */); + var name_26 = createTempVariable(0 /* Auto */); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_23); - emit(name_23); + tempParameters.push(name_26); + emit(name_26); } else { emit(node.name); @@ -34729,12 +35189,12 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 145 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 146 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 176 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; + return node.kind === 177 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } function emitDeclarationName(node) { if (node.name) { @@ -34745,11 +35205,11 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 175 /* FunctionExpression */) { + if (node.kind === 176 /* FunctionExpression */) { // Emit name if one is present return !!node.name; } - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { // Emit name if one is present, or emit generated name in down-level case (for export default case) return !!node.name || modulekind !== 5 /* ES6 */; } @@ -34761,12 +35221,12 @@ var ts; // TODO (yuisu) : we should not have special cases to condition emitting comments // but have one place to fix check for these conditions. var kind = node.kind, parent = node.parent; - if (kind !== 143 /* MethodDeclaration */ && - kind !== 142 /* MethodSignature */ && + if (kind !== 144 /* MethodDeclaration */ && + kind !== 143 /* MethodSignature */ && parent && - parent.kind !== 247 /* PropertyAssignment */ && - parent.kind !== 170 /* CallExpression */ && - parent.kind !== 166 /* ArrayLiteralExpression */) { + parent.kind !== 248 /* PropertyAssignment */ && + parent.kind !== 171 /* CallExpression */ && + parent.kind !== 167 /* ArrayLiteralExpression */) { // 1. Methods will emit comments at their assignment declaration sites. // // 2. If the function is a property of object literal, emitting leading-comments @@ -34805,11 +35265,11 @@ var ts; emitDeclarationName(node); } emitSignatureAndBody(node); - if (modulekind !== 5 /* ES6 */ && kind === 215 /* FunctionDeclaration */ && parent === currentSourceFile && node.name) { + if (modulekind !== 5 /* ES6 */ && kind === 216 /* FunctionDeclaration */ && parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } emitEnd(node); - if (kind !== 143 /* MethodDeclaration */ && kind !== 142 /* MethodSignature */) { + if (kind !== 144 /* MethodDeclaration */ && kind !== 143 /* MethodSignature */) { emitTrailingComments(node); } } @@ -34842,7 +35302,7 @@ var ts; } function emitAsyncFunctionBodyForES6(node) { var promiseConstructor = ts.getEntityNameFromTypeNode(node.type); - var isArrowFunction = node.kind === 176 /* ArrowFunction */; + var isArrowFunction = node.kind === 177 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 4096 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -34961,7 +35421,7 @@ var ts; write(" { }"); } else { - if (node.body.kind === 194 /* Block */) { + if (node.body.kind === 195 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -35020,10 +35480,10 @@ var ts; write(" "); // Unwrap all type assertions. var current = body; - while (current.kind === 173 /* TypeAssertionExpression */) { + while (current.kind === 174 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 167 /* ObjectLiteralExpression */); + emitParenthesizedIf(body, current.kind === 168 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -35097,9 +35557,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 197 /* ExpressionStatement */) { + if (statement && statement.kind === 198 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 170 /* CallExpression */) { + if (expr && expr.kind === 171 /* CallExpression */) { var func = expr.expression; if (func && func.kind === 95 /* SuperKeyword */) { return statement; @@ -35133,7 +35593,7 @@ var ts; emitNodeWithCommentsAndWithoutSourcemap(memberName); write("]"); } - else if (memberName.kind === 136 /* ComputedPropertyName */) { + else if (memberName.kind === 137 /* ComputedPropertyName */) { emitComputedPropertyName(memberName); } else { @@ -35145,7 +35605,7 @@ var ts; var properties = []; for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if (member.kind === 141 /* PropertyDeclaration */ && isStatic === ((member.flags & 64 /* Static */) !== 0) && member.initializer) { + if (member.kind === 142 /* PropertyDeclaration */ && isStatic === ((member.flags & 64 /* Static */) !== 0) && member.initializer) { properties.push(member); } } @@ -35185,11 +35645,11 @@ var ts; } function emitMemberFunctionsForES5AndLower(node) { ts.forEach(node.members, function (member) { - if (member.kind === 193 /* SemicolonClassElement */) { + if (member.kind === 194 /* SemicolonClassElement */) { writeLine(); write(";"); } - else if (member.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) { + else if (member.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */) { if (!member.body) { return emitCommentsOnNotEmittedNode(member); } @@ -35206,7 +35666,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 145 /* GetAccessor */ || member.kind === 146 /* SetAccessor */) { + else if (member.kind === 146 /* GetAccessor */ || member.kind === 147 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -35256,22 +35716,22 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) && !member.body) { + if ((member.kind === 144 /* MethodDeclaration */ || node.kind === 143 /* MethodSignature */) && !member.body) { emitCommentsOnNotEmittedNode(member); } - else if (member.kind === 143 /* MethodDeclaration */ || - member.kind === 145 /* GetAccessor */ || - member.kind === 146 /* SetAccessor */) { + else if (member.kind === 144 /* MethodDeclaration */ || + member.kind === 146 /* GetAccessor */ || + member.kind === 147 /* SetAccessor */) { writeLine(); emitLeadingComments(member); emitStart(member); if (member.flags & 64 /* Static */) { write("static "); } - if (member.kind === 145 /* GetAccessor */) { + if (member.kind === 146 /* GetAccessor */) { write("get "); } - else if (member.kind === 146 /* SetAccessor */) { + else if (member.kind === 147 /* SetAccessor */) { write("set "); } if (member.asteriskToken) { @@ -35282,7 +35742,7 @@ var ts; emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 193 /* SemicolonClassElement */) { + else if (member.kind === 194 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -35311,11 +35771,11 @@ var ts; var hasInstancePropertyWithInitializer = false; // Emit the constructor overload pinned comments ts.forEach(node.members, function (member) { - if (member.kind === 144 /* Constructor */ && !member.body) { + if (member.kind === 145 /* Constructor */ && !member.body) { emitCommentsOnNotEmittedNode(member); } // Check if there is any non-static property assignment - if (member.kind === 141 /* PropertyDeclaration */ && member.initializer && (member.flags & 64 /* Static */) === 0) { + if (member.kind === 142 /* PropertyDeclaration */ && member.initializer && (member.flags & 64 /* Static */) === 0) { hasInstancePropertyWithInitializer = true; } }); @@ -35429,7 +35889,7 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { if (thisNodeIsDecorated) { // To preserve the correct runtime semantics when decorators are applied to the class, // the emit needs to follow one of the following rules: @@ -35506,7 +35966,7 @@ var ts; // This keeps the expression as an expression, while ensuring that the static parts // of it have been initialized by the time it is used. var staticProperties = getInitializedProperties(node, /*isStatic*/ true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 188 /* ClassExpression */; + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 189 /* ClassExpression */; var tempVariable; if (isClassExpressionWithStaticProperties) { tempVariable = createAndRecordTempVariable(0 /* Auto */); @@ -35588,7 +36048,7 @@ var ts; write(";"); } } - else if (node.parent.kind !== 250 /* SourceFile */) { + else if (node.parent.kind !== 251 /* SourceFile */) { writeLine(); emitStart(node); emitModuleMemberName(node); @@ -35600,7 +36060,7 @@ var ts; } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { // source file level classes in system modules are hoisted so 'var's for them are already defined if (!shouldHoistDeclarationInSystemJsModule(node)) { write("var "); @@ -35661,11 +36121,11 @@ var ts; emit(baseTypeNode.expression); } write("))"); - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { emitExportMemberAssignment(node); } } @@ -35749,7 +36209,7 @@ var ts; else { decorators = member.decorators; // we only decorate the parameters here if this is a method - if (member.kind === 143 /* MethodDeclaration */) { + if (member.kind === 144 /* MethodDeclaration */) { functionLikeMember = member; } } @@ -35806,7 +36266,7 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); if (languageVersion > 0 /* ES3 */) { - if (member.kind !== 141 /* PropertyDeclaration */) { + if (member.kind !== 142 /* PropertyDeclaration */) { // We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly. // We have this extra argument here so that we can inject an explicit property descriptor at a later date. write(", null"); @@ -35848,10 +36308,10 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 143 /* MethodDeclaration */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 141 /* PropertyDeclaration */: + case 144 /* MethodDeclaration */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 142 /* PropertyDeclaration */: return true; } return false; @@ -35861,7 +36321,7 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 143 /* MethodDeclaration */: + case 144 /* MethodDeclaration */: return true; } return false; @@ -35871,9 +36331,9 @@ var ts; // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata // compiler option is set. switch (node.kind) { - case 216 /* ClassDeclaration */: - case 143 /* MethodDeclaration */: - case 146 /* SetAccessor */: + case 217 /* ClassDeclaration */: + case 144 /* MethodDeclaration */: + case 147 /* SetAccessor */: return true; } return false; @@ -35891,19 +36351,19 @@ var ts; // // For rules on serializing type annotations, see `serializeTypeNode`. switch (node.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: write("Function"); return; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: emitSerializedTypeNode(node.type); return; - case 138 /* Parameter */: + case 139 /* Parameter */: emitSerializedTypeNode(node.type); return; - case 145 /* GetAccessor */: + case 146 /* GetAccessor */: emitSerializedTypeNode(node.type); return; - case 146 /* SetAccessor */: + case 147 /* SetAccessor */: emitSerializedTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); return; } @@ -35919,23 +36379,23 @@ var ts; case 103 /* VoidKeyword */: write("void 0"); return; - case 160 /* ParenthesizedType */: + case 161 /* ParenthesizedType */: emitSerializedTypeNode(node.type); return; - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: write("Function"); return; - case 156 /* ArrayType */: - case 157 /* TupleType */: + case 157 /* ArrayType */: + case 158 /* TupleType */: write("Array"); return; - case 150 /* TypePredicate */: + case 151 /* TypePredicate */: case 120 /* BooleanKeyword */: write("Boolean"); return; case 130 /* StringKeyword */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: write("String"); return; case 128 /* NumberKeyword */: @@ -35944,15 +36404,15 @@ var ts; case 131 /* SymbolKeyword */: write("Symbol"); return; - case 151 /* TypeReference */: + case 152 /* TypeReference */: emitSerializedTypeReferenceNode(node); return; - case 154 /* TypeQuery */: - case 155 /* TypeLiteral */: - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 155 /* TypeQuery */: + case 156 /* TypeLiteral */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: case 117 /* AnyKeyword */: - case 161 /* ThisType */: + case 162 /* ThisType */: break; default: ts.Debug.fail("Cannot serialize unexpected type node."); @@ -36025,7 +36485,7 @@ var ts; // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. if (node) { var valueDeclaration; - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { valueDeclaration = ts.getFirstConstructorWithBody(node); } else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { @@ -36041,10 +36501,10 @@ var ts; } if (parameters[i].dotDotDotToken) { var parameterType = parameters[i].type; - if (parameterType.kind === 156 /* ArrayType */) { + if (parameterType.kind === 157 /* ArrayType */) { parameterType = parameterType.elementType; } - else if (parameterType.kind === 151 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { + else if (parameterType.kind === 152 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { parameterType = parameterType.typeArguments[0]; } else { @@ -36121,7 +36581,7 @@ var ts; if (!shouldHoistDeclarationInSystemJsModule(node)) { // do not emit var if variable was already hoisted var isES6ExportedEnum = isES6ExportedDeclaration(node); - if (!(node.flags & 2 /* Export */) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 219 /* EnumDeclaration */))) { + if (!(node.flags & 2 /* Export */) || (isES6ExportedEnum && isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220 /* EnumDeclaration */))) { emitStart(node); if (isES6ExportedEnum) { write("export "); @@ -36203,7 +36663,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 221 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -36227,7 +36687,7 @@ var ts; var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); if (emitVarForModule) { var isES6ExportedNamespace = isES6ExportedDeclaration(node); - if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 220 /* ModuleDeclaration */)) { + if (!isES6ExportedNamespace || isFirstDeclarationOfKind(node, node.symbol && node.symbol.declarations, 221 /* ModuleDeclaration */)) { emitStart(node); if (isES6ExportedNamespace) { write("export "); @@ -36245,7 +36705,7 @@ var ts; write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 221 /* ModuleBlock */) { + if (node.body.kind === 222 /* ModuleBlock */) { var saveConvertedLoopState = convertedLoopState; var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; @@ -36321,16 +36781,16 @@ var ts; } } function getNamespaceDeclarationNode(node) { - if (node.kind === 223 /* ImportEqualsDeclaration */) { + if (node.kind === 224 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 227 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 224 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; + return node.kind === 225 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -36358,7 +36818,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 227 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -36384,7 +36844,7 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 223 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; + var isExportedImport = node.kind === 224 /* ImportEqualsDeclaration */ && (node.flags & 2 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); if (modulekind !== 2 /* AMD */) { emitLeadingComments(node); @@ -36403,7 +36863,7 @@ var ts; // import { x, y } from "foo" // import d, * as x from "foo" // import d, { x, y } from "foo" - var isNakedImport = 224 /* ImportDeclaration */ && !node.importClause; + var isNakedImport = 225 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -36582,8 +37042,8 @@ var ts; write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 215 /* FunctionDeclaration */ && - expression.kind !== 216 /* ClassDeclaration */) { + if (expression.kind !== 216 /* FunctionDeclaration */ && + expression.kind !== 217 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -36620,7 +37080,7 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, /*checkChildren*/ true)) { // import "mod" @@ -36630,13 +37090,13 @@ var ts; externalImports.push(node); } break; - case 223 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 234 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + case 224 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 235 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -36654,12 +37114,12 @@ var ts; // export { x, y } for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { var specifier = _d[_c]; - var name_24 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); + var name_27 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_27] || (exportSpecifiers[name_27] = [])).push(specifier); } } break; - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; @@ -36685,18 +37145,18 @@ var ts; if (namespaceDeclaration && !isDefaultImport(node)) { return ts.getTextOfNodeFromSourceText(currentText, namespaceDeclaration.name); } - if (node.kind === 224 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 225 /* ImportDeclaration */ && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === 230 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 231 /* ExportDeclaration */ && node.moduleSpecifier) { return getGeneratedNameForNode(node); } } function getExternalModuleNameText(importNode, emitRelativePathAsModuleName) { if (emitRelativePathAsModuleName) { - var name_25 = getExternalModuleNameFromDeclaration(host, resolver, importNode); - if (name_25) { - return "\"" + name_25 + "\""; + var name_28 = getExternalModuleNameFromDeclaration(host, resolver, importNode); + if (name_28) { + return "\"" + name_28 + "\""; } } var moduleName = ts.getExternalModuleName(importNode); @@ -36714,8 +37174,8 @@ var ts; for (var _a = 0, externalImports_1 = externalImports; _a < externalImports_1.length; _a++) { var importNode = externalImports_1[_a]; // do not create variable declaration for exports and imports that lack import clause - var skipNode = importNode.kind === 230 /* ExportDeclaration */ || - (importNode.kind === 224 /* ImportDeclaration */ && !importNode.importClause); + var skipNode = importNode.kind === 231 /* ExportDeclaration */ || + (importNode.kind === 225 /* ImportDeclaration */ && !importNode.importClause); if (skipNode) { continue; } @@ -36748,7 +37208,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _a = 0, externalImports_2 = externalImports; _a < externalImports_2.length; _a++) { var externalImport = externalImports_2[_a]; - if (externalImport.kind === 230 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 231 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -36780,7 +37240,7 @@ var ts; } for (var _d = 0, externalImports_3 = externalImports; _d < externalImports_3.length; _d++) { var externalImport = externalImports_3[_d]; - if (externalImport.kind !== 230 /* ExportDeclaration */) { + if (externalImport.kind !== 231 /* ExportDeclaration */) { continue; } var exportDecl = externalImport; @@ -36868,12 +37328,12 @@ var ts; var seen = {}; for (var i = 0; i < hoistedVars.length; i++) { var local = hoistedVars[i]; - var name_26 = local.kind === 69 /* Identifier */ + var name_29 = local.kind === 69 /* Identifier */ ? local : local.name; - if (name_26) { + if (name_29) { // do not emit duplicate entries (in case of declaration merging) in the list of hoisted variables - var text = ts.unescapeIdentifier(name_26.text); + var text = ts.unescapeIdentifier(name_29.text); if (ts.hasProperty(seen, text)) { continue; } @@ -36884,7 +37344,7 @@ var ts; if (i !== 0) { write(", "); } - if (local.kind === 216 /* ClassDeclaration */ || local.kind === 220 /* ModuleDeclaration */ || local.kind === 219 /* EnumDeclaration */) { + if (local.kind === 217 /* ClassDeclaration */ || local.kind === 221 /* ModuleDeclaration */ || local.kind === 220 /* EnumDeclaration */) { emitDeclarationName(local); } else { @@ -36918,21 +37378,21 @@ var ts; if (node.flags & 4 /* Ambient */) { return; } - if (node.kind === 215 /* FunctionDeclaration */) { + if (node.kind === 216 /* FunctionDeclaration */) { if (!hoistedFunctionDeclarations) { hoistedFunctionDeclarations = []; } hoistedFunctionDeclarations.push(node); return; } - if (node.kind === 216 /* ClassDeclaration */) { + if (node.kind === 217 /* ClassDeclaration */) { if (!hoistedVars) { hoistedVars = []; } hoistedVars.push(node); return; } - if (node.kind === 219 /* EnumDeclaration */) { + if (node.kind === 220 /* EnumDeclaration */) { if (shouldEmitEnumDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36941,7 +37401,7 @@ var ts; } return; } - if (node.kind === 220 /* ModuleDeclaration */) { + if (node.kind === 221 /* ModuleDeclaration */) { if (shouldEmitModuleDeclaration(node)) { if (!hoistedVars) { hoistedVars = []; @@ -36950,17 +37410,17 @@ var ts; } return; } - if (node.kind === 213 /* VariableDeclaration */ || node.kind === 165 /* BindingElement */) { + if (node.kind === 214 /* VariableDeclaration */ || node.kind === 166 /* BindingElement */) { if (shouldHoistVariable(node, /*checkIfSourceFileLevelDecl*/ false)) { - var name_27 = node.name; - if (name_27.kind === 69 /* Identifier */) { + var name_30 = node.name; + if (name_30.kind === 69 /* Identifier */) { if (!hoistedVars) { hoistedVars = []; } - hoistedVars.push(name_27); + hoistedVars.push(name_30); } else { - ts.forEachChild(name_27, visit); + ts.forEachChild(name_30, visit); } } return; @@ -36991,7 +37451,7 @@ var ts; // if block scoped variables are nested in some another block then // no other functions can use them except ones that are defined at least in the same block return (ts.getCombinedNodeFlags(node) & 24576 /* BlockScoped */) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 250 /* SourceFile */; + ts.getEnclosingBlockScopeContainer(node).kind === 251 /* SourceFile */; } function isCurrentFileSystemExternalModule() { return modulekind === 4 /* System */ && isCurrentFileExternalModule; @@ -37066,21 +37526,21 @@ var ts; var entry = group_1[_a]; var importVariableName = getLocalNameForExternalImport(entry) || ""; switch (entry.kind) { - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // fall-through - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== ""); writeLine(); // save import into the local write(importVariableName + " = " + parameterName + ";"); writeLine(); break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== ""); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -37093,12 +37553,12 @@ var ts; write(exportFunctionForFile + "({"); writeLine(); increaseIndent(); - for (var i_2 = 0, len = entry.exportClause.elements.length; i_2 < len; i_2++) { - if (i_2 !== 0) { + for (var i_1 = 0, len = entry.exportClause.elements.length; i_1 < len; i_1++) { + if (i_1 !== 0) { write(","); writeLine(); } - var e = entry.exportClause.elements[i_2]; + var e = entry.exportClause.elements[i_1]; write("\""); emitNodeWithCommentsAndWithoutSourcemap(e.name); write("\": " + parameterName + "[\""); @@ -37139,10 +37599,10 @@ var ts; // - import declarations are not emitted since they are already handled in setters // - export declarations with module specifiers are not emitted since they were already written in setters // - export declarations without module specifiers are emitted preserving the order - case 215 /* FunctionDeclaration */: - case 224 /* ImportDeclaration */: + case 216 /* FunctionDeclaration */: + case 225 /* ImportDeclaration */: continue; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: if (!statement.moduleSpecifier) { for (var _a = 0, _b = statement.exportClause.elements; _a < _b.length; _a++) { var element = _b[_a]; @@ -37151,7 +37611,7 @@ var ts; } } continue; - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: if (!ts.isInternalModuleImportEqualsDeclaration(statement)) { // - import equals declarations that import external modules are not emitted continue; @@ -37510,22 +37970,22 @@ var ts; if (!compilerOptions.noEmitHelpers) { // Only Emit __extends function when target ES5. // For target ES6 and above, we can emit classDeclaration as is. - if ((languageVersion < 2 /* ES6 */) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */)) { + if ((languageVersion < 2 /* ES6 */) && (!extendsEmitted && node.flags & 4194304 /* HasClassExtends */)) { writeLines(extendsHelper); extendsEmitted = true; } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 16 /* EmitDecorate */) { + if (!decorateEmitted && node.flags & 8388608 /* HasDecorators */) { writeLines(decorateHelper); if (compilerOptions.emitDecoratorMetadata) { writeLines(metadataHelper); } decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 32 /* EmitParam */) { + if (!paramEmitted && node.flags & 16777216 /* HasParamDecorators */) { writeLines(paramHelper); paramEmitted = true; } - if (!awaiterEmitted && resolver.getNodeCheckFlags(node) & 64 /* EmitAwaiter */) { + if (!awaiterEmitted && node.flags & 33554432 /* HasAsyncFunctions */) { writeLines(awaiterHelper); awaiterEmitted = true; } @@ -37596,28 +38056,41 @@ var ts; emitJavaScriptWorker(node); } } + function changeSourceMapEmit(writer) { + sourceMap = writer; + emitStart = writer.emitStart; + emitEnd = writer.emitEnd; + emitPos = writer.emitPos; + setSourceFile = writer.setSourceFile; + } + function withTemporaryNoSourceMap(callback) { + var prevSourceMap = sourceMap; + setSourceMapWriterEmit(ts.getNullSourceMapWriter()); + callback(); + setSourceMapWriterEmit(prevSourceMap); + } function isSpecializedCommentHandling(node) { switch (node.kind) { // All of these entities are emitted in a specialized fashion. As such, we allow // the specialized methods for each to handle the comments on the nodes. - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 229 /* ExportAssignment */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 230 /* ExportAssignment */: return true; } } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: // Only emit the leading/trailing comments for an enum if we're actually // emitting the module as well. return shouldEmitEnumDeclaration(node); @@ -37629,9 +38102,9 @@ var ts; // then we don't want to emit comments when we emit the body. It will have already // been taken care of when we emitted the 'return' statement for the function // expression body. - if (node.kind !== 194 /* Block */ && + if (node.kind !== 195 /* Block */ && node.parent && - node.parent.kind === 176 /* ArrowFunction */ && + node.parent.kind === 177 /* ArrowFunction */ && node.parent.body === node && compilerOptions.target <= 1 /* ES5 */) { return false; @@ -37644,13 +38117,13 @@ var ts; switch (node.kind) { case 69 /* Identifier */: return emitIdentifier(node); - case 138 /* Parameter */: + case 139 /* Parameter */: return emitParameter(node); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return emitMethod(node); - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: return emitAccessor(node); case 97 /* ThisKeyword */: return emitThis(node); @@ -37670,142 +38143,142 @@ var ts; case 13 /* TemplateMiddle */: case 14 /* TemplateTail */: return emitLiteral(node); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: return emitTemplateExpression(node); - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return emitTemplateSpan(node); - case 235 /* JsxElement */: - case 236 /* JsxSelfClosingElement */: + case 236 /* JsxElement */: + case 237 /* JsxSelfClosingElement */: return emitJsxElement(node); - case 238 /* JsxText */: + case 239 /* JsxText */: return emitJsxText(node); - case 242 /* JsxExpression */: + case 243 /* JsxExpression */: return emitJsxExpression(node); - case 135 /* QualifiedName */: + case 136 /* QualifiedName */: return emitQualifiedName(node); - case 163 /* ObjectBindingPattern */: + case 164 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 164 /* ArrayBindingPattern */: + case 165 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 165 /* BindingElement */: + case 166 /* BindingElement */: return emitBindingElement(node); - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 247 /* PropertyAssignment */: + case 248 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 248 /* ShorthandPropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 136 /* ComputedPropertyName */: + case 137 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 168 /* PropertyAccessExpression */: + case 169 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 170 /* CallExpression */: + case 171 /* CallExpression */: return emitCallExpression(node); - case 171 /* NewExpression */: + case 172 /* NewExpression */: return emitNewExpression(node); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: return emit(node.expression); - case 191 /* AsExpression */: + case 192 /* AsExpression */: return emit(node.expression); - case 174 /* ParenthesizedExpression */: + case 175 /* ParenthesizedExpression */: return emitParenExpression(node); - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 177 /* DeleteExpression */: + case 178 /* DeleteExpression */: return emitDeleteExpression(node); - case 178 /* TypeOfExpression */: + case 179 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 179 /* VoidExpression */: + case 180 /* VoidExpression */: return emitVoidExpression(node); - case 180 /* AwaitExpression */: + case 181 /* AwaitExpression */: return emitAwaitExpression(node); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 182 /* PostfixUnaryExpression */: + case 183 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return emitBinaryExpression(node); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return emitConditionalExpression(node); - case 187 /* SpreadElementExpression */: + case 188 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 186 /* YieldExpression */: + case 187 /* YieldExpression */: return emitYieldExpression(node); - case 189 /* OmittedExpression */: + case 190 /* OmittedExpression */: return; - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return emitBlock(node); - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: return emitVariableStatement(node); - case 196 /* EmptyStatement */: + case 197 /* EmptyStatement */: return write(";"); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return emitExpressionStatement(node); - case 198 /* IfStatement */: + case 199 /* IfStatement */: return emitIfStatement(node); - case 199 /* DoStatement */: + case 200 /* DoStatement */: return emitDoStatement(node); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: return emitWhileStatement(node); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return emitForStatement(node); - case 203 /* ForOfStatement */: - case 202 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 203 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 204 /* ContinueStatement */: - case 205 /* BreakStatement */: + case 205 /* ContinueStatement */: + case 206 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: return emitReturnStatement(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: return emitWithStatement(node); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return emitSwitchStatement(node); - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 209 /* LabeledStatement */: + case 210 /* LabeledStatement */: return emitLabeledStatement(node); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: return emitThrowStatement(node); - case 211 /* TryStatement */: + case 212 /* TryStatement */: return emitTryStatement(node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return emitCatchClause(node); - case 212 /* DebuggerStatement */: + case 213 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: return emitClassExpression(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return emitClassDeclaration(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return emitEnumMember(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: return emitImportDeclaration(node); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: return emitExportDeclaration(node); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: return emitExportAssignment(node); - case 250 /* SourceFile */: + case 251 /* SourceFile */: return emitSourceFileNode(node); } } @@ -37844,7 +38317,7 @@ var ts; function getLeadingCommentsToEmit(node) { // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 250 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 251 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); @@ -37859,7 +38332,7 @@ var ts; function getTrailingCommentsToEmit(node) { // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 250 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 251 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentText, node.end); } } @@ -38290,7 +38763,25 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var resolveModuleNamesWorker = host.resolveModuleNames ? (function (moduleNames, containingFile) { return host.resolveModuleNames(moduleNames, containingFile); }) - : (function (moduleNames, containingFile) { return ts.map(moduleNames, function (moduleName) { return resolveModuleName(moduleName, containingFile, options, host).resolvedModule; }); }); + : (function (moduleNames, containingFile) { + var resolvedModuleNames = []; + // resolveModuleName does not store any results between calls. + // lookup is a local cache to avoid resolving the same module name several times + var lookup = {}; + for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { + var moduleName = moduleNames_1[_i]; + var resolvedName = void 0; + if (ts.hasProperty(lookup, moduleName)) { + resolvedName = lookup[moduleName]; + } + else { + resolvedName = resolveModuleName(moduleName, containingFile, options, host).resolvedModule; + lookup[moduleName] = resolvedName; + } + resolvedModuleNames.push(resolvedName); + } + return resolvedModuleNames; + }); var filesByName = ts.createFileMap(); // stores 'filename -> file association' ignoring case // used to track cases when two file names differ only in casing @@ -38408,14 +38899,18 @@ var ts; // tripleslash references has changed return false; } - // check imports + // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed return false; } + if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { + // moduleAugmentations has changed + return false; + } if (resolveModuleNamesWorker) { - var moduleNames = ts.map(newSourceFile.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); // ensure that module resolution results are still correct for (var i = 0; i < moduleNames.length; i++) { @@ -38580,44 +39075,44 @@ var ts; return false; } switch (node.kind) { - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return true; - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return true; - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var classDeclaration = node; if (checkModifiers(classDeclaration.modifiers) || checkTypeParameters(classDeclaration.typeParameters)) { return true; } break; - case 245 /* HeritageClause */: + case 246 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 106 /* ImplementsKeyword */) { diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return true; } break; - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return true; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return true; - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return true; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: - case 215 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: var functionDeclaration = node; if (checkModifiers(functionDeclaration.modifiers) || checkTypeParameters(functionDeclaration.typeParameters) || @@ -38625,20 +39120,20 @@ var ts; return true; } break; - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: var variableStatement = node; if (checkModifiers(variableStatement.modifiers)) { return true; } break; - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: var variableDeclaration = node; if (checkTypeAnnotation(variableDeclaration.type)) { return true; } break; - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: var expression = node; if (expression.typeArguments && expression.typeArguments.length > 0) { var start_2 = expression.typeArguments.pos; @@ -38646,7 +39141,7 @@ var ts; return true; } break; - case 138 /* Parameter */: + case 139 /* Parameter */: var parameter = node; if (parameter.modifiers) { var start_3 = parameter.modifiers.pos; @@ -38662,17 +39157,17 @@ var ts; return true; } break; - case 141 /* PropertyDeclaration */: + case 142 /* PropertyDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); return true; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return true; - case 173 /* TypeAssertionExpression */: + case 174 /* TypeAssertionExpression */: var typeAssertionExpression = node; diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return true; - case 139 /* Decorator */: + case 140 /* Decorator */: diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); return true; } @@ -38750,59 +39245,77 @@ var ts; function moduleNameIsEqualTo(a, b) { return a.text === b.text; } + function getTextOfLiteral(literal) { + return literal.text; + } function collectExternalModuleReferences(file) { if (file.imports) { return; } var isJavaScriptFile = ts.isSourceFileJavaScript(file); + var isExternalModuleFile = ts.isExternalModule(file); var imports; + var moduleAugmentations; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; - collect(node, /*allowRelativeModuleNames*/ true, /*collectOnlyRequireCalls*/ false); + collectModuleReferences(node, /*inAmbientModule*/ false); + if (isJavaScriptFile) { + collectRequireCalls(node); + } } file.imports = imports || emptyArray; + file.moduleAugmentations = moduleAugmentations || emptyArray; return; - function collect(node, allowRelativeModuleNames, collectOnlyRequireCalls) { - if (!collectOnlyRequireCalls) { - switch (node.kind) { - case 224 /* ImportDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 230 /* ExportDeclaration */: - var moduleNameExpr = ts.getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { - break; - } - if (!moduleNameExpr.text) { - break; - } - if (allowRelativeModuleNames || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { - (imports || (imports = [])).push(moduleNameExpr); - } + function collectModuleReferences(node, inAmbientModule) { + switch (node.kind) { + case 225 /* ImportDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 231 /* ExportDeclaration */: + var moduleNameExpr = ts.getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== 9 /* StringLiteral */) { break; - case 220 /* ModuleDeclaration */: - if (node.name.kind === 9 /* StringLiteral */ && (node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { - // TypeScript 1.0 spec (April 2014): 12.1.6 + } + if (!moduleNameExpr.text) { + break; + } + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference other external modules + // only through top - level external module names. Relative external module names are not permitted. + if (!inAmbientModule || !ts.isExternalModuleNameRelative(moduleNameExpr.text)) { + (imports || (imports = [])).push(moduleNameExpr); + } + break; + case 221 /* ModuleDeclaration */: + if (ts.isAmbientModule(node) && (inAmbientModule || node.flags & 4 /* Ambient */ || ts.isDeclarationFile(file))) { + var moduleName = node.name; + // Ambient module declarations can be interpreted as augmentations for some existing external modules. + // This will happen in two cases: + // - if current file is external module then module augmentation is a ambient module declaration defined in the top level scope + // - if current file is not external module then module augmentation is an ambient module declaration with non-relative module name + // immediately nested in top level ambient module declaration . + if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(moduleName.text))) { + (moduleAugmentations || (moduleAugmentations = [])).push(moduleName); + } + else if (!inAmbientModule) { // An AmbientExternalModuleDeclaration declares an external module. // This type of declaration is permitted only in the global module. // The StringLiteral must specify a top - level external module name. // Relative external module names are not permitted - ts.forEachChild(node.body, function (node) { - // TypeScript 1.0 spec (April 2014): 12.1.6 - // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules - // only through top - level external module names. Relative external module names are not permitted. - collect(node, /*allowRelativeModuleNames*/ false, collectOnlyRequireCalls); - }); + // NOTE: body of ambient module is always a module block + for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + collectModuleReferences(statement, /*inAmbientModule*/ true); + } } - break; - } + } } - if (isJavaScriptFile) { - if (ts.isRequireCall(node)) { - (imports || (imports = [])).push(node.arguments[0]); - } - else { - ts.forEachChild(node, function (node) { return collect(node, allowRelativeModuleNames, /*collectOnlyRequireCalls*/ true); }); - } + } + function collectRequireCalls(node) { + if (ts.isRequireCall(node)) { + (imports || (imports = [])).push(node.arguments[0]); + } + else { + ts.forEachChild(node, collectRequireCalls); } } } @@ -38914,14 +39427,21 @@ var ts; } function processImportedModules(file, basePath) { collectExternalModuleReferences(file); - if (file.imports.length) { + if (file.imports.length || file.moduleAugmentations.length) { file.resolvedModules = {}; - var moduleNames = ts.map(file.imports, function (name) { return name.text; }); + var moduleNames = ts.map(ts.concatenate(file.imports, file.moduleAugmentations), getTextOfLiteral); var resolutions = resolveModuleNamesWorker(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (var i = 0; i < file.imports.length; i++) { + for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; ts.setResolvedModule(file, moduleNames[i], resolution); - if (resolution && !options.noResolve) { + // add file to program only if: + // - resolution was successfull + // - noResolve is falsy + // - module name come from the list fo imports + var shouldAddFile = resolution && + !options.noResolve && + i < file.imports.length; + if (shouldAddFile) { var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { // Since currently irrespective of allowJs, we only look for supportedTypeScript extension external module files, @@ -39786,7 +40306,7 @@ var ts; } } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 176 /* ArrowFunction */; + return ts.isFunctionBlock(node) && node.parent.kind !== 177 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -39798,30 +40318,30 @@ var ts; addOutliningForLeadingCommentsForNode(n); } switch (n.kind) { - case 194 /* Block */: + case 195 /* Block */: if (!ts.isFunctionBlock(n)) { - var parent_7 = n.parent; + var parent_8 = n.parent; var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collaps the block, but consider its hint span // to be the entire span of the parent. - if (parent_7.kind === 199 /* DoStatement */ || - parent_7.kind === 202 /* ForInStatement */ || - parent_7.kind === 203 /* ForOfStatement */ || - parent_7.kind === 201 /* ForStatement */ || - parent_7.kind === 198 /* IfStatement */ || - parent_7.kind === 200 /* WhileStatement */ || - parent_7.kind === 207 /* WithStatement */ || - parent_7.kind === 246 /* CatchClause */) { - addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); + if (parent_8.kind === 200 /* DoStatement */ || + parent_8.kind === 203 /* ForInStatement */ || + parent_8.kind === 204 /* ForOfStatement */ || + parent_8.kind === 202 /* ForStatement */ || + parent_8.kind === 199 /* IfStatement */ || + parent_8.kind === 201 /* WhileStatement */ || + parent_8.kind === 208 /* WithStatement */ || + parent_8.kind === 247 /* CatchClause */) { + addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_7.kind === 211 /* TryStatement */) { + if (parent_8.kind === 212 /* TryStatement */) { // Could be the try-block, or the finally-block. - var tryStatement = parent_7; + var tryStatement = parent_8; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_7, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -39844,23 +40364,23 @@ var ts; break; } // Fallthrough. - case 221 /* ModuleBlock */: { + case 222 /* ModuleBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 167 /* ObjectLiteralExpression */: - case 222 /* CaseBlock */: { + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 168 /* ObjectLiteralExpression */: + case 223 /* CaseBlock */: { var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: var openBracket = ts.findChildOfKind(n, 19 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -39890,12 +40410,12 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_28 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_28); + for (var name_31 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_31); if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_28); + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_31); if (!matches) { continue; } @@ -39908,14 +40428,14 @@ var ts; if (!containers) { return undefined; } - matches = patternMatcher.getMatches(containers, name_28); + matches = patternMatcher.getMatches(containers, name_31); if (!matches) { continue; } } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_28, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ name: name_31, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } } @@ -39953,7 +40473,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 136 /* ComputedPropertyName */) { + else if (declaration.name.kind === 137 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ true); } else { @@ -39974,7 +40494,7 @@ var ts; } return true; } - if (expression.kind === 168 /* PropertyAccessExpression */) { + if (expression.kind === 169 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -39987,7 +40507,7 @@ var ts; var containers = []; // First, if we started with a computed property name, then add all but the last // portion into the container array. - if (declaration.name.kind === 136 /* ComputedPropertyName */) { + if (declaration.name.kind === 137 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -40061,17 +40581,17 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // If we have a module declared as A.B.C, it is more "intuitive" // to say it only has a single layer of depth do { current = current.parent; - } while (current.kind === 220 /* ModuleDeclaration */); + } while (current.kind === 221 /* ModuleDeclaration */); // fall through - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -40082,21 +40602,21 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -40108,7 +40628,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 227 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -40117,21 +40637,21 @@ var ts; } } break; - case 165 /* BindingElement */: - case 213 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 214 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } // Fall through - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: - case 220 /* ModuleDeclaration */: - case 215 /* FunctionDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 228 /* ImportSpecifier */: - case 232 /* ExportSpecifier */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: + case 221 /* ModuleDeclaration */: + case 216 /* FunctionDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 229 /* ImportSpecifier */: + case 233 /* ExportSpecifier */: childNodes.push(node); break; } @@ -40179,17 +40699,17 @@ var ts; for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { var node = nodes_4[_i]; switch (node.kind) { - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 218 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -40200,12 +40720,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 215 /* FunctionDeclaration */) { + if (functionDeclaration.kind === 216 /* FunctionDeclaration */) { // A function declaration is 'top level' if it contains any function declarations // within it. - if (functionDeclaration.body && functionDeclaration.body.kind === 194 /* Block */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 195 /* Block */) { // Proper function declarations can only have identifier names - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 215 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 216 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } // Or if it is not parented by another function. i.e all functions @@ -40265,7 +40785,7 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 138 /* Parameter */: + case 139 /* Parameter */: if (ts.isBindingPattern(node.name)) { break; } @@ -40273,36 +40793,36 @@ var ts; return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 145 /* GetAccessor */: + case 146 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 146 /* SetAccessor */: + case 147 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 249 /* EnumMember */: + case 250 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 147 /* CallSignature */: + case 148 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 148 /* ConstructSignature */: + case 149 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: var variableDeclarationNode; - var name_29; - if (node.kind === 165 /* BindingElement */) { - name_29 = node.name; + var name_32; + if (node.kind === 166 /* BindingElement */) { + name_32 = node.name; variableDeclarationNode = node; // binding elements are added only for variable declarations // bubble up to the containing variable declaration - while (variableDeclarationNode && variableDeclarationNode.kind !== 213 /* VariableDeclaration */) { + while (variableDeclarationNode && variableDeclarationNode.kind !== 214 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -40310,24 +40830,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_29 = node.name; + name_32 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_29), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_32), ts.ScriptElementKind.variableElement); } - case 144 /* Constructor */: + case 145 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 232 /* ExportSpecifier */: - case 228 /* ImportSpecifier */: - case 223 /* ImportEqualsDeclaration */: - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: + case 233 /* ExportSpecifier */: + case 229 /* ImportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -40357,29 +40877,29 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 250 /* SourceFile */: + case 251 /* SourceFile */: return createSourceFileItem(node); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: return createClassItem(node); - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: return createEnumItem(node); - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return createModuleItem(node); - case 215 /* FunctionDeclaration */: + case 216 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; function getModuleName(moduleDeclaration) { // We want to maintain quotation marks. - if (moduleDeclaration.name.kind === 9 /* StringLiteral */) { + if (ts.isAmbientModule(moduleDeclaration)) { return getTextOfNode(moduleDeclaration.name); } // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 220 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 221 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -40391,7 +40911,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.body && node.body.kind === 194 /* Block */) { + if (node.body && node.body.kind === 195 /* Block */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -40412,7 +40932,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 144 /* Constructor */ && member; + return member.kind === 145 /* Constructor */ && member; }); // Add the constructor parameters in as children of the class (for property parameters). // Note that *all non-binding pattern named* parameters will be added to the nodes array, but parameters that @@ -40436,7 +40956,7 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 136 /* ComputedPropertyName */; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 137 /* ComputedPropertyName */; }); } /** * Like removeComputedProperties, but retains the properties with well known symbol names @@ -40445,13 +40965,13 @@ var ts; return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 220 /* ModuleDeclaration */) { + while (node.body.kind === 221 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 250 /* SourceFile */ + return node.kind === 251 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -41202,7 +41722,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function createJavaScriptSignatureHelpItems(argumentInfo) { - if (argumentInfo.invocation.kind !== 170 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 171 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. @@ -41210,7 +41730,7 @@ var ts; var expression = callExpression.expression; var name = expression.kind === 69 /* Identifier */ ? expression - : expression.kind === 168 /* PropertyAccessExpression */ + : expression.kind === 169 /* PropertyAccessExpression */ ? expression.name : undefined; if (!name || !name.text) { @@ -41243,7 +41763,7 @@ var ts; * in the argument of an invocation; returns undefined otherwise. */ function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind === 170 /* CallExpression */ || node.parent.kind === 171 /* NewExpression */) { + if (node.parent.kind === 171 /* CallExpression */ || node.parent.kind === 172 /* NewExpression */) { var callExpression = node.parent; // There are 3 cases to handle: // 1. The token introduces a list, and should begin a sig help session @@ -41296,25 +41816,25 @@ var ts; }; } } - else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 172 /* TaggedTemplateExpression */) { + else if (node.kind === 11 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 173 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0); } } - else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 172 /* TaggedTemplateExpression */) { + else if (node.kind === 12 /* TemplateHead */ && node.parent.parent.kind === 173 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 186 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 192 /* TemplateSpan */ && node.parent.parent.parent.kind === 172 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 193 /* TemplateSpan */ && node.parent.parent.parent.kind === 173 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 185 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 186 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 14 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -41432,7 +41952,7 @@ var ts; // // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 185 /* TemplateExpression */) { + if (template.kind === 186 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -41441,7 +41961,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 250 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 251 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -41641,40 +42161,40 @@ var ts; return false; } switch (n.kind) { - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 167 /* ObjectLiteralExpression */: - case 163 /* ObjectBindingPattern */: - case 155 /* TypeLiteral */: - case 194 /* Block */: - case 221 /* ModuleBlock */: - case 222 /* CaseBlock */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 168 /* ObjectLiteralExpression */: + case 164 /* ObjectBindingPattern */: + case 156 /* TypeLiteral */: + case 195 /* Block */: + case 222 /* ModuleBlock */: + case 223 /* CaseBlock */: return nodeEndsWith(n, 16 /* CloseBraceToken */, sourceFile); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 171 /* NewExpression */: + case 172 /* NewExpression */: if (!n.arguments) { return true; } // fall through - case 170 /* CallExpression */: - case 174 /* ParenthesizedExpression */: - case 160 /* ParenthesizedType */: + case 171 /* CallExpression */: + case 175 /* ParenthesizedExpression */: + case 161 /* ParenthesizedType */: return nodeEndsWith(n, 18 /* CloseParenToken */, sourceFile); - case 152 /* FunctionType */: - case 153 /* ConstructorType */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 148 /* ConstructSignature */: - case 147 /* CallSignature */: - case 176 /* ArrowFunction */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 149 /* ConstructSignature */: + case 148 /* CallSignature */: + case 177 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -41684,64 +42204,64 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 18 /* CloseParenToken */, sourceFile); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 198 /* IfStatement */: + case 199 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 23 /* SemicolonToken */); - case 166 /* ArrayLiteralExpression */: - case 164 /* ArrayBindingPattern */: - case 169 /* ElementAccessExpression */: - case 136 /* ComputedPropertyName */: - case 157 /* TupleType */: + case 167 /* ArrayLiteralExpression */: + case 165 /* ArrayBindingPattern */: + case 170 /* ElementAccessExpression */: + case 137 /* ComputedPropertyName */: + case 158 /* TupleType */: return nodeEndsWith(n, 20 /* CloseBracketToken */, sourceFile); - case 149 /* IndexSignature */: + case 150 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 20 /* CloseBracketToken */, sourceFile); - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + case 244 /* CaseClause */: + case 245 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 200 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 201 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 199 /* DoStatement */: + case 200 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; var hasWhileKeyword = findChildOfKind(n, 104 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 18 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 154 /* TypeQuery */: + case 155 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 178 /* TypeOfExpression */: - case 177 /* DeleteExpression */: - case 179 /* VoidExpression */: - case 186 /* YieldExpression */: - case 187 /* SpreadElementExpression */: + case 179 /* TypeOfExpression */: + case 178 /* DeleteExpression */: + case 180 /* VoidExpression */: + case 187 /* YieldExpression */: + case 188 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 172 /* TaggedTemplateExpression */: + case 173 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 185 /* TemplateExpression */: + case 186 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 192 /* TemplateSpan */: + case 193 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 181 /* PrefixUnaryExpression */: + case 182 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 183 /* BinaryExpression */: + case 184 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 184 /* ConditionalExpression */: + case 185 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -41797,7 +42317,7 @@ var ts; // for the position of the relevant node (or comma). var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { // find syntax list that covers the span of the node - if (c.kind === 273 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 274 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -41903,7 +42423,7 @@ var ts; function findPrecedingToken(position, sourceFile, startNode) { return find(startNode || sourceFile); function findRightmostToken(n) { - if (isToken(n) || n.kind === 238 /* JsxText */) { + if (isToken(n) || n.kind === 239 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41911,7 +42431,7 @@ var ts; return candidate && findRightmostToken(candidate); } function find(n) { - if (isToken(n) || n.kind === 238 /* JsxText */) { + if (isToken(n) || n.kind === 239 /* JsxText */) { return n; } var children = n.getChildren(); @@ -41925,10 +42445,10 @@ var ts; // if no - position is in the node itself so we should recurse in it. // NOTE: JsxText is a weird kind of node that can contain only whitespaces (since they are not counted as trivia). // if this is the case - then we should assume that token in question is located in previous child. - if (position < child.end && (nodeHasTokens(child) || child.kind === 238 /* JsxText */)) { + if (position < child.end && (nodeHasTokens(child) || child.kind === 239 /* JsxText */)) { var start = child.getStart(sourceFile); var lookInPreviousChild = (start >= position) || - (child.kind === 238 /* JsxText */ && start === child.end); // whitespace only JsxText + (child.kind === 239 /* JsxText */ && start === child.end); // whitespace only JsxText if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); @@ -41940,7 +42460,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 250 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 251 /* SourceFile */); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -41962,7 +42482,7 @@ var ts; ts.findPrecedingToken = findPrecedingToken; function isInString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); - return token && (token.kind === 9 /* StringLiteral */ || token.kind === 162 /* StringLiteralType */) && position > token.getStart(); + return token && (token.kind === 9 /* StringLiteral */ || token.kind === 163 /* StringLiteralType */) && position > token.getStart(); } ts.isInString = isInString; function isInComment(sourceFile, position) { @@ -42066,17 +42586,17 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 151 /* TypeReference */ || node.kind === 170 /* CallExpression */) { + if (node.kind === 152 /* TypeReference */ || node.kind === 171 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 216 /* ClassDeclaration */ || node.kind === 217 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 217 /* ClassDeclaration */ || node.kind === 218 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 134 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 135 /* LastToken */; } ts.isToken = isToken; function isWord(kind) { @@ -42092,7 +42612,7 @@ var ts; ts.isComment = isComment; function isStringOrRegularExpressionOrTemplateLiteral(kind) { if (kind === 9 /* StringLiteral */ - || kind === 162 /* StringLiteralType */ + || kind === 163 /* StringLiteralType */ || kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(kind)) { return true; @@ -42135,13 +42655,40 @@ var ts; return true; } ts.compareDataObjects = compareDataObjects; + function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { + if (node.kind === 167 /* ArrayLiteralExpression */ || + node.kind === 168 /* ObjectLiteralExpression */) { + // [a,b,c] from: + // [a, b, c] = someExpression; + if (node.parent.kind === 184 /* BinaryExpression */ && + node.parent.left === node && + node.parent.operatorToken.kind === 56 /* EqualsToken */) { + return true; + } + // [a, b, c] from: + // for([a, b, c] of expression) + if (node.parent.kind === 204 /* ForOfStatement */ && + node.parent.initializer === node) { + return true; + } + // [a, b, c] of + // [x, [a, b, c] ] = someExpression + // or + // {x, a: {a, b, c} } = someExpression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 248 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + return true; + } + } + return false; + } + ts.isArrayLiteralOrObjectLiteralDestructuringPattern = isArrayLiteralOrObjectLiteralDestructuringPattern; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 138 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 139 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -42329,7 +42876,7 @@ var ts; ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 228 /* ImportSpecifier */ || location.parent.kind === 232 /* ExportSpecifier */) && + (location.parent.kind === 229 /* ImportSpecifier */ || location.parent.kind === 233 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -42452,10 +42999,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 240 /* JsxAttribute */: - case 237 /* JsxOpeningElement */: - case 239 /* JsxClosingElement */: - case 236 /* JsxSelfClosingElement */: + case 241 /* JsxAttribute */: + case 238 /* JsxOpeningElement */: + case 240 /* JsxClosingElement */: + case 237 /* JsxSelfClosingElement */: return node.kind === 69 /* Identifier */; } } @@ -43059,9 +43606,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_30 in o) { - if (o[name_30] === rule) { - return name_30; + for (var name_33 in o) { + if (o[name_33] === rule) { + return name_33; } } throw new Error("Unknown rule"); @@ -43070,40 +43617,40 @@ var ts; /// Contexts /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 201 /* ForStatement */; + return context.contextNode.kind === 202 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 183 /* BinaryExpression */: - case 184 /* ConditionalExpression */: - case 191 /* AsExpression */: - case 150 /* TypePredicate */: - case 158 /* UnionType */: - case 159 /* IntersectionType */: + case 184 /* BinaryExpression */: + case 185 /* ConditionalExpression */: + case 192 /* AsExpression */: + case 151 /* TypePredicate */: + case 159 /* UnionType */: + case 160 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 165 /* BindingElement */: + case 166 /* BindingElement */: // equals in type X = ... - case 218 /* TypeAliasDeclaration */: + case 219 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 213 /* VariableDeclaration */: + case 214 /* VariableDeclaration */: // equal in p = 0; - case 138 /* Parameter */: - case 249 /* EnumMember */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 139 /* Parameter */: + case 250 /* EnumMember */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return context.currentTokenSpan.kind === 56 /* EqualsToken */ || context.nextTokenSpan.kind === 56 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 202 /* ForInStatement */: + case 203 /* ForInStatement */: return context.currentTokenSpan.kind === 90 /* InKeyword */ || context.nextTokenSpan.kind === 90 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 203 /* ForOfStatement */: - return context.currentTokenSpan.kind === 134 /* OfKeyword */ || context.nextTokenSpan.kind === 134 /* OfKeyword */; + case 204 /* ForOfStatement */: + return context.currentTokenSpan.kind === 135 /* OfKeyword */ || context.nextTokenSpan.kind === 135 /* OfKeyword */; } return false; }; @@ -43111,7 +43658,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 184 /* ConditionalExpression */; + return context.contextNode.kind === 185 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -43155,93 +43702,93 @@ var ts; return true; } switch (node.kind) { - case 194 /* Block */: - case 222 /* CaseBlock */: - case 167 /* ObjectLiteralExpression */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 223 /* CaseBlock */: + case 168 /* ObjectLiteralExpression */: + case 222 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: //case SyntaxKind.MemberFunctionDeclaration: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: ///case SyntaxKind.MethodSignature: - case 147 /* CallSignature */: - case 175 /* FunctionExpression */: - case 144 /* Constructor */: - case 176 /* ArrowFunction */: + case 148 /* CallSignature */: + case 176 /* FunctionExpression */: + case 145 /* Constructor */: + case 177 /* ArrowFunction */: //case SyntaxKind.ConstructorDeclaration: //case SyntaxKind.SimpleArrowFunctionExpression: //case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: return true; } return false; }; Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 215 /* FunctionDeclaration */ || context.contextNode.kind === 175 /* FunctionExpression */; + return context.contextNode.kind === 216 /* FunctionDeclaration */ || context.contextNode.kind === 176 /* FunctionExpression */; }; Rules.IsTypeScriptDeclWithBlockContext = function (context) { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 155 /* TypeLiteral */: - case 220 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 156 /* TypeLiteral */: + case 221 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 216 /* ClassDeclaration */: - case 220 /* ModuleDeclaration */: - case 219 /* EnumDeclaration */: - case 194 /* Block */: - case 246 /* CatchClause */: - case 221 /* ModuleBlock */: - case 208 /* SwitchStatement */: + case 217 /* ClassDeclaration */: + case 221 /* ModuleDeclaration */: + case 220 /* EnumDeclaration */: + case 195 /* Block */: + case 247 /* CatchClause */: + case 222 /* ModuleBlock */: + case 209 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 198 /* IfStatement */: - case 208 /* SwitchStatement */: - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 200 /* WhileStatement */: - case 211 /* TryStatement */: - case 199 /* DoStatement */: - case 207 /* WithStatement */: + case 199 /* IfStatement */: + case 209 /* SwitchStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 201 /* WhileStatement */: + case 212 /* TryStatement */: + case 200 /* DoStatement */: + case 208 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 246 /* CatchClause */: + case 247 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 167 /* ObjectLiteralExpression */; + return context.contextNode.kind === 168 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 170 /* CallExpression */; + return context.contextNode.kind === 171 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 171 /* NewExpression */; + return context.contextNode.kind === 172 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -43253,7 +43800,7 @@ var ts; return context.nextTokenSpan.kind !== 20 /* CloseBracketToken */; }; Rules.IsArrowFunctionContext = function (context) { - return context.contextNode.kind === 176 /* ArrowFunction */; + return context.contextNode.kind === 177 /* ArrowFunction */; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); @@ -43271,41 +43818,41 @@ var ts; while (ts.isExpression(node)) { node = node.parent; } - return node.kind === 139 /* Decorator */; + return node.kind === 140 /* Decorator */; }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 214 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 215 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 220 /* ModuleDeclaration */; + return context.contextNode.kind === 221 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 155 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 156 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameterOrAssertion = function (token, parent) { if (token.kind !== 25 /* LessThanToken */ && token.kind !== 27 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 151 /* TypeReference */: - case 173 /* TypeAssertionExpression */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 190 /* ExpressionWithTypeArguments */: + case 152 /* TypeReference */: + case 174 /* TypeAssertionExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 191 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -43316,13 +43863,13 @@ var ts; Rules.IsTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsTypeAssertionContext = function (context) { - return context.contextNode.kind === 173 /* TypeAssertionExpression */; + return context.contextNode.kind === 174 /* TypeAssertionExpression */; }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 179 /* VoidExpression */; + return context.currentTokenSpan.kind === 103 /* VoidKeyword */ && context.currentTokenParent.kind === 180 /* VoidExpression */; }; Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 186 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 187 /* YieldExpression */ && context.contextNode.expression !== undefined; }; return Rules; }()); @@ -43346,7 +43893,7 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 134 /* LastToken */ + 1; + this.mapRowLength = 135 /* LastToken */ + 1; this.map = new Array(this.mapRowLength * this.mapRowLength); //new Array(this.mapRowLength * this.mapRowLength); // This array is used only during construction of the rulesbucket in the map var rulesBucketConstructionStateList = new Array(this.map.length); //new Array(this.map.length); @@ -43541,7 +44088,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0 /* FirstToken */; token <= 134 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 135 /* LastToken */; token++) { result.push(token); } return result; @@ -43583,9 +44130,9 @@ var ts; }; TokenRange.Any = TokenRange.AllTokens(); TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(70 /* FirstKeyword */, 134 /* LastKeyword */); + TokenRange.Keywords = TokenRange.FromRange(70 /* FirstKeyword */, 135 /* LastKeyword */); TokenRange.BinaryOperators = TokenRange.FromRange(25 /* FirstBinaryOperator */, 68 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90 /* InKeyword */, 91 /* InstanceOfKeyword */, 134 /* OfKeyword */, 116 /* AsKeyword */, 124 /* IsKeyword */]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([90 /* InKeyword */, 91 /* InstanceOfKeyword */, 135 /* OfKeyword */, 116 /* AsKeyword */, 124 /* IsKeyword */]); TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([41 /* PlusPlusToken */, 42 /* MinusMinusToken */, 50 /* TildeToken */, 49 /* ExclamationToken */]); TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([8 /* NumericLiteral */, 69 /* Identifier */, 17 /* OpenParenToken */, 19 /* OpenBracketToken */, 15 /* OpenBraceToken */, 97 /* ThisKeyword */, 92 /* NewKeyword */]); TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([69 /* Identifier */, 17 /* OpenParenToken */, 97 /* ThisKeyword */, 92 /* NewKeyword */]); @@ -43815,17 +44362,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 194 /* Block */ && ts.rangeContainsRange(body.statements, node); - case 250 /* SourceFile */: - case 194 /* Block */: - case 221 /* ModuleBlock */: + return body && body.kind === 195 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 251 /* SourceFile */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -44027,19 +44574,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 216 /* ClassDeclaration */: return 73 /* ClassKeyword */; - case 217 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; - case 215 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; - case 219 /* EnumDeclaration */: return 219 /* EnumDeclaration */; - case 145 /* GetAccessor */: return 123 /* GetKeyword */; - case 146 /* SetAccessor */: return 129 /* SetKeyword */; - case 143 /* MethodDeclaration */: + case 217 /* ClassDeclaration */: return 73 /* ClassKeyword */; + case 218 /* InterfaceDeclaration */: return 107 /* InterfaceKeyword */; + case 216 /* FunctionDeclaration */: return 87 /* FunctionKeyword */; + case 220 /* EnumDeclaration */: return 220 /* EnumDeclaration */; + case 146 /* GetAccessor */: return 123 /* GetKeyword */; + case 147 /* SetAccessor */: return 129 /* SetKeyword */; + case 144 /* MethodDeclaration */: if (node.asteriskToken) { return 37 /* AsteriskToken */; } // fall-through - case 141 /* PropertyDeclaration */: - case 138 /* Parameter */: + case 142 /* PropertyDeclaration */: + case 139 /* Parameter */: return node.name.kind; } } @@ -44179,7 +44726,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 139 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 140 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -44523,20 +45070,20 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 194 /* Block */: - case 221 /* ModuleBlock */: + case 195 /* Block */: + case 222 /* ModuleBlock */: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 144 /* Constructor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 176 /* ArrowFunction */: + case 145 /* Constructor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 177 /* ArrowFunction */: if (node.typeParameters === list) { return 25 /* LessThanToken */; } @@ -44544,8 +45091,8 @@ var ts; return 17 /* OpenParenToken */; } break; - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: if (node.typeArguments === list) { return 25 /* LessThanToken */; } @@ -44553,7 +45100,7 @@ var ts; return 17 /* OpenParenToken */; } break; - case 151 /* TypeReference */: + case 152 /* TypeReference */: if (node.typeArguments === list) { return 25 /* LessThanToken */; } @@ -44669,7 +45216,7 @@ var ts; var lineStart = ts.getLineStartPositionForPosition(current_1, sourceFile); return SmartIndenter.findFirstNonWhitespaceColumn(lineStart, current_1, sourceFile, options); } - if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 183 /* BinaryExpression */) { + if (precedingToken.kind === 24 /* CommaToken */ && precedingToken.parent.kind !== 184 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -44788,7 +45335,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 250 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 251 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -44821,7 +45368,7 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 198 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 199 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 80 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -44833,23 +45380,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 151 /* TypeReference */: + case 152 /* TypeReference */: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 167 /* ObjectLiteralExpression */: + case 168 /* ObjectLiteralExpression */: return node.parent.properties; - case 166 /* ArrayLiteralExpression */: + case 167 /* ArrayLiteralExpression */: return node.parent.elements; - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: { + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -44860,8 +45407,8 @@ var ts; } break; } - case 171 /* NewExpression */: - case 170 /* CallExpression */: { + case 172 /* NewExpression */: + case 171 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -44891,8 +45438,8 @@ var ts; if (node.kind === 18 /* CloseParenToken */) { return -1 /* Unknown */; } - if (node.parent && (node.parent.kind === 170 /* CallExpression */ || - node.parent.kind === 171 /* NewExpression */) && + if (node.parent && (node.parent.kind === 171 /* CallExpression */ || + node.parent.kind === 172 /* NewExpression */) && node.parent.expression !== node) { var fullCallOrNewExpression = node.parent.expression; var startingExpression = getStartingExpression(fullCallOrNewExpression); @@ -44910,10 +45457,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 168 /* PropertyAccessExpression */: - case 169 /* ElementAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 169 /* PropertyAccessExpression */: + case 170 /* ElementAccessExpression */: node = node.expression; break; default: @@ -44977,45 +45524,45 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 197 /* ExpressionStatement */: - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 166 /* ArrayLiteralExpression */: - case 194 /* Block */: - case 221 /* ModuleBlock */: - case 167 /* ObjectLiteralExpression */: - case 155 /* TypeLiteral */: - case 157 /* TupleType */: - case 222 /* CaseBlock */: - case 244 /* DefaultClause */: - case 243 /* CaseClause */: - case 174 /* ParenthesizedExpression */: - case 168 /* PropertyAccessExpression */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: - case 195 /* VariableStatement */: - case 213 /* VariableDeclaration */: - case 229 /* ExportAssignment */: - case 206 /* ReturnStatement */: - case 184 /* ConditionalExpression */: - case 164 /* ArrayBindingPattern */: - case 163 /* ObjectBindingPattern */: - case 237 /* JsxOpeningElement */: - case 236 /* JsxSelfClosingElement */: - case 242 /* JsxExpression */: - case 142 /* MethodSignature */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 138 /* Parameter */: - case 152 /* FunctionType */: - case 153 /* ConstructorType */: - case 160 /* ParenthesizedType */: - case 172 /* TaggedTemplateExpression */: - case 180 /* AwaitExpression */: - case 227 /* NamedImports */: + case 198 /* ExpressionStatement */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 167 /* ArrayLiteralExpression */: + case 195 /* Block */: + case 222 /* ModuleBlock */: + case 168 /* ObjectLiteralExpression */: + case 156 /* TypeLiteral */: + case 158 /* TupleType */: + case 223 /* CaseBlock */: + case 245 /* DefaultClause */: + case 244 /* CaseClause */: + case 175 /* ParenthesizedExpression */: + case 169 /* PropertyAccessExpression */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 196 /* VariableStatement */: + case 214 /* VariableDeclaration */: + case 230 /* ExportAssignment */: + case 207 /* ReturnStatement */: + case 185 /* ConditionalExpression */: + case 165 /* ArrayBindingPattern */: + case 164 /* ObjectBindingPattern */: + case 238 /* JsxOpeningElement */: + case 237 /* JsxSelfClosingElement */: + case 243 /* JsxExpression */: + case 143 /* MethodSignature */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 139 /* Parameter */: + case 153 /* FunctionType */: + case 154 /* ConstructorType */: + case 161 /* ParenthesizedType */: + case 173 /* TaggedTemplateExpression */: + case 181 /* AwaitExpression */: + case 228 /* NamedImports */: return true; } return false; @@ -45024,22 +45571,22 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 199 /* DoStatement */: - case 200 /* WhileStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 201 /* ForStatement */: - case 198 /* IfStatement */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 143 /* MethodDeclaration */: - case 176 /* ArrowFunction */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - return childKind !== 194 /* Block */; - case 235 /* JsxElement */: - return childKind !== 239 /* JsxClosingElement */; + case 200 /* DoStatement */: + case 201 /* WhileStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 202 /* ForStatement */: + case 199 /* IfStatement */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 144 /* MethodDeclaration */: + case 177 /* ArrowFunction */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + return childKind !== 195 /* Block */; + case 236 /* JsxElement */: + return childKind !== 240 /* JsxClosingElement */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -45191,7 +45738,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(273 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); + var list = createNode(274 /* SyntaxList */, nodes.pos, nodes.end, 2048 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) { @@ -45210,7 +45757,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 135 /* FirstNode */) { + if (this.kind >= 136 /* FirstNode */) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -45257,7 +45804,7 @@ var ts; return undefined; } var child = children[0]; - return child.kind < 135 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + return child.kind < 136 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; NodeObject.prototype.getLastToken = function (sourceFile) { var children = this.getChildren(sourceFile); @@ -45265,7 +45812,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 135 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 136 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; return NodeObject; }()); @@ -45314,7 +45861,7 @@ var ts; if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments - if (canUseParsedParamTagComments && declaration.kind === 138 /* Parameter */) { + if (canUseParsedParamTagComments && declaration.kind === 139 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -45323,15 +45870,15 @@ var ts; }); } // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === 220 /* ModuleDeclaration */ && declaration.body.kind === 220 /* ModuleDeclaration */) { + if (declaration.kind === 221 /* ModuleDeclaration */ && declaration.body.kind === 221 /* ModuleDeclaration */) { return; } // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === 220 /* ModuleDeclaration */ && declaration.parent.kind === 220 /* ModuleDeclaration */) { + while (declaration.kind === 221 /* ModuleDeclaration */ && declaration.parent.kind === 221 /* ModuleDeclaration */) { declaration = declaration.parent; } // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange(declaration.kind === 213 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 214 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { ts.addRange(jsDocCommentParts, cleanedJsDocComment); @@ -45676,9 +46223,9 @@ var ts; if (result_2 !== undefined) { return result_2; } - if (declaration.name.kind === 136 /* ComputedPropertyName */) { + if (declaration.name.kind === 137 /* ComputedPropertyName */) { var expr = declaration.name.expression; - if (expr.kind === 168 /* PropertyAccessExpression */) { + if (expr.kind === 169 /* PropertyAccessExpression */) { return expr.name.text; } return getTextOfIdentifierOrLiteral(expr); @@ -45698,9 +46245,9 @@ var ts; } function visit(node) { switch (node.kind) { - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -45720,60 +46267,60 @@ var ts; ts.forEachChild(node, visit); } break; - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 219 /* EnumDeclaration */: - case 220 /* ModuleDeclaration */: - case 223 /* ImportEqualsDeclaration */: - case 232 /* ExportSpecifier */: - case 228 /* ImportSpecifier */: - case 223 /* ImportEqualsDeclaration */: - case 225 /* ImportClause */: - case 226 /* NamespaceImport */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 155 /* TypeLiteral */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 220 /* EnumDeclaration */: + case 221 /* ModuleDeclaration */: + case 224 /* ImportEqualsDeclaration */: + case 233 /* ExportSpecifier */: + case 229 /* ImportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 226 /* ImportClause */: + case 227 /* NamespaceImport */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 156 /* TypeLiteral */: addDeclaration(node); // fall through - case 144 /* Constructor */: - case 195 /* VariableStatement */: - case 214 /* VariableDeclarationList */: - case 163 /* ObjectBindingPattern */: - case 164 /* ArrayBindingPattern */: - case 221 /* ModuleBlock */: + case 145 /* Constructor */: + case 196 /* VariableStatement */: + case 215 /* VariableDeclarationList */: + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: + case 222 /* ModuleBlock */: ts.forEachChild(node, visit); break; - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionBlock(node)) { ts.forEachChild(node, visit); } break; - case 138 /* Parameter */: + case 139 /* Parameter */: // Only consider properties defined as constructor parameters if (!(node.flags & 56 /* AccessibilityModifier */)) { break; } // fall through - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: if (ts.isBindingPattern(node.name)) { ts.forEachChild(node.name, visit); break; } - case 249 /* EnumMember */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 250 /* EnumMember */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: addDeclaration(node); break; - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -45785,7 +46332,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 226 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 227 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -45961,6 +46508,9 @@ var ts; ClassificationTypeNames.jsxOpenTagName = "jsx open tag name"; ClassificationTypeNames.jsxCloseTagName = "jsx close tag name"; ClassificationTypeNames.jsxSelfClosingTagName = "jsx self closing tag name"; + ClassificationTypeNames.jsxAttribute = "jsx attribute"; + ClassificationTypeNames.jsxText = "jsx text"; + ClassificationTypeNames.jsxAttributeStringLiteralValue = "jsx attribute string literal value"; return ClassificationTypeNames; }()); ts.ClassificationTypeNames = ClassificationTypeNames; @@ -45986,6 +46536,9 @@ var ts; ClassificationType[ClassificationType["jsxOpenTagName"] = 19] = "jsxOpenTagName"; ClassificationType[ClassificationType["jsxCloseTagName"] = 20] = "jsxCloseTagName"; ClassificationType[ClassificationType["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType[ClassificationType["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType[ClassificationType["jsxText"] = 23] = "jsxText"; + ClassificationType[ClassificationType["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; })(ts.ClassificationType || (ts.ClassificationType = {})); var ClassificationType = ts.ClassificationType; function displayPartsToString(displayParts) { @@ -46001,16 +46554,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 175 /* FunctionExpression */) { + if (declaration.kind === 176 /* FunctionExpression */) { return true; } - if (declaration.kind !== 213 /* VariableDeclaration */ && declaration.kind !== 215 /* FunctionDeclaration */) { + if (declaration.kind !== 214 /* VariableDeclaration */ && declaration.kind !== 216 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable - for (var parent_8 = declaration.parent; !ts.isFunctionBlock(parent_8); parent_8 = parent_8.parent) { + for (var parent_9 = declaration.parent; !ts.isFunctionBlock(parent_9); parent_9 = parent_9.parent) { // Reached source file or module block - if (parent_8.kind === 250 /* SourceFile */ || parent_8.kind === 221 /* ModuleBlock */) { + if (parent_9.kind === 251 /* SourceFile */ || parent_9.kind === 222 /* ModuleBlock */) { return false; } } @@ -46266,18 +46819,12 @@ var ts; return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; - function createGetCanonicalFileName(useCaseSensitivefileNames) { - return useCaseSensitivefileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); - } - ts.createGetCanonicalFileName = createGetCanonicalFileName; function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) { if (currentDirectory === void 0) { currentDirectory = ""; } // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have // for those settings. var buckets = {}; - var getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); + var getCanonicalFileName = ts.createGetCanonicalFileName(!!useCaseSensitiveFileNames); function getKeyFromCompilationSettings(settings) { return "_" + settings.target + "|" + settings.module + "|" + settings.noResolve + "|" + settings.jsx + +"|" + settings.allowJs; } @@ -46642,7 +47189,7 @@ var ts; /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 209 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 210 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -46651,12 +47198,12 @@ var ts; } function isJumpStatementTarget(node) { return node.kind === 69 /* Identifier */ && - (node.parent.kind === 205 /* BreakStatement */ || node.parent.kind === 204 /* ContinueStatement */) && + (node.parent.kind === 206 /* BreakStatement */ || node.parent.kind === 205 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { return node.kind === 69 /* Identifier */ && - node.parent.kind === 209 /* LabeledStatement */ && + node.parent.kind === 210 /* LabeledStatement */ && node.parent.label === node; } /** @@ -46664,7 +47211,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 209 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 210 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -46675,25 +47222,25 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 135 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 168 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 169 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 170 /* CallExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 171 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 171 /* NewExpression */ && node.parent.expression === node; + return node && node.parent && node.parent.kind === 172 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 220 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 221 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 69 /* Identifier */ && @@ -46702,22 +47249,22 @@ var ts; /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node) { return (node.kind === 69 /* Identifier */ || node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - (node.parent.kind === 247 /* PropertyAssignment */ || node.parent.kind === 248 /* ShorthandPropertyAssignment */) && node.parent.name === node; + (node.parent.kind === 248 /* PropertyAssignment */ || node.parent.kind === 249 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) { switch (node.parent.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 247 /* PropertyAssignment */: - case 249 /* EnumMember */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 220 /* ModuleDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 248 /* PropertyAssignment */: + case 250 /* EnumMember */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 221 /* ModuleDeclaration */: return node.parent.name === node; - case 169 /* ElementAccessExpression */: + case 170 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } @@ -46776,7 +47323,7 @@ var ts; })(BreakContinueSearchType || (BreakContinueSearchType = {})); // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 70 /* FirstKeyword */; i <= 134 /* LastKeyword */; i++) { + for (var i = 70 /* FirstKeyword */; i <= 135 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -46791,17 +47338,17 @@ var ts; return undefined; } switch (node.kind) { - case 250 /* SourceFile */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 219 /* EnumDeclaration */: - case 220 /* ModuleDeclaration */: + case 251 /* SourceFile */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 220 /* EnumDeclaration */: + case 221 /* ModuleDeclaration */: return node; } } @@ -46809,38 +47356,38 @@ var ts; ts.getContainerNode = getContainerNode; /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 220 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 216 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 217 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 218 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 219 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 213 /* VariableDeclaration */: + case 221 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 217 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 218 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 219 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 220 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 214 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 215 /* FunctionDeclaration */: return ScriptElementKind.functionElement; - case 145 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; - case 146 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 216 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 146 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 147 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: return ScriptElementKind.memberFunctionElement; - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return ScriptElementKind.memberVariableElement; - case 149 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; - case 148 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; - case 147 /* CallSignature */: return ScriptElementKind.callSignatureElement; - case 144 /* Constructor */: return ScriptElementKind.constructorImplementationElement; - case 137 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 249 /* EnumMember */: return ScriptElementKind.variableElement; - case 138 /* Parameter */: return (node.flags & 56 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 223 /* ImportEqualsDeclaration */: - case 228 /* ImportSpecifier */: - case 225 /* ImportClause */: - case 232 /* ExportSpecifier */: - case 226 /* NamespaceImport */: + case 150 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 149 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 148 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 145 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 138 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 250 /* EnumMember */: return ScriptElementKind.variableElement; + case 139 /* Parameter */: return (node.flags & 56 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 224 /* ImportEqualsDeclaration */: + case 229 /* ImportSpecifier */: + case 226 /* ImportClause */: + case 233 /* ExportSpecifier */: + case 227 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -46878,7 +47425,7 @@ var ts; host.log(message); } } - var getCanonicalFileName = createGetCanonicalFileName(useCaseSensitivefileNames); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitivefileNames); function getValidSourceFile(fileName) { var sourceFile = program.getSourceFile(fileName); if (!sourceFile) { @@ -47152,9 +47699,9 @@ var ts; isJsDocTagName = true; } switch (tag.kind) { - case 271 /* JSDocTypeTag */: - case 269 /* JSDocParameterTag */: - case 270 /* JSDocReturnTag */: + case 272 /* JSDocTypeTag */: + case 270 /* JSDocParameterTag */: + case 271 /* JSDocReturnTag */: var tagWithExpression = tag; if (tagWithExpression.typeExpression) { insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; @@ -47199,13 +47746,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_9 = contextToken.parent, kind = contextToken.kind; + var parent_10 = contextToken.parent, kind = contextToken.kind; if (kind === 21 /* DotToken */) { - if (parent_9.kind === 168 /* PropertyAccessExpression */) { + if (parent_10.kind === 169 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_9.kind === 135 /* QualifiedName */) { + else if (parent_10.kind === 136 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -47220,8 +47767,9 @@ var ts; isRightOfOpenTag = true; location = contextToken; } - else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 239 /* JsxClosingElement */) { + else if (kind === 39 /* SlashToken */ && contextToken.parent.kind === 240 /* JsxClosingElement */) { isStartingCloseTag = true; + location = contextToken; } } } @@ -47245,7 +47793,10 @@ var ts; } else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; - symbols = [typeChecker.getSymbolAtLocation(tagName)]; + var tagSymbol = typeChecker.getSymbolAtLocation(tagName); + if (!typeChecker.isUnknownSymbol(tagSymbol)) { + symbols = [tagSymbol]; + } isMemberCompletion = true; isNewIdentifierLocation = false; } @@ -47263,7 +47814,7 @@ var ts; // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 69 /* Identifier */ || node.kind === 135 /* QualifiedName */ || node.kind === 168 /* PropertyAccessExpression */) { + if (node.kind === 69 /* Identifier */ || node.kind === 136 /* QualifiedName */ || node.kind === 169 /* PropertyAccessExpression */) { var symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & 8388608 /* Alias */) { @@ -47319,7 +47870,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType; - if ((jsxContainer.kind === 236 /* JsxSelfClosingElement */) || (jsxContainer.kind === 237 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 237 /* JsxSelfClosingElement */) || (jsxContainer.kind === 238 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); if (attrsType) { @@ -47391,15 +47942,15 @@ var ts; return result; } function isInJsxText(contextToken) { - if (contextToken.kind === 238 /* JsxText */) { + if (contextToken.kind === 239 /* JsxText */) { return true; } if (contextToken.kind === 27 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 237 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 238 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 239 /* JsxClosingElement */ || contextToken.parent.kind === 236 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 235 /* JsxElement */; + if (contextToken.parent.kind === 240 /* JsxClosingElement */ || contextToken.parent.kind === 237 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 236 /* JsxElement */; } } return false; @@ -47409,40 +47960,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 170 /* CallExpression */ // func( a, | - || containingNodeKind === 144 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 171 /* NewExpression */ // new C(a, | - || containingNodeKind === 166 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 183 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 152 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 171 /* CallExpression */ // func( a, | + || containingNodeKind === 145 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 172 /* NewExpression */ // new C(a, | + || containingNodeKind === 167 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 184 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 153 /* FunctionType */; // var x: (s: string, list| case 17 /* OpenParenToken */: - return containingNodeKind === 170 /* CallExpression */ // func( | - || containingNodeKind === 144 /* Constructor */ // constructor( | - || containingNodeKind === 171 /* NewExpression */ // new C(a| - || containingNodeKind === 174 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 160 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 171 /* CallExpression */ // func( | + || containingNodeKind === 145 /* Constructor */ // constructor( | + || containingNodeKind === 172 /* NewExpression */ // new C(a| + || containingNodeKind === 175 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 161 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 19 /* OpenBracketToken */: - return containingNodeKind === 166 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 149 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 136 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + return containingNodeKind === 167 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 150 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 137 /* ComputedPropertyName */; // [ | /* this can become an index signature */ case 125 /* ModuleKeyword */: // module | case 126 /* NamespaceKeyword */: return true; case 21 /* DotToken */: - return containingNodeKind === 220 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 221 /* ModuleDeclaration */; // module A.| case 15 /* OpenBraceToken */: - return containingNodeKind === 216 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 217 /* ClassDeclaration */; // class A{ | case 56 /* EqualsToken */: - return containingNodeKind === 213 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 183 /* BinaryExpression */; // x = a| + return containingNodeKind === 214 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 184 /* BinaryExpression */; // x = a| case 12 /* TemplateHead */: - return containingNodeKind === 185 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 186 /* TemplateExpression */; // `aa ${| case 13 /* TemplateMiddle */: - return containingNodeKind === 192 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 193 /* TemplateSpan */; // `aa ${10} dd ${| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: - return containingNodeKind === 141 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 142 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -47456,7 +48007,7 @@ var ts; } function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) { if (contextToken.kind === 9 /* StringLiteral */ - || contextToken.kind === 162 /* StringLiteralType */ + || contextToken.kind === 163 /* StringLiteralType */ || contextToken.kind === 10 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(contextToken.kind)) { var start_7 = contextToken.getStart(); @@ -47486,14 +48037,14 @@ var ts; isMemberCompletion = true; var typeForObject; var existingMembers; - if (objectLikeContainer.kind === 167 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 168 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; typeForObject = typeChecker.getContextualType(objectLikeContainer); existingMembers = objectLikeContainer.properties; } - else if (objectLikeContainer.kind === 163 /* ObjectBindingPattern */) { + else if (objectLikeContainer.kind === 164 /* ObjectBindingPattern */) { // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -47539,9 +48090,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 227 /* NamedImports */ ? - 224 /* ImportDeclaration */ : - 230 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 228 /* NamedImports */ ? + 225 /* ImportDeclaration */ : + 231 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -47566,9 +48117,9 @@ var ts; switch (contextToken.kind) { case 15 /* OpenBraceToken */: // const x = { | case 24 /* CommaToken */: - var parent_10 = contextToken.parent; - if (parent_10 && (parent_10.kind === 167 /* ObjectLiteralExpression */ || parent_10.kind === 163 /* ObjectBindingPattern */)) { - return parent_10; + var parent_11 = contextToken.parent; + if (parent_11 && (parent_11.kind === 168 /* ObjectLiteralExpression */ || parent_11.kind === 164 /* ObjectBindingPattern */)) { + return parent_11; } break; } @@ -47585,8 +48136,8 @@ var ts; case 15 /* OpenBraceToken */: // import { | case 24 /* CommaToken */: switch (contextToken.parent.kind) { - case 227 /* NamedImports */: - case 231 /* NamedExports */: + case 228 /* NamedImports */: + case 232 /* NamedExports */: return contextToken.parent; } } @@ -47595,37 +48146,37 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_11 = contextToken.parent; + var parent_12 = contextToken.parent; switch (contextToken.kind) { case 26 /* LessThanSlashToken */: case 39 /* SlashToken */: case 69 /* Identifier */: - case 240 /* JsxAttribute */: - case 241 /* JsxSpreadAttribute */: - if (parent_11 && (parent_11.kind === 236 /* JsxSelfClosingElement */ || parent_11.kind === 237 /* JsxOpeningElement */)) { - return parent_11; + case 241 /* JsxAttribute */: + case 242 /* JsxSpreadAttribute */: + if (parent_12 && (parent_12.kind === 237 /* JsxSelfClosingElement */ || parent_12.kind === 238 /* JsxOpeningElement */)) { + return parent_12; } - else if (parent_11.kind === 240 /* JsxAttribute */) { - return parent_11.parent; + else if (parent_12.kind === 241 /* JsxAttribute */) { + return parent_12.parent; } break; // The context token is the closing } or " of an attribute, which means // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_11 && ((parent_11.kind === 240 /* JsxAttribute */) || (parent_11.kind === 241 /* JsxSpreadAttribute */))) { - return parent_11.parent; + if (parent_12 && ((parent_12.kind === 241 /* JsxAttribute */) || (parent_12.kind === 242 /* JsxSpreadAttribute */))) { + return parent_12.parent; } break; case 16 /* CloseBraceToken */: - if (parent_11 && - parent_11.kind === 242 /* JsxExpression */ && - parent_11.parent && - (parent_11.parent.kind === 240 /* JsxAttribute */)) { - return parent_11.parent.parent; + if (parent_12 && + parent_12.kind === 243 /* JsxExpression */ && + parent_12.parent && + (parent_12.parent.kind === 241 /* JsxAttribute */)) { + return parent_12.parent.parent; } - if (parent_11 && parent_11.kind === 241 /* JsxSpreadAttribute */) { - return parent_11.parent; + if (parent_12 && parent_12.kind === 242 /* JsxSpreadAttribute */) { + return parent_12.parent; } break; } @@ -47634,16 +48185,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - case 149 /* IndexSignature */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 148 /* CallSignature */: + case 149 /* ConstructSignature */: + case 150 /* IndexSignature */: return true; } return false; @@ -47655,54 +48206,54 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 24 /* CommaToken */: - return containingNodeKind === 213 /* VariableDeclaration */ || - containingNodeKind === 214 /* VariableDeclarationList */ || - containingNodeKind === 195 /* VariableStatement */ || - containingNodeKind === 219 /* EnumDeclaration */ || + return containingNodeKind === 214 /* VariableDeclaration */ || + containingNodeKind === 215 /* VariableDeclarationList */ || + containingNodeKind === 196 /* VariableStatement */ || + containingNodeKind === 220 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 216 /* ClassDeclaration */ || - containingNodeKind === 188 /* ClassExpression */ || - containingNodeKind === 217 /* InterfaceDeclaration */ || - containingNodeKind === 164 /* ArrayBindingPattern */ || - containingNodeKind === 218 /* TypeAliasDeclaration */; // type Map, K, | + containingNodeKind === 217 /* ClassDeclaration */ || + containingNodeKind === 189 /* ClassExpression */ || + containingNodeKind === 218 /* InterfaceDeclaration */ || + containingNodeKind === 165 /* ArrayBindingPattern */ || + containingNodeKind === 219 /* TypeAliasDeclaration */; // type Map, K, | case 21 /* DotToken */: - return containingNodeKind === 164 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 165 /* ArrayBindingPattern */; // var [.| case 54 /* ColonToken */: - return containingNodeKind === 165 /* BindingElement */; // var {x :html| + return containingNodeKind === 166 /* BindingElement */; // var {x :html| case 19 /* OpenBracketToken */: - return containingNodeKind === 164 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 165 /* ArrayBindingPattern */; // var [x| case 17 /* OpenParenToken */: - return containingNodeKind === 246 /* CatchClause */ || + return containingNodeKind === 247 /* CatchClause */ || isFunction(containingNodeKind); case 15 /* OpenBraceToken */: - return containingNodeKind === 219 /* EnumDeclaration */ || - containingNodeKind === 217 /* InterfaceDeclaration */ || - containingNodeKind === 155 /* TypeLiteral */; // const x : { | + return containingNodeKind === 220 /* EnumDeclaration */ || + containingNodeKind === 218 /* InterfaceDeclaration */ || + containingNodeKind === 156 /* TypeLiteral */; // const x : { | case 23 /* SemicolonToken */: - return containingNodeKind === 140 /* PropertySignature */ && + return containingNodeKind === 141 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 217 /* InterfaceDeclaration */ || - contextToken.parent.parent.kind === 155 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 218 /* InterfaceDeclaration */ || + contextToken.parent.parent.kind === 156 /* TypeLiteral */); // const x : { a; | case 25 /* LessThanToken */: - return containingNodeKind === 216 /* ClassDeclaration */ || - containingNodeKind === 188 /* ClassExpression */ || - containingNodeKind === 217 /* InterfaceDeclaration */ || - containingNodeKind === 218 /* TypeAliasDeclaration */ || + return containingNodeKind === 217 /* ClassDeclaration */ || + containingNodeKind === 189 /* ClassExpression */ || + containingNodeKind === 218 /* InterfaceDeclaration */ || + containingNodeKind === 219 /* TypeAliasDeclaration */ || isFunction(containingNodeKind); case 113 /* StaticKeyword */: - return containingNodeKind === 141 /* PropertyDeclaration */; + return containingNodeKind === 142 /* PropertyDeclaration */; case 22 /* DotDotDotToken */: - return containingNodeKind === 138 /* Parameter */ || + return containingNodeKind === 139 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 164 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 165 /* ArrayBindingPattern */); // var [...z| case 112 /* PublicKeyword */: case 110 /* PrivateKeyword */: case 111 /* ProtectedKeyword */: - return containingNodeKind === 138 /* Parameter */; + return containingNodeKind === 139 /* Parameter */; case 116 /* AsKeyword */: - return containingNodeKind === 228 /* ImportSpecifier */ || - containingNodeKind === 232 /* ExportSpecifier */ || - containingNodeKind === 226 /* NamespaceImport */; + return containingNodeKind === 229 /* ImportSpecifier */ || + containingNodeKind === 233 /* ExportSpecifier */ || + containingNodeKind === 227 /* NamespaceImport */; case 73 /* ClassKeyword */: case 81 /* EnumKeyword */: case 107 /* InterfaceKeyword */: @@ -47762,8 +48313,8 @@ var ts; if (element.getStart() <= position && position <= element.getEnd()) { continue; } - var name_31 = element.propertyName || element.name; - exisingImportsOrExports[name_31.text] = true; + var name_34 = element.propertyName || element.name; + exisingImportsOrExports[name_34.text] = true; } if (ts.isEmpty(exisingImportsOrExports)) { return exportsOfModule; @@ -47784,10 +48335,10 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 247 /* PropertyAssignment */ && - m.kind !== 248 /* ShorthandPropertyAssignment */ && - m.kind !== 165 /* BindingElement */ && - m.kind !== 143 /* MethodDeclaration */) { + if (m.kind !== 248 /* PropertyAssignment */ && + m.kind !== 249 /* ShorthandPropertyAssignment */ && + m.kind !== 166 /* BindingElement */ && + m.kind !== 144 /* MethodDeclaration */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -47795,7 +48346,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 165 /* BindingElement */ && m.propertyName) { + if (m.kind === 166 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 69 /* Identifier */) { existingName = m.propertyName.text; @@ -47825,7 +48376,7 @@ var ts; if (attr.getStart() <= position && position <= attr.getEnd()) { continue; } - if (attr.kind === 240 /* JsxAttribute */) { + if (attr.kind === 241 /* JsxAttribute */) { seenNames[attr.name.text] = true; } } @@ -47851,7 +48402,23 @@ var ts; } else { if (!symbols || symbols.length === 0) { - return undefined; + if (sourceFile.languageVariant === 1 /* JSX */ && + location.parent && location.parent.kind === 240 /* JsxClosingElement */) { + // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, + // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. + // For example: + // var x =
completion list at "1" will contain "div" with type any + var tagName = location.parent.parent.openingElement.tagName; + entries.push({ + name: tagName.text, + kind: undefined, + kindModifiers: undefined, + sortText: "0" + }); + } + else { + return undefined; + } } getCompletionEntriesFromSymbols(symbols, entries); } @@ -47864,10 +48431,10 @@ var ts; var entries = []; var target = program.getCompilerOptions().target; var nameTable = getNameTable(sourceFile); - for (var name_32 in nameTable) { - if (!uniqueNames[name_32]) { - uniqueNames[name_32] = name_32; - var displayName = getCompletionEntryDisplayName(name_32, target, /*performCharacterChecks*/ true); + for (var name_35 in nameTable) { + if (!uniqueNames[name_35]) { + uniqueNames[name_35] = name_35; + var displayName = getCompletionEntryDisplayName(name_35, target, /*performCharacterChecks*/ true); if (displayName) { var entry = { name: displayName, @@ -47973,7 +48540,7 @@ var ts; function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); if (flags & 32 /* Class */) - return ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 189 /* ClassExpression */) ? ScriptElementKind.localClassElement : ScriptElementKind.classElement; if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; @@ -48075,7 +48642,7 @@ var ts; var signature; type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 168 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 169 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -48084,7 +48651,7 @@ var ts; } // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 170 /* CallExpression */ || location.kind === 171 /* NewExpression */) { + if (location.kind === 171 /* CallExpression */ || location.kind === 172 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -48097,7 +48664,7 @@ var ts; // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 171 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 172 /* NewExpression */ || callExpression.expression.kind === 95 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -48150,24 +48717,24 @@ var ts; } } else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 121 /* ConstructorKeyword */ && location.parent.kind === 144 /* Constructor */)) { + (location.kind === 121 /* ConstructorKeyword */ && location.parent.kind === 145 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 144 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 145 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 144 /* Constructor */) { + if (functionDeclaration.kind === 145 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 147 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 148 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -48176,7 +48743,7 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { - if (ts.getDeclarationOfKind(symbol, 188 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 189 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -48220,7 +48787,7 @@ var ts; } if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 220 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 221 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 69 /* Identifier */; displayParts.push(ts.keywordPart(isNamespace ? 126 /* NamespaceKeyword */ : 125 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); @@ -48243,17 +48810,17 @@ var ts; } else { // Method/function type parameter - var declaration = ts.getDeclarationOfKind(symbol, 137 /* TypeParameter */); + var declaration = ts.getDeclarationOfKind(symbol, 138 /* TypeParameter */); ts.Debug.assert(declaration !== undefined); declaration = declaration.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 148 /* ConstructSignature */) { + if (declaration.kind === 149 /* ConstructSignature */) { displayParts.push(ts.keywordPart(92 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 147 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 148 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -48273,7 +48840,7 @@ var ts; if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 249 /* EnumMember */) { + if (declaration.kind === 250 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -48289,7 +48856,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 223 /* ImportEqualsDeclaration */) { + if (declaration.kind === 224 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -48418,14 +48985,14 @@ var ts; } var typeChecker = program.getTypeChecker(); var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { + if (!symbol || typeChecker.isUnknownSymbol(symbol)) { // Try getting just type at this position and show switch (node.kind) { case 69 /* Identifier */: - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: case 97 /* ThisKeyword */: - case 161 /* ThisType */: + case 162 /* ThisType */: case 95 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -48504,8 +49071,8 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 144 /* Constructor */) || - (!selectConstructors && (d.kind === 215 /* FunctionDeclaration */ || d.kind === 143 /* MethodDeclaration */ || d.kind === 142 /* MethodSignature */))) { + if ((selectConstructors && d.kind === 145 /* Constructor */) || + (!selectConstructors && (d.kind === 216 /* FunctionDeclaration */ || d.kind === 144 /* MethodDeclaration */ || d.kind === 143 /* MethodSignature */))) { declarations.push(d); if (d.body) definition = d; @@ -48574,7 +49141,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 248 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 249 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -48650,7 +49217,7 @@ var ts; function getSemanticDocumentHighlights(node) { if (node.kind === 69 /* Identifier */ || node.kind === 97 /* ThisKeyword */ || - node.kind === 161 /* ThisType */ || + node.kind === 162 /* ThisType */ || node.kind === 95 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { @@ -48704,75 +49271,75 @@ var ts; switch (node.kind) { case 88 /* IfKeyword */: case 80 /* ElseKeyword */: - if (hasKind(node.parent, 198 /* IfStatement */)) { + if (hasKind(node.parent, 199 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 94 /* ReturnKeyword */: - if (hasKind(node.parent, 206 /* ReturnStatement */)) { + if (hasKind(node.parent, 207 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 98 /* ThrowKeyword */: - if (hasKind(node.parent, 210 /* ThrowStatement */)) { + if (hasKind(node.parent, 211 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 72 /* CatchKeyword */: - if (hasKind(parent(parent(node)), 211 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 212 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 100 /* TryKeyword */: case 85 /* FinallyKeyword */: - if (hasKind(parent(node), 211 /* TryStatement */)) { + if (hasKind(parent(node), 212 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent); } break; case 96 /* SwitchKeyword */: - if (hasKind(node.parent, 208 /* SwitchStatement */)) { + if (hasKind(node.parent, 209 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 71 /* CaseKeyword */: case 77 /* DefaultKeyword */: - if (hasKind(parent(parent(parent(node))), 208 /* SwitchStatement */)) { + if (hasKind(parent(parent(parent(node))), 209 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 70 /* BreakKeyword */: case 75 /* ContinueKeyword */: - if (hasKind(node.parent, 205 /* BreakStatement */) || hasKind(node.parent, 204 /* ContinueStatement */)) { + if (hasKind(node.parent, 206 /* BreakStatement */) || hasKind(node.parent, 205 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurrences(node.parent); } break; case 86 /* ForKeyword */: - if (hasKind(node.parent, 201 /* ForStatement */) || - hasKind(node.parent, 202 /* ForInStatement */) || - hasKind(node.parent, 203 /* ForOfStatement */)) { + if (hasKind(node.parent, 202 /* ForStatement */) || + hasKind(node.parent, 203 /* ForInStatement */) || + hasKind(node.parent, 204 /* ForOfStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 104 /* WhileKeyword */: case 79 /* DoKeyword */: - if (hasKind(node.parent, 200 /* WhileStatement */) || hasKind(node.parent, 199 /* DoStatement */)) { + if (hasKind(node.parent, 201 /* WhileStatement */) || hasKind(node.parent, 200 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 121 /* ConstructorKeyword */: - if (hasKind(node.parent, 144 /* Constructor */)) { + if (hasKind(node.parent, 145 /* Constructor */)) { return getConstructorOccurrences(node.parent); } break; case 123 /* GetKeyword */: case 129 /* SetKeyword */: - if (hasKind(node.parent, 145 /* GetAccessor */) || hasKind(node.parent, 146 /* SetAccessor */)) { + if (hasKind(node.parent, 146 /* GetAccessor */) || hasKind(node.parent, 147 /* SetAccessor */)) { return getGetAndSetOccurrences(node.parent); } break; default: if (ts.isModifierKind(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 195 /* VariableStatement */)) { + (ts.isDeclaration(node.parent) || node.parent.kind === 196 /* VariableStatement */)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -48788,10 +49355,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 210 /* ThrowStatement */) { + if (node.kind === 211 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 211 /* TryStatement */) { + else if (node.kind === 212 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchClause) { aggregate(tryStatement.catchClause); @@ -48818,19 +49385,19 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_12 = child.parent; - if (ts.isFunctionBlock(parent_12) || parent_12.kind === 250 /* SourceFile */) { - return parent_12; + var parent_13 = child.parent; + if (ts.isFunctionBlock(parent_13) || parent_13.kind === 251 /* SourceFile */) { + return parent_13; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent_12.kind === 211 /* TryStatement */) { - var tryStatement = parent_12; + if (parent_13.kind === 212 /* TryStatement */) { + var tryStatement = parent_13; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_12; + child = parent_13; } return undefined; } @@ -48839,7 +49406,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 205 /* BreakStatement */ || node.kind === 204 /* ContinueStatement */) { + if (node.kind === 206 /* BreakStatement */ || node.kind === 205 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isFunctionLike(node)) { @@ -48854,16 +49421,16 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) { switch (node_2.kind) { - case 208 /* SwitchStatement */: - if (statement.kind === 204 /* ContinueStatement */) { + case 209 /* SwitchStatement */: + if (statement.kind === 205 /* ContinueStatement */) { continue; } // Fall through. - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 200 /* WhileStatement */: - case 199 /* DoStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 201 /* WhileStatement */: + case 200 /* DoStatement */: if (!statement.label || isLabeledBy(node_2, statement.label.text)) { return node_2; } @@ -48882,24 +49449,24 @@ var ts; var container = declaration.parent; // Make sure we only highlight the keyword when it makes sense to do so. if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 216 /* ClassDeclaration */ || - container.kind === 188 /* ClassExpression */ || - (declaration.kind === 138 /* Parameter */ && hasKind(container, 144 /* Constructor */)))) { + if (!(container.kind === 217 /* ClassDeclaration */ || + container.kind === 189 /* ClassExpression */ || + (declaration.kind === 139 /* Parameter */ && hasKind(container, 145 /* Constructor */)))) { return undefined; } } else if (modifier === 113 /* StaticKeyword */) { - if (!(container.kind === 216 /* ClassDeclaration */ || container.kind === 188 /* ClassExpression */)) { + if (!(container.kind === 217 /* ClassDeclaration */ || container.kind === 189 /* ClassExpression */)) { return undefined; } } else if (modifier === 82 /* ExportKeyword */ || modifier === 122 /* DeclareKeyword */) { - if (!(container.kind === 221 /* ModuleBlock */ || container.kind === 250 /* SourceFile */)) { + if (!(container.kind === 222 /* ModuleBlock */ || container.kind === 251 /* SourceFile */)) { return undefined; } } else if (modifier === 115 /* AbstractKeyword */) { - if (!(container.kind === 216 /* ClassDeclaration */ || declaration.kind === 216 /* ClassDeclaration */)) { + if (!(container.kind === 217 /* ClassDeclaration */ || declaration.kind === 217 /* ClassDeclaration */)) { return undefined; } } @@ -48911,8 +49478,8 @@ var ts; var modifierFlag = getFlagFromModifier(modifier); var nodes; switch (container.kind) { - case 221 /* ModuleBlock */: - case 250 /* SourceFile */: + case 222 /* ModuleBlock */: + case 251 /* SourceFile */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */) { nodes = declaration.members.concat(declaration); @@ -48921,17 +49488,17 @@ var ts; nodes = container.statements; } break; - case 144 /* Constructor */: + case 145 /* Constructor */: nodes = container.parameters.concat(container.parent.members); break; - case 216 /* ClassDeclaration */: - case 188 /* ClassExpression */: + case 217 /* ClassDeclaration */: + case 189 /* ClassExpression */: nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. if (modifierFlag & 56 /* AccessibilityModifier */) { var constructor = ts.forEach(container.members, function (member) { - return member.kind === 144 /* Constructor */ && member; + return member.kind === 145 /* Constructor */ && member; }); if (constructor) { nodes = nodes.concat(constructor.parameters); @@ -48984,8 +49551,8 @@ var ts; } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 145 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 146 /* SetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 146 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 147 /* SetAccessor */); return ts.map(keywords, getHighlightSpanForNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); @@ -49008,7 +49575,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 86 /* ForKeyword */, 104 /* WhileKeyword */, 79 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 199 /* DoStatement */) { + if (loopNode.kind === 200 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 104 /* WhileKeyword */)) { @@ -49029,13 +49596,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 201 /* ForStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - case 199 /* DoStatement */: - case 200 /* WhileStatement */: + case 202 /* ForStatement */: + case 203 /* ForInStatement */: + case 204 /* ForOfStatement */: + case 200 /* DoStatement */: + case 201 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 208 /* SwitchStatement */: + case 209 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -49089,7 +49656,7 @@ var ts; function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 194 /* Block */))) { + if (!(func && hasKind(func.body, 195 /* Block */))) { return undefined; } var keywords = []; @@ -49105,7 +49672,7 @@ var ts; function getIfElseOccurrences(ifStatement) { var keywords = []; // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 198 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 199 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. @@ -49118,7 +49685,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 198 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 199 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -49235,7 +49802,7 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 97 /* ThisKeyword */ || node.kind === 161 /* ThisType */) { + if (node.kind === 97 /* ThisKeyword */ || node.kind === 162 /* ThisType */) { return getReferencesForThisKeyword(node, sourceFiles); } if (node.kind === 95 /* SuperKeyword */) { @@ -49296,10 +49863,8 @@ var ts; textSpan: ts.createTextSpan(declarations[0].getStart(), 0) }; } - function isImportOrExportSpecifierImportSymbol(symbol) { - return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 228 /* ImportSpecifier */ || declaration.kind === 232 /* ExportSpecifier */; - }); + function isImportSpecifierSymbol(symbol) { + return (symbol.flags & 8388608 /* Alias */) && !!ts.getDeclarationOfKind(symbol, 229 /* ImportSpecifier */); } function getInternedName(symbol, location, declarations) { // If this is an export or import specifier it could have been renamed using the 'as' syntax. @@ -49325,14 +49890,14 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 175 /* FunctionExpression */ || valueDeclaration.kind === 188 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 176 /* FunctionExpression */ || valueDeclaration.kind === 189 /* ClassExpression */)) { return valueDeclaration; } // If this is private property or method, the scope is the containing class if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 16 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 216 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 217 /* ClassDeclaration */); } } // If the symbol is an import we would like to find it if we are looking for what it imports. @@ -49358,7 +49923,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 251 /* SourceFile */ && !ts.isExternalModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -49531,13 +50096,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 64 /* Static */; switch (searchSpaceNode.kind) { - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -49569,27 +50134,27 @@ var ts; // Whether 'this' occurs in a static context within a class. var staticFlag = 64 /* Static */; switch (searchSpaceNode.kind) { - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // fall through - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 250 /* SourceFile */: + case 251 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // Fall through - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -49598,7 +50163,7 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 250 /* SourceFile */) { + if (searchSpaceNode.kind === 251 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -49624,33 +50189,33 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || (node.kind !== 97 /* ThisKeyword */ && node.kind !== 161 /* ThisType */)) { + if (!node || (node.kind !== 97 /* ThisKeyword */ && node.kind !== 162 /* ThisType */)) { return; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 188 /* ClassExpression */: - case 216 /* ClassDeclaration */: + case 189 /* ClassExpression */: + case 217 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 64 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 250 /* SourceFile */: - if (container.kind === 250 /* SourceFile */ && !ts.isExternalModule(container)) { + case 251 /* SourceFile */: + if (container.kind === 251 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -49662,9 +50227,17 @@ var ts; // The search set contains at least the current symbol var result = [symbol]; // If the symbol is an alias, add what it alaises to the list - if (isImportOrExportSpecifierImportSymbol(symbol)) { + if (isImportSpecifierSymbol(symbol)) { result.push(typeChecker.getAliasedSymbol(symbol)); } + // For export specifiers, the exported name can be refering to a local symbol, e.g.: + // import {a} from "mod"; + // export {a as somethingElse} + // We want the *local* declaration of 'a' as declared in the import, + // *not* as declared within "mod" (or farther) + if (location.parent.kind === 233 /* ExportSpecifier */) { + result.push(typeChecker.getExportSpecifierLocalTargetSymbol(location.parent)); + } // If the location is in a context sensitive location (i.e. in an object literal) try // to get a contextual type for it, and add the property symbol from the contextual // type to the search set @@ -49692,7 +50265,7 @@ var ts; // we should include both parameter declaration symbol and property declaration symbol // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in contructor.locals. // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 138 /* Parameter */ && + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === 139 /* Parameter */ && ts.isParameterPropertyDeclaration(symbol.valueDeclaration)) { result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); } @@ -49704,19 +50277,44 @@ var ts; } // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ {}); } }); return result; } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { + /** + * Find symbol of the given property-name and add the symbol to the given result array + * @param symbol a symbol to start searching for the given propertyName + * @param propertyName a name of property to serach for + * @param result an array of symbol of found property symbols + * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisitng of the same symbol. + * The value of previousIterationSymbol is undefined when the function is first called. + */ + function getPropertySymbolsFromBaseTypes(symbol, propertyName, result, previousIterationSymbolsCache) { + if (!symbol) { + return; + } + // If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited + // This is particularly important for the following cases, so that we do not infinitely visit the same symbol. + // For example: + // interface C extends C { + // /*findRef*/propName: string; + // } + // The first time getPropertySymbolsFromBaseTypes is called when finding-all-references at propName, + // the symbol argument will be the symbol of an interface "C" and previousIterationSymbol is undefined, + // the function will add any found symbol of the property-name, then its sub-routine will call + // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already + // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. + if (ts.hasProperty(previousIterationSymbolsCache, symbol.name)) { + return; + } + if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 216 /* ClassDeclaration */) { + if (declaration.kind === 217 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 217 /* InterfaceDeclaration */) { + else if (declaration.kind === 218 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -49731,7 +50329,8 @@ var ts; result.push(propertySymbol); } // Visit the typeReference as well to see if it directly or indirectly use that property - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); + previousIterationSymbolsCache[symbol.name] = symbol; + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); } } } @@ -49742,12 +50341,22 @@ var ts; } // If the reference symbol is an alias, check if what it is aliasing is one of the search // symbols. - if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { + if (isImportSpecifierSymbol(referenceSymbol)) { var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); if (searchSymbols.indexOf(aliasedSymbol) >= 0) { return aliasedSymbol; } } + // For export specifiers, it can be a local symbol, e.g. + // import {a} from "mod"; + // export {a as somethingElse} + // We want the local target of the export (i.e. the import symbol) and not the final target (i.e. "mod".a) + if (referenceLocation.parent.kind === 233 /* ExportSpecifier */) { + var aliasedSymbol = typeChecker.getExportSpecifierLocalTargetSymbol(referenceLocation.parent); + if (searchSymbols.indexOf(aliasedSymbol) >= 0) { + return aliasedSymbol; + } + } // If the reference location is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this symbol to // compare to our searchSymbol @@ -49767,7 +50376,7 @@ var ts; // see if any is in the list if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { var result_3 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3, /*previousIterationSymbolsCache*/ {}); return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } return undefined; @@ -49777,19 +50386,19 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeChecker.getContextualType(objectLiteral); - var name_33 = node.text; + var name_36 = node.text; if (contextualType) { if (contextualType.flags & 16384 /* Union */) { // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) // if not, search the constituent types for the property - var unionProperty = contextualType.getProperty(name_33); + var unionProperty = contextualType.getProperty(name_36); if (unionProperty) { return [unionProperty]; } else { var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_33); + var symbol = t.getProperty(name_36); if (symbol) { result_4.push(symbol); } @@ -49798,7 +50407,7 @@ var ts; } } else { - var symbol_1 = contextualType.getProperty(name_33); + var symbol_1 = contextualType.getProperty(name_36); if (symbol_1) { return [symbol_1]; } @@ -49856,10 +50465,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 182 /* PostfixUnaryExpression */ || parent.kind === 181 /* PrefixUnaryExpression */) { + if (parent.kind === 183 /* PostfixUnaryExpression */ || parent.kind === 182 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 183 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 184 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; return 56 /* FirstAssignment */ <= operator && operator <= 68 /* LastAssignment */; } @@ -49890,34 +50499,34 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 138 /* Parameter */: - case 213 /* VariableDeclaration */: - case 165 /* BindingElement */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: - case 247 /* PropertyAssignment */: - case 248 /* ShorthandPropertyAssignment */: - case 249 /* EnumMember */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 144 /* Constructor */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 215 /* FunctionDeclaration */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: - case 246 /* CatchClause */: + case 139 /* Parameter */: + case 214 /* VariableDeclaration */: + case 166 /* BindingElement */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: + case 248 /* PropertyAssignment */: + case 249 /* ShorthandPropertyAssignment */: + case 250 /* EnumMember */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 145 /* Constructor */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 216 /* FunctionDeclaration */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: + case 247 /* CatchClause */: return 1 /* Value */; - case 137 /* TypeParameter */: - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: - case 155 /* TypeLiteral */: + case 138 /* TypeParameter */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: + case 156 /* TypeLiteral */: return 2 /* Type */; - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 220 /* ModuleDeclaration */: - if (node.name.kind === 9 /* StringLiteral */) { + case 221 /* ModuleDeclaration */: + if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { @@ -49926,15 +50535,15 @@ var ts; else { return 4 /* Namespace */; } - case 227 /* NamedImports */: - case 228 /* ImportSpecifier */: - case 223 /* ImportEqualsDeclaration */: - case 224 /* ImportDeclaration */: - case 229 /* ExportAssignment */: - case 230 /* ExportDeclaration */: + case 228 /* NamedImports */: + case 229 /* ImportSpecifier */: + case 224 /* ImportEqualsDeclaration */: + case 225 /* ImportDeclaration */: + case 230 /* ExportAssignment */: + case 231 /* ExportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; // An external module can be a Value - case 250 /* SourceFile */: + case 251 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; @@ -49943,10 +50552,10 @@ var ts; if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 151 /* TypeReference */ || - (node.parent.kind === 190 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + return node.parent.kind === 152 /* TypeReference */ || + (node.parent.kind === 191 /* ExpressionWithTypeArguments */ && !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || (node.kind === 97 /* ThisKeyword */ && !ts.isExpression(node)) || - node.kind === 161 /* ThisType */; + node.kind === 162 /* ThisType */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -49954,32 +50563,32 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 168 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 168 /* PropertyAccessExpression */) { + if (root.parent.kind === 169 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 169 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 190 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 245 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 191 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 246 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 216 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || - (decl.kind === 217 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); + return (decl.kind === 217 /* ClassDeclaration */ && root.parent.parent.token === 106 /* ImplementsKeyword */) || + (decl.kind === 218 /* InterfaceDeclaration */ && root.parent.parent.token === 83 /* ExtendsKeyword */); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 135 /* QualifiedName */) { - while (root.parent && root.parent.kind === 135 /* QualifiedName */) { + if (root.parent.kind === 136 /* QualifiedName */) { + while (root.parent && root.parent.kind === 136 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 151 /* TypeReference */ && !isLastClause; + return root.parent.kind === 152 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 135 /* QualifiedName */) { + while (node.parent.kind === 136 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -49989,15 +50598,15 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 135 /* QualifiedName */ && + if (node.parent.kind === 136 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 223 /* ImportEqualsDeclaration */) { + node.parent.parent.kind === 224 /* ImportEqualsDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 229 /* ExportAssignment */) { + if (node.parent.kind === 230 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -50037,16 +50646,16 @@ var ts; return; } switch (node.kind) { - case 168 /* PropertyAccessExpression */: - case 135 /* QualifiedName */: + case 169 /* PropertyAccessExpression */: + case 136 /* QualifiedName */: case 9 /* StringLiteral */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: case 84 /* FalseKeyword */: case 99 /* TrueKeyword */: case 93 /* NullKeyword */: case 95 /* SuperKeyword */: case 97 /* ThisKeyword */: - case 161 /* ThisType */: + case 162 /* ThisType */: case 69 /* Identifier */: break; // Cant create the text span @@ -50063,7 +50672,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 220 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 221 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -50104,10 +50713,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 220 /* ModuleDeclaration */: - case 216 /* ClassDeclaration */: - case 217 /* InterfaceDeclaration */: - case 215 /* FunctionDeclaration */: + case 221 /* ModuleDeclaration */: + case 217 /* ClassDeclaration */: + case 218 /* InterfaceDeclaration */: + case 216 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -50161,7 +50770,7 @@ var ts; */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 220 /* ModuleDeclaration */ && + return declaration.kind === 221 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */; }); } @@ -50212,6 +50821,9 @@ var ts; case 19 /* jsxOpenTagName */: return ClassificationTypeNames.jsxOpenTagName; case 20 /* jsxCloseTagName */: return ClassificationTypeNames.jsxCloseTagName; case 21 /* jsxSelfClosingTagName */: return ClassificationTypeNames.jsxSelfClosingTagName; + case 22 /* jsxAttribute */: return ClassificationTypeNames.jsxAttribute; + case 23 /* jsxText */: return ClassificationTypeNames.jsxText; + case 24 /* jsxAttributeStringLiteralValue */: return ClassificationTypeNames.jsxAttributeStringLiteralValue; } } function convertClassifications(classifications) { @@ -50319,16 +50931,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); pos = tag.tagName.end; switch (tag.kind) { - case 269 /* JSDocParameterTag */: + case 270 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 272 /* JSDocTemplateTag */: + case 273 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 271 /* JSDocTypeTag */: + case 272 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 270 /* JSDocReturnTag */: + case 271 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -50365,7 +50977,8 @@ var ts; function classifyDisabledMergeCode(text, start, end) { // Classify the line that the ======= marker is on as a comment. Then just lex // all further tokens and add them to the result. - for (var i = start; i < end; i++) { + var i; + for (i = start; i < end; i++) { if (ts.isLineBreak(text.charCodeAt(i))) { break; } @@ -50385,11 +50998,11 @@ var ts; pushClassification(start, end - start, type); } } - function classifyToken(token) { + function classifyTokenOrJsxText(token) { if (ts.nodeIsMissing(token)) { return; } - var tokenStart = classifyLeadingTriviaAndGetTokenStart(token); + var tokenStart = token.kind === 239 /* JsxText */ ? token.pos : classifyLeadingTriviaAndGetTokenStart(token); var tokenWidth = token.end - tokenStart; ts.Debug.assert(tokenWidth >= 0); if (tokenWidth > 0) { @@ -50419,16 +51032,17 @@ var ts; if (token) { if (tokenKind === 56 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 213 /* VariableDeclaration */ || - token.parent.kind === 141 /* PropertyDeclaration */ || - token.parent.kind === 138 /* Parameter */) { + if (token.parent.kind === 214 /* VariableDeclaration */ || + token.parent.kind === 142 /* PropertyDeclaration */ || + token.parent.kind === 139 /* Parameter */ || + token.parent.kind === 241 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 183 /* BinaryExpression */ || - token.parent.kind === 181 /* PrefixUnaryExpression */ || - token.parent.kind === 182 /* PostfixUnaryExpression */ || - token.parent.kind === 184 /* ConditionalExpression */) { + if (token.parent.kind === 184 /* BinaryExpression */ || + token.parent.kind === 182 /* PrefixUnaryExpression */ || + token.parent.kind === 183 /* PostfixUnaryExpression */ || + token.parent.kind === 185 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -50437,8 +51051,8 @@ var ts; else if (tokenKind === 8 /* NumericLiteral */) { return 4 /* numericLiteral */; } - else if (tokenKind === 9 /* StringLiteral */ || tokenKind === 162 /* StringLiteralType */) { - return 6 /* stringLiteral */; + else if (tokenKind === 9 /* StringLiteral */ || tokenKind === 163 /* StringLiteralType */) { + return token.parent.kind === 241 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 10 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -50448,54 +51062,61 @@ var ts; // TODO (drosen): we should *also* get another classification type for these literals. return 6 /* stringLiteral */; } + else if (tokenKind === 239 /* JsxText */) { + return 23 /* jsxText */; + } else if (tokenKind === 69 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 137 /* TypeParameter */: + case 138 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 217 /* InterfaceDeclaration */: + case 218 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 138 /* Parameter */: + case 139 /* Parameter */: if (token.parent.name === token) { return 17 /* parameterName */; } return; - case 237 /* JsxOpeningElement */: + case 238 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } return; - case 239 /* JsxClosingElement */: + case 240 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } return; - case 236 /* JsxSelfClosingElement */: + case 237 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } return; + case 241 /* JsxAttribute */: + if (token.parent.name === token) { + return 22 /* jsxAttribute */; + } } } return 2 /* identifier */; @@ -50511,8 +51132,8 @@ var ts; var children = element.getChildren(sourceFile); for (var i = 0, n = children.length; i < n; i++) { var child = children[i]; - if (ts.isToken(child)) { - classifyToken(child); + if (ts.isToken(child) || child.kind === 239 /* JsxText */) { + classifyTokenOrJsxText(child); } else { // Recurse into our child nodes. @@ -50638,19 +51259,19 @@ var ts; var commentOwner; findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 144 /* Constructor */: - case 216 /* ClassDeclaration */: - case 195 /* VariableStatement */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 145 /* Constructor */: + case 217 /* ClassDeclaration */: + case 196 /* VariableStatement */: break findOwner; - case 250 /* SourceFile */: + case 251 /* SourceFile */: return undefined; - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - if (commentOwner.parent.kind === 220 /* ModuleDeclaration */) { + if (commentOwner.parent.kind === 221 /* ModuleDeclaration */) { return undefined; } break findOwner; @@ -50692,7 +51313,7 @@ var ts; if (ts.isFunctionLike(commentOwner)) { return commentOwner.parameters; } - if (commentOwner.kind === 195 /* VariableStatement */) { + if (commentOwner.kind === 196 /* VariableStatement */) { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; if (varDeclarations.length === 1 && varDeclarations[0].initializer) { @@ -50710,17 +51331,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 174 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 175 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return rightHandSide.parameters; - case 188 /* ClassExpression */: + case 189 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 144 /* Constructor */) { + if (member.kind === 145 /* Constructor */) { return member.parameters; } } @@ -50974,7 +51595,7 @@ var ts; // then we want 'something' to be in the name table. Similarly, if we have // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 234 /* ExternalModuleReference */ || + node.parent.kind === 235 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -50987,7 +51608,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 169 /* ElementAccessExpression */ && + node.parent.kind === 170 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /// Classifier @@ -51246,7 +51867,7 @@ var ts; var end = scanner.getTextPos(); addResult(start, end, classFromKind(token)); if (end >= text.length) { - if (token === 9 /* StringLiteral */ || token === 162 /* StringLiteralType */) { + if (token === 9 /* StringLiteral */ || token === 163 /* StringLiteralType */) { // Check to see if we finished up on a multiline string literal. var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { @@ -51369,7 +51990,7 @@ var ts; } } function isKeyword(token) { - return token >= 70 /* FirstKeyword */ && token <= 134 /* LastKeyword */; + return token >= 70 /* FirstKeyword */ && token <= 135 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -51385,7 +52006,7 @@ var ts; case 8 /* NumericLiteral */: return 4 /* numericLiteral */; case 9 /* StringLiteral */: - case 162 /* StringLiteralType */: + case 163 /* StringLiteralType */: return 6 /* stringLiteral */; case 10 /* RegularExpressionLiteral */: return 7 /* regularExpressionLiteral */; @@ -51476,6 +52097,9 @@ var ts; startNode.getStart(sourceFile); return ts.createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } + function textSpanEndingAtNextToken(startNode, previousTokenToFindNextEndToken) { + return textSpan(startNode, ts.findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent)); + } function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); @@ -51493,132 +52117,114 @@ var ts; } function spanInNode(node) { if (node) { - if (ts.isExpression(node)) { - if (node.parent.kind === 199 /* DoStatement */) { - // Set span as if on while keyword - return spanInPreviousNode(node); - } - if (node.parent.kind === 139 /* Decorator */) { - // Set breakpoint on the decorator emit - return spanInNode(node.parent); - } - if (node.parent.kind === 201 /* ForStatement */) { - // For now lets set the span on this expression, fix it later - return textSpan(node); - } - if (node.parent.kind === 183 /* BinaryExpression */ && node.parent.operatorToken.kind === 24 /* CommaToken */) { - // if this is comma expression, the breakpoint is possible in this expression - return textSpan(node); - } - if (node.parent.kind === 176 /* ArrowFunction */ && node.parent.body === node) { - // If this is body of arrow function, it is allowed to have the breakpoint - return textSpan(node); - } - } switch (node.kind) { - case 195 /* VariableStatement */: + case 196 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 213 /* VariableDeclaration */: - case 141 /* PropertyDeclaration */: - case 140 /* PropertySignature */: + case 214 /* VariableDeclaration */: + case 142 /* PropertyDeclaration */: + case 141 /* PropertySignature */: return spanInVariableDeclaration(node); - case 138 /* Parameter */: + case 139 /* Parameter */: return spanInParameterDeclaration(node); - case 215 /* FunctionDeclaration */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - case 175 /* FunctionExpression */: - case 176 /* ArrowFunction */: + case 216 /* FunctionDeclaration */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 145 /* Constructor */: + case 176 /* FunctionExpression */: + case 177 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // Fall through - case 221 /* ModuleBlock */: + case 222 /* ModuleBlock */: return spanInBlock(node); - case 246 /* CatchClause */: + case 247 /* CatchClause */: return spanInBlock(node.block); - case 197 /* ExpressionStatement */: + case 198 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 206 /* ReturnStatement */: + case 207 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 200 /* WhileStatement */: + case 201 /* WhileStatement */: // Span on while(...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 199 /* DoStatement */: + return textSpanEndingAtNextToken(node, node.expression); + case 200 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 212 /* DebuggerStatement */: + case 213 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 198 /* IfStatement */: + case 199 /* IfStatement */: // set on if(..) span - return textSpan(node, ts.findNextToken(node.expression, node)); - case 209 /* LabeledStatement */: + return textSpanEndingAtNextToken(node, node.expression); + case 210 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 205 /* BreakStatement */: - case 204 /* ContinueStatement */: + case 206 /* BreakStatement */: + case 205 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 201 /* ForStatement */: + case 202 /* ForStatement */: return spanInForStatement(node); - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: - // span on for (a in ...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 208 /* SwitchStatement */: + case 203 /* ForInStatement */: + // span of for (a in ...) + return textSpanEndingAtNextToken(node, node.expression); + case 204 /* ForOfStatement */: + // span in initializer + return spanInInitializerOfForLike(node); + case 209 /* SwitchStatement */: // span on switch(...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 243 /* CaseClause */: - case 244 /* DefaultClause */: + return textSpanEndingAtNextToken(node, node.expression); + case 244 /* CaseClause */: + case 245 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 211 /* TryStatement */: + case 212 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 210 /* ThrowStatement */: + case 211 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 229 /* ExportAssignment */: + case 230 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 223 /* ImportEqualsDeclaration */: + case 224 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 224 /* ImportDeclaration */: + case 225 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 230 /* ExportDeclaration */: + case 231 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 216 /* ClassDeclaration */: - case 219 /* EnumDeclaration */: - case 249 /* EnumMember */: - case 170 /* CallExpression */: - case 171 /* NewExpression */: + case 217 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 250 /* EnumMember */: + case 166 /* BindingElement */: // span on complete node return textSpan(node); - case 207 /* WithStatement */: + case 208 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 139 /* Decorator */: + case 140 /* Decorator */: return spanInNodeArray(node.parent.decorators); + case 164 /* ObjectBindingPattern */: + case 165 /* ArrayBindingPattern */: + return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 217 /* InterfaceDeclaration */: - case 218 /* TypeAliasDeclaration */: + case 218 /* InterfaceDeclaration */: + case 219 /* TypeAliasDeclaration */: return undefined; // Tokens: case 23 /* SemicolonToken */: @@ -51630,6 +52236,8 @@ var ts; return spanInOpenBraceToken(node); case 16 /* CloseBraceToken */: return spanInCloseBraceToken(node); + case 20 /* CloseBracketToken */: + return spanInCloseBracketToken(node); case 17 /* OpenParenToken */: return spanInOpenParenToken(node); case 18 /* CloseParenToken */: @@ -51646,58 +52254,142 @@ var ts; case 72 /* CatchKeyword */: case 85 /* FinallyKeyword */: return spanInNextNode(node); + case 135 /* OfKeyword */: + return spanInOfKeyword(node); default: + // Destructuring pattern in destructuring assignment + // [a, b, c] of + // [a, b, c] = expression + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); + } + // Set breakpoint on identifier element of destructuring pattern + // a or ...c or d: x from + // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern + if ((node.kind === 69 /* Identifier */ || + node.kind == 188 /* SpreadElementExpression */ || + node.kind === 248 /* PropertyAssignment */ || + node.kind === 249 /* ShorthandPropertyAssignment */) && + ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + return textSpan(node); + } + if (node.kind === 184 /* BinaryExpression */) { + var binaryExpression = node; + // Set breakpoint in destructuring pattern if its destructuring assignment + // [a, b, c] or {a, b, c} of + // [a, b, c] = expression or + // {a, b, c} = expression + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); + } + if (binaryExpression.operatorToken.kind === 56 /* EqualsToken */ && + ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + // Set breakpoint on assignment expression element of destructuring pattern + // a = expression of + // [a = expression, b, c] = someExpression or + // { a = expression, b, c } = someExpression + return textSpan(node); + } + if (binaryExpression.operatorToken.kind === 24 /* CommaToken */) { + return spanInNode(binaryExpression.left); + } + } + if (ts.isExpression(node)) { + switch (node.parent.kind) { + case 200 /* DoStatement */: + // Set span as if on while keyword + return spanInPreviousNode(node); + case 140 /* Decorator */: + // Set breakpoint on the decorator emit + return spanInNode(node.parent); + case 202 /* ForStatement */: + case 204 /* ForOfStatement */: + return textSpan(node); + case 184 /* BinaryExpression */: + if (node.parent.operatorToken.kind === 24 /* CommaToken */) { + // if this is comma expression, the breakpoint is possible in this expression + return textSpan(node); + } + break; + case 177 /* ArrowFunction */: + if (node.parent.body === node) { + // If this is body of arrow function, it is allowed to have the breakpoint + return textSpan(node); + } + break; + } + } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 247 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 248 /* PropertyAssignment */ && + node.parent.name === node && + !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 173 /* TypeAssertionExpression */ && node.parent.type === node) { - return spanInNode(node.parent.expression); + if (node.parent.kind === 174 /* TypeAssertionExpression */ && node.parent.type === node) { + return spanInNextNode(node.parent.type); } // return type of function go to previous token if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } + // initializer of variable/parameter declaration go to previous node + if ((node.parent.kind === 214 /* VariableDeclaration */ || + node.parent.kind === 139 /* Parameter */)) { + var paramOrVarDecl = node.parent; + if (paramOrVarDecl.initializer === node || + paramOrVarDecl.type === node || + ts.isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + } + if (node.parent.kind === 184 /* BinaryExpression */) { + var binaryExpression = node.parent; + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && + (binaryExpression.right === node || + binaryExpression.operatorToken === node)) { + // If initializer of destructuring assignment move to previous token + return spanInPreviousNode(node); + } + } // Default go to parent to set the breakpoint return spanInNode(node.parent); } } + function textSpanFromVariableDeclaration(variableDeclaration) { + var declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] === variableDeclaration) { + // First declaration - include let keyword + return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + else { + // Span only on this declaration + return textSpan(variableDeclaration); + } + } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 202 /* ForInStatement */ || - variableDeclaration.parent.parent.kind === 203 /* ForOfStatement */) { + if (variableDeclaration.parent.parent.kind === 203 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 195 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 201 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); - var declarations = isParentVariableStatement - ? variableDeclaration.parent.parent.declarationList.declarations - : isDeclarationOfForStatement - ? variableDeclaration.parent.parent.initializer.declarations - : undefined; - // Breakpoint is possible in variableDeclaration only if there is initialization - if (variableDeclaration.initializer || (variableDeclaration.flags & 2 /* Export */)) { - if (declarations && declarations[0] === variableDeclaration) { - if (isParentVariableStatement) { - // First declaration - include let keyword - return textSpan(variableDeclaration.parent, variableDeclaration); - } - else { - ts.Debug.assert(isDeclarationOfForStatement); - // Include let keyword from for statement declarations in the span - return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); - } - } - else { - // Span only on this declaration - return textSpan(variableDeclaration); - } + // If this is a destructuring pattern set breakpoint in binding pattern + if (ts.isBindingPattern(variableDeclaration.name)) { + return spanInBindingPattern(variableDeclaration.name); } - else if (declarations && declarations[0] !== variableDeclaration) { + // Breakpoint is possible in variableDeclaration only if there is initialization + // or its declaration from 'for of' + if (variableDeclaration.initializer || + (variableDeclaration.flags & 2 /* Export */) || + variableDeclaration.parent.parent.kind === 204 /* ForOfStatement */) { + return textSpanFromVariableDeclaration(variableDeclaration); + } + var declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] !== variableDeclaration) { // If we cant set breakpoint on this declaration, set it on previous one - var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); - return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + // Because the variable declaration may be binding pattern and + // we would like to set breakpoint in last binding element if thats the case, + // use preceding token instead + return spanInNode(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } } function canHaveSpanInParameterDeclaration(parameter) { @@ -51706,7 +52398,11 @@ var ts; !!(parameter.flags & 8 /* Public */) || !!(parameter.flags & 16 /* Private */); } function spanInParameterDeclaration(parameter) { - if (canHaveSpanInParameterDeclaration(parameter)) { + if (ts.isBindingPattern(parameter.name)) { + // set breakpoint in binding pattern + return spanInBindingPattern(parameter.name); + } + else if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); } else { @@ -51724,7 +52420,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return !!(functionDeclaration.flags & 2 /* Export */) || - (functionDeclaration.parent.kind === 216 /* ClassDeclaration */ && functionDeclaration.kind !== 144 /* Constructor */); + (functionDeclaration.parent.kind === 217 /* ClassDeclaration */ && functionDeclaration.kind !== 145 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -51747,34 +52443,39 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 220 /* ModuleDeclaration */: + case 221 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement - case 200 /* WhileStatement */: - case 198 /* IfStatement */: - case 202 /* ForInStatement */: - case 203 /* ForOfStatement */: + case 201 /* WhileStatement */: + case 199 /* IfStatement */: + case 203 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 201 /* ForStatement */: + case 202 /* ForStatement */: + case 204 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } + function spanInInitializerOfForLike(forLikeStaement) { + if (forLikeStaement.initializer.kind === 215 /* VariableDeclarationList */) { + // declaration list, set breakpoint in first declaration + var variableDeclarationList = forLikeStaement.initializer; + if (variableDeclarationList.declarations.length > 0) { + return spanInNode(variableDeclarationList.declarations[0]); + } + } + else { + // Expression - set breakpoint in it + return spanInNode(forLikeStaement.initializer); + } + } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 214 /* VariableDeclarationList */) { - var variableDeclarationList = forStatement.initializer; - if (variableDeclarationList.declarations.length > 0) { - return spanInNode(variableDeclarationList.declarations[0]); - } - } - else { - return spanInNode(forStatement.initializer); - } + return spanInInitializerOfForLike(forStatement); } if (forStatement.condition) { return textSpan(forStatement.condition); @@ -51783,16 +52484,44 @@ var ts; return textSpan(forStatement.incrementor); } } + function spanInBindingPattern(bindingPattern) { + // Set breakpoint in first binding element + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 190 /* OmittedExpression */ ? element : undefined; }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + // Empty binding pattern of binding element, set breakpoint on binding element + if (bindingPattern.parent.kind === 166 /* BindingElement */) { + return textSpan(bindingPattern.parent); + } + // Variable declaration is used as the span + return textSpanFromVariableDeclaration(bindingPattern.parent); + } + function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { + ts.Debug.assert(node.kind !== 165 /* ArrayBindingPattern */ && node.kind !== 164 /* ObjectBindingPattern */); + var elements = node.kind === 167 /* ArrayLiteralExpression */ ? + node.elements : + node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 190 /* OmittedExpression */ ? element : undefined; }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + // Could be ArrayLiteral from destructuring assignment or + // just nested element in another destructuring assignment + // set breakpoint on assignment when parent is destructuring assignment + // Otherwise set breakpoint for this element + return textSpan(node.parent.kind === 184 /* BinaryExpression */ ? node.parent : node); + } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 219 /* EnumDeclaration */: + case 220 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 216 /* ClassDeclaration */: + case 217 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -51800,24 +52529,24 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 221 /* ModuleBlock */: + case 222 /* ModuleBlock */: // If this is not instantiated module block no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 219 /* EnumDeclaration */: - case 216 /* ClassDeclaration */: + case 220 /* EnumDeclaration */: + case 217 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 194 /* Block */: + case 195 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // fall through. - case 246 /* CatchClause */: + case 247 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 222 /* CaseBlock */: + case 223 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -51825,33 +52554,66 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; + case 164 /* ObjectBindingPattern */: + // Breakpoint in last binding element or binding pattern if it contains no elements + var bindingPattern = node.parent; + return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); // Default to parent node default: + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + var objectLiteral = node.parent; + return textSpan(ts.lastOrUndefined(objectLiteral.properties) || objectLiteral); + } + return spanInNode(node.parent); + } + } + function spanInCloseBracketToken(node) { + switch (node.parent.kind) { + case 165 /* ArrayBindingPattern */: + // Breakpoint in last binding element or binding pattern if it contains no elements + var bindingPattern = node.parent; + return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); + default: + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + var arrayLiteral = node.parent; + return textSpan(ts.lastOrUndefined(arrayLiteral.elements) || arrayLiteral); + } + // Default to parent node return spanInNode(node.parent); } } function spanInOpenParenToken(node) { - if (node.parent.kind === 199 /* DoStatement */) { - // Go to while keyword and do action instead + if (node.parent.kind === 200 /* DoStatement */ || + node.parent.kind === 171 /* CallExpression */ || + node.parent.kind === 172 /* NewExpression */) { return spanInPreviousNode(node); } + if (node.parent.kind === 175 /* ParenthesizedExpression */) { + return spanInNextNode(node); + } // Default to parent node return spanInNode(node.parent); } function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 175 /* FunctionExpression */: - case 215 /* FunctionDeclaration */: - case 176 /* ArrowFunction */: - case 143 /* MethodDeclaration */: - case 142 /* MethodSignature */: - case 145 /* GetAccessor */: - case 146 /* SetAccessor */: - case 144 /* Constructor */: - case 200 /* WhileStatement */: - case 199 /* DoStatement */: - case 201 /* ForStatement */: + case 176 /* FunctionExpression */: + case 216 /* FunctionDeclaration */: + case 177 /* ArrowFunction */: + case 144 /* MethodDeclaration */: + case 143 /* MethodSignature */: + case 146 /* GetAccessor */: + case 147 /* SetAccessor */: + case 145 /* Constructor */: + case 201 /* WhileStatement */: + case 200 /* DoStatement */: + case 202 /* ForStatement */: + case 204 /* ForOfStatement */: + case 171 /* CallExpression */: + case 172 /* NewExpression */: + case 175 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -51860,21 +52622,31 @@ var ts; } function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration - if (ts.isFunctionLike(node.parent) || node.parent.kind === 247 /* PropertyAssignment */) { + if (ts.isFunctionLike(node.parent) || + node.parent.kind === 248 /* PropertyAssignment */ || + node.parent.kind === 139 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 173 /* TypeAssertionExpression */) { - return spanInNode(node.parent.expression); + if (node.parent.kind === 174 /* TypeAssertionExpression */) { + return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 199 /* DoStatement */) { + if (node.parent.kind === 200 /* DoStatement */) { // Set span on while expression - return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); + return textSpanEndingAtNextToken(node, node.parent.expression); + } + // Default to parent node + return spanInNode(node.parent); + } + function spanInOfKeyword(node) { + if (node.parent.kind === 204 /* ForOfStatement */) { + // set using next token + return spanInNextNode(node); } // Default to parent node return spanInNode(node.parent); diff --git a/package.json b/package.json index 261cdfa64b7..cc74bf2c27c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "http://typescriptlang.org/", - "version": "1.8.0", + "version": "1.9.0", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index f7108c5d2d7..88a1a62ce4c 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -117,6 +117,12 @@ namespace ts { let labelIndexMap: Map; let implicitLabels: number[]; + // state used for emit helpers + let hasClassExtends: boolean; + let hasAsyncFunctions: boolean; + let hasDecorators: boolean; + let hasParameterDecorators: boolean; + // If this file is an external module, then it is automatically in strict-mode according to // ES6. If it is not an external module, then we'll determine if it is in strict mode or // not depending on if we see "use strict" in certain places (or if we hit a class/namespace). @@ -131,6 +137,7 @@ namespace ts { options = opts; inStrictMode = !!file.externalModuleIndicator; classifiableNames = {}; + Symbol = objectAllocator.getSymbolConstructor(); if (!file.locals) { @@ -150,6 +157,10 @@ namespace ts { labelStack = undefined; labelIndexMap = undefined; implicitLabels = undefined; + hasClassExtends = false; + hasAsyncFunctions = false; + hasDecorators = false; + hasParameterDecorators = false; } return bindSourceFile; @@ -191,8 +202,8 @@ namespace ts { // unless it is a well known Symbol. function getDeclarationName(node: Declaration): string { if (node.name) { - if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) { - return `"${(node.name).text}"`; + if (isAmbientModule(node)) { + return isGlobalScopeAugmentation(node) ? "__global" : `"${(node.name).text}"`; } if (node.name.kind === SyntaxKind.ComputedPropertyName) { const nameExpression = (node.name).expression; @@ -240,6 +251,15 @@ namespace ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.ClassDeclaration: return node.flags & NodeFlags.Default ? "default" : undefined; + case SyntaxKind.JSDocFunctionType: + return isJSDocConstructSignature(node) ? "__new" : "__call"; + case SyntaxKind.Parameter: + // Parameters with names are handled at the top of this function. Parameters + // without names can only come from JSDocFunctionTypes. + Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType); + let functionType = node.parent; + let index = indexOf(functionType.parameters, node); + return "p" + index; } } @@ -348,7 +368,12 @@ namespace ts { // 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol, // but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way // when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope. - if (hasExportModifier || container.flags & NodeFlags.ExportContext) { + + // NOTE: Nested ambient modules always should go to to 'locals' table to prevent their automatic merge + // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation + // and this case is specially handled. Module augmentations should only be merged with original module definition + // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. + if (!isAmbientModule(node) && (hasExportModifier || container.flags & NodeFlags.ExportContext)) { const exportKind = (symbolFlags & SymbolFlags.Value ? SymbolFlags.ExportValue : 0) | (symbolFlags & SymbolFlags.Type ? SymbolFlags.ExportType : 0) | @@ -405,7 +430,6 @@ namespace ts { addToContainerChain(container); } - else if (containerFlags & ContainerFlags.IsBlockScopedContainer) { blockScopeContainer = node; blockScopeContainer.locals = undefined; @@ -423,6 +447,9 @@ namespace ts { // reset all reachability check related flags on node (for incremental scenarios) flags &= ~NodeFlags.ReachabilityCheckFlags; + // reset all emit helper flags on node (for incremental scenarios) + flags &= ~NodeFlags.EmitHelperFlags; + if (kind === SyntaxKind.InterfaceDeclaration) { seenThisKeyword = false; } @@ -440,6 +467,10 @@ namespace ts { labelStack = labelIndexMap = implicitLabels = undefined; } + if (isInJavaScriptFile(node) && node.jsDocComment) { + bind(node.jsDocComment); + } + bindReachableStatement(node); if (currentReachabilityState === Reachability.Reachable && isFunctionLikeKind(kind) && nodeIsPresent((node).body)) { @@ -453,6 +484,21 @@ namespace ts { flags = seenThisKeyword ? flags | NodeFlags.ContainsThis : flags & ~NodeFlags.ContainsThis; } + if (kind === SyntaxKind.SourceFile) { + if (hasClassExtends) { + flags |= NodeFlags.HasClassExtends; + } + if (hasDecorators) { + flags |= NodeFlags.HasDecorators; + } + if (hasParameterDecorators) { + flags |= NodeFlags.HasParamDecorators; + } + if (hasAsyncFunctions) { + flags |= NodeFlags.HasAsyncFunctions; + } + } + node.flags = flags; if (saveState) { @@ -688,8 +734,9 @@ namespace ts { case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.EnumDeclaration: - case SyntaxKind.TypeLiteral: case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.TypeLiteral: + case SyntaxKind.JSDocRecordType: return ContainerFlags.IsContainer; case SyntaxKind.CallSignature: @@ -775,6 +822,7 @@ namespace ts { case SyntaxKind.TypeLiteral: case SyntaxKind.ObjectLiteralExpression: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.JSDocRecordType: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the @@ -795,6 +843,7 @@ namespace ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: + case SyntaxKind.JSDocFunctionType: case SyntaxKind.TypeAliasDeclaration: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, @@ -843,7 +892,10 @@ namespace ts { function bindModuleDeclaration(node: ModuleDeclaration) { setExportContextFlag(node); - if (node.name.kind === SyntaxKind.StringLiteral) { + if (isAmbientModule(node)) { + if (node.flags & NodeFlags.Export) { + errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); + } declareSymbolAndAddToSymbolTable(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes); } else { @@ -873,7 +925,7 @@ namespace ts { } } - function bindFunctionOrConstructorType(node: SignatureDeclaration) { + function bindFunctionOrConstructorType(node: SignatureDeclaration): void { // For a given function symbol "<...>(...) => T" we want to generate a symbol identical // to the one we would get for: { <...>(...): T } // @@ -948,7 +1000,7 @@ namespace ts { declareModuleMember(node, symbolFlags, symbolExcludes); break; } - // fall through. + // fall through. default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; @@ -1227,12 +1279,14 @@ namespace ts { return bindVariableDeclarationOrBindingElement(node); case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: + case SyntaxKind.JSDocRecordMember: return bindPropertyOrMethodOrAccessor(node, SymbolFlags.Property | ((node).questionToken ? SymbolFlags.Optional : SymbolFlags.None), SymbolFlags.PropertyExcludes); case SyntaxKind.PropertyAssignment: case SyntaxKind.ShorthandPropertyAssignment: return bindPropertyOrMethodOrAccessor(node, SymbolFlags.Property, SymbolFlags.PropertyExcludes); case SyntaxKind.EnumMember: return bindPropertyOrMethodOrAccessor(node, SymbolFlags.EnumMember, SymbolFlags.EnumMemberExcludes); + case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -1246,8 +1300,7 @@ namespace ts { return bindPropertyOrMethodOrAccessor(node, SymbolFlags.Method | ((node).questionToken ? SymbolFlags.Optional : SymbolFlags.None), isObjectLiteralMethod(node) ? SymbolFlags.PropertyExcludes : SymbolFlags.MethodExcludes); case SyntaxKind.FunctionDeclaration: - checkStrictModeFunctionName(node); - return declareSymbolAndAddToSymbolTable(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes); + return bindFunctionDeclaration(node); case SyntaxKind.Constructor: return declareSymbolAndAddToSymbolTable(node, SymbolFlags.Constructor, /*symbolExcludes:*/ SymbolFlags.None); case SyntaxKind.GetAccessor: @@ -1256,16 +1309,16 @@ namespace ts { return bindPropertyOrMethodOrAccessor(node, SymbolFlags.SetAccessor, SymbolFlags.SetAccessorExcludes); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: + case SyntaxKind.JSDocFunctionType: return bindFunctionOrConstructorType(node); case SyntaxKind.TypeLiteral: + case SyntaxKind.JSDocRecordType: return bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, "__type"); case SyntaxKind.ObjectLiteralExpression: return bindObjectLiteralExpression(node); case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - checkStrictModeFunctionName(node); - const bindingName = (node).name ? (node).name.text : "__function"; - return bindAnonymousDeclaration(node, SymbolFlags.Function, bindingName); + return bindFunctionExpression(node); case SyntaxKind.CallExpression: if (isInJavaScriptFile(node)) { @@ -1415,6 +1468,15 @@ namespace ts { } function bindClassLikeDeclaration(node: ClassLikeDeclaration) { + if (!isDeclarationFile(file) && !isInAmbientContext(node)) { + if (getClassExtendsHeritageClauseElement(node) !== undefined) { + hasClassExtends = true; + } + if (nodeIsDecorated(node)) { + hasDecorators = true; + } + } + if (node.kind === SyntaxKind.ClassDeclaration) { bindBlockScopedDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes); } @@ -1484,6 +1546,13 @@ namespace ts { } function bindParameter(node: ParameterDeclaration) { + if (!isDeclarationFile(file) && + !isInAmbientContext(node) && + nodeIsDecorated(node)) { + hasDecorators = true; + hasParameterDecorators = true; + } + if (inStrictMode) { // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) @@ -1505,7 +1574,39 @@ namespace ts { } } + function bindFunctionDeclaration(node: FunctionDeclaration) { + if (!isDeclarationFile(file) && !isInAmbientContext(node)) { + if (isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + + checkStrictModeFunctionName(node); + return declareSymbolAndAddToSymbolTable(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes); + } + + function bindFunctionExpression(node: FunctionExpression) { + if (!isDeclarationFile(file) && !isInAmbientContext(node)) { + if (isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + } + + checkStrictModeFunctionName(node); + const bindingName = (node).name ? (node).name.text : "__function"; + return bindAnonymousDeclaration(node, SymbolFlags.Function, bindingName); + } + function bindPropertyOrMethodOrAccessor(node: Declaration, symbolFlags: SymbolFlags, symbolExcludes: SymbolFlags) { + if (!isDeclarationFile(file) && !isInAmbientContext(node)) { + if (isAsyncFunctionLike(node)) { + hasAsyncFunctions = true; + } + if (nodeIsDecorated(node)) { + hasDecorators = true; + } + } + return hasDynamicName(node) ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e52982576b6..5ff16b51ae2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -65,6 +65,7 @@ namespace ts { getTypeCount: () => typeCount, isUndefinedSymbol: symbol => symbol === undefinedSymbol, isArgumentsSymbol: symbol => symbol === argumentsSymbol, + isUnknownSymbol: symbol => symbol === unknownSymbol, getDiagnostics, getGlobalDiagnostics, @@ -82,6 +83,7 @@ namespace ts { getSymbolsInScope, getSymbolAtLocation, getShorthandAssignmentValueSymbol, + getExportSpecifierLocalTargetSymbol, getTypeAtLocation: getTypeOfNode, typeToString, getSymbolDisplayBuilder, @@ -172,11 +174,6 @@ namespace ts { const unionTypes: Map = {}; const intersectionTypes: Map = {}; const stringLiteralTypes: Map = {}; - let emitExtends = false; - let emitDecorate = false; - let emitParam = false; - let emitAwaiter = false; - const emitGenerator = false; const resolutionTargets: TypeSystemEntity[] = []; const resolutionResults: boolean[] = []; @@ -375,6 +372,32 @@ namespace ts { } } + function mergeModuleAugmentation(moduleName: LiteralExpression): void { + const moduleAugmentation = moduleName.parent; + if (moduleAugmentation.symbol.valueDeclaration !== moduleAugmentation) { + // this is a combined symbol for multiple augmentations within the same file. + // its symbol already has accumulated information for all declarations + // so we need to add it just once - do the work only for first declaration + Debug.assert(moduleAugmentation.symbol.declarations.length > 1); + return; + } + + if (isGlobalScopeAugmentation(moduleAugmentation)) { + mergeSymbolTable(globals, moduleAugmentation.symbol.exports); + } + else { + // find a module that about to be augmented + let mainModule = resolveExternalModuleNameWorker(moduleName, moduleName, Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found); + if (!mainModule) { + return; + } + // if module symbol has already been merged - it is safe to use it. + // otherwise clone it + mainModule = mainModule.flags & SymbolFlags.Merged ? mainModule : cloneSymbol(mainModule); + mergeSymbol(mainModule, moduleAugmentation.symbol); + } + } + function addToSymbolTable(target: SymbolTable, source: SymbolTable, message: DiagnosticMessage) { for (const id in source) { if (hasProperty(source, id)) { @@ -404,22 +427,10 @@ namespace ts { return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } - function getSourceFile(node: Node): SourceFile { - return getAncestor(node, SyntaxKind.SourceFile); - } - function isGlobalSourceFile(node: Node) { return node.kind === SyntaxKind.SourceFile && !isExternalOrCommonJsModule(node); } - /** Is this type one of the apparent types created from the primitive types. */ - function isPrimitiveApparentType(type: Type): boolean { - return type === globalStringType || - type === globalNumberType || - type === globalBooleanType || - type === globalESSymbolType; - } - function getSymbol(symbols: SymbolTable, name: string, meaning: SymbolFlags): Symbol { if (meaning && hasProperty(symbols, name)) { const symbol = symbols[name]; @@ -442,7 +453,7 @@ namespace ts { * Get symbols that represent parameter-property-declaration as parameter and as property declaration * @param parameter a parameterDeclaration node * @param parameterName a name of the parameter to get the symbols for. - * @return a tuple of two symbols + * @return a tuple of two symbols */ function getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): [Symbol, Symbol] { const constructoDeclaration = parameter.parent; @@ -546,7 +557,9 @@ namespace ts { // - Type parameters of a function are in scope in the entire function declaration, including the parameter // list and return type. However, local types are only in scope in the function body. // - parameters are only in the scope of function body - if (meaning & result.flags & SymbolFlags.Type) { + // This restriction does not apply to JSDoc comment types because they are parented + // at a higher level than type parameters would normally be + if (meaning & result.flags & SymbolFlags.Type && lastLocation.kind !== SyntaxKind.JSDocComment) { useResult = result.flags & SymbolFlags.TypeParameter // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === (location).type || @@ -582,8 +595,7 @@ namespace ts { if (!isExternalOrCommonJsModule(location)) break; case SyntaxKind.ModuleDeclaration: const moduleExports = getSymbolOfNode(location).exports; - if (location.kind === SyntaxKind.SourceFile || - (location.kind === SyntaxKind.ModuleDeclaration && (location).name.kind === SyntaxKind.StringLiteral)) { + if (location.kind === SyntaxKind.SourceFile || isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. @@ -739,7 +751,9 @@ namespace ts { if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); + if (!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg)) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); + } } return undefined; } @@ -776,6 +790,43 @@ namespace ts { return result; } + function checkAndReportErrorForMissingPrefix(errorLocation: Node, name: string, nameArg: string | Identifier): boolean { + if (!errorLocation || (errorLocation.kind === SyntaxKind.Identifier && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + return false; + } + + const container = getThisContainer(errorLocation, /* includeArrowFunctions */ true); + let location = container; + while (location) { + if (isClassLike(location.parent)) { + const classSymbol = getSymbolOfNode(location.parent); + if (!classSymbol) { + break; + } + + // Check to see if a static member exists. + const constructorType = getTypeOfSymbol(classSymbol); + if (getPropertyOfType(constructorType, name)) { + error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg), symbolToString(classSymbol)); + return true; + } + + // No static member is present. + // Check if we're in an instance method and look for a relevant instance member. + if (location === container && !(location.flags & NodeFlags.Static)) { + const instanceType = (getDeclaredTypeOfSymbol(classSymbol)).thisType; + if (getPropertyOfType(instanceType, name)) { + error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); + return true; + } + } + } + + location = location.parent; + } + return false; + } + function checkResolvedBlockScopedVariable(result: Symbol, errorLocation: Node): void { Debug.assert((result.flags & SymbolFlags.BlockScopedVariable) !== 0); // Block-scoped variables cannot be used before their definition @@ -1077,6 +1128,10 @@ namespace ts { } function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression): Symbol { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, Diagnostics.Cannot_find_module_0); + } + + function resolveExternalModuleNameWorker(location: Node, moduleReferenceExpression: Expression, moduleNotFoundError: DiagnosticMessage): Symbol { if (moduleReferenceExpression.kind !== SyntaxKind.StringLiteral) { return; } @@ -1095,20 +1150,29 @@ namespace ts { if (!isRelative) { const symbol = getSymbol(globals, "\"" + moduleName + "\"", SymbolFlags.ValueModule); if (symbol) { - return symbol; + // merged symbol is module declaration symbol combined with all augmentations + return getMergedSymbol(symbol); } } - const resolvedModule = getResolvedModule(getSourceFile(location), moduleReferenceLiteral.text); + const resolvedModule = getResolvedModule(getSourceFileOfNode(location), moduleReferenceLiteral.text); const sourceFile = resolvedModule && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - return sourceFile.symbol; + // merged symbol is module declaration symbol combined with all augmentations + return getMergedSymbol(sourceFile.symbol); } - error(moduleReferenceLiteral, Diagnostics.File_0_is_not_a_module, sourceFile.fileName); - return; + if (moduleNotFoundError) { + // report errors only if it was requested + error(moduleReferenceLiteral, Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + } + return undefined; } - error(moduleReferenceLiteral, Diagnostics.Cannot_find_module_0, moduleName); + if (moduleNotFoundError) { + // report errors only if it was requested + error(moduleReferenceLiteral, moduleNotFoundError, moduleName); + } + return undefined; } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, @@ -1525,8 +1589,7 @@ namespace ts { } function hasExternalModuleSymbol(declaration: Node) { - return (declaration.kind === SyntaxKind.ModuleDeclaration && (declaration).name.kind === SyntaxKind.StringLiteral) || - (declaration.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(declaration)); + return isAmbientModule(declaration) || (declaration.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol: Symbol): SymbolVisibilityResult { @@ -1650,6 +1713,12 @@ namespace ts { return undefined; } + function isTopLevelInExternalModuleAugmentation(node: Node): boolean { + return node && node.parent && + node.parent.kind === SyntaxKind.ModuleBlock && + isExternalModuleAugmentation(node.parent.parent); + } + function getSymbolDisplayBuilder(): SymbolDisplayBuilder { function getNameOfSymbol(symbol: Symbol): string { @@ -2232,6 +2301,10 @@ namespace ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ImportEqualsDeclaration: + // external module augmentation is always visible + if (isExternalModuleAugmentation(node)) { + return true; + } const parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(getCombinedNodeFlags(node) & NodeFlags.Export) && @@ -2324,7 +2397,9 @@ namespace ts { const firstIdentifier = getFirstIdentifier(internalModuleReference); const importSymbol = resolveName(declaration, firstIdentifier.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, firstIdentifier); - buildVisibleNodeList(importSymbol.declarations); + if (importSymbol) { + buildVisibleNodeList(importSymbol.declarations); + } } }); } @@ -2409,7 +2484,7 @@ namespace ts { // Every class automatically contains a static property member named 'prototype', // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. // It is an error to explicitly declare a static property member with the name 'prototype'. - const classType = getDeclaredTypeOfSymbol(prototype.parent); + const classType = getDeclaredTypeOfSymbol(getMergedSymbol(prototype.parent)); return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, _ => anyType)) : classType; } @@ -2518,8 +2593,54 @@ namespace ts { return type; } + function getTypeForVariableLikeDeclarationFromJSDocComment(declaration: VariableLikeDeclaration) { + const jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration); + if (jsDocType) { + return getTypeFromTypeNode(jsDocType); + } + } + + function getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration: VariableLikeDeclaration): JSDocType { + // First, see if this node has an @type annotation on it directly. + const typeTag = getJSDocTypeTag(declaration); + if (typeTag) { + return typeTag.typeExpression.type; + } + + if (declaration.kind === SyntaxKind.VariableDeclaration && + declaration.parent.kind === SyntaxKind.VariableDeclarationList && + declaration.parent.parent.kind === SyntaxKind.VariableStatement) { + + // @type annotation might have been on the variable statement, try that instead. + const annotation = getJSDocTypeTag(declaration.parent.parent); + if (annotation) { + return annotation.typeExpression.type; + } + } + else if (declaration.kind === SyntaxKind.Parameter) { + // If it's a parameter, see if the parent has a jsdoc comment with an @param + // annotation. + const paramTag = getCorrespondingJSDocParameterTag(declaration); + if (paramTag && paramTag.typeExpression) { + return paramTag.typeExpression.type; + } + } + + return undefined; + } + // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration: VariableLikeDeclaration): Type { + if (declaration.parserContextFlags & ParserContextFlags.JavaScriptFile) { + // If this is a variable in a JavaScript file, then use the JSDoc type (if it has + // one as its type), otherwise fallback to the below standard TS codepaths to + // try to figure it out. + const type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration); + if (type && type !== unknownType) { + return type; + } + } + // A variable declared in a for..in statement is always of type string if (declaration.parent.parent.kind === SyntaxKind.ForInStatement) { return stringType; @@ -3837,6 +3958,17 @@ namespace ts { return getIndexTypeOfStructuredType(getApparentType(type), kind); } + function getTypeParametersFromJSDocTemplate(declaration: SignatureDeclaration): TypeParameter[] { + if (declaration.parserContextFlags & ParserContextFlags.JavaScriptFile) { + const templateTag = getJSDocTemplateTag(declaration); + if (templateTag) { + return getTypeParametersFromDeclaration(templateTag.typeParameters); + } + } + + return undefined; + } + // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual // type checking functions). function getTypeParametersFromDeclaration(typeParameterDeclarations: TypeParameterDeclaration[]): TypeParameter[] { @@ -3861,6 +3993,23 @@ namespace ts { } function isOptionalParameter(node: ParameterDeclaration) { + if (node.parserContextFlags & ParserContextFlags.JavaScriptFile) { + if (node.type && node.type.kind === SyntaxKind.JSDocOptionalType) { + return true; + } + + const paramTag = getCorrespondingJSDocParameterTag(node); + if (paramTag) { + if (paramTag.isBracketed) { + return true; + } + + if (paramTag.typeExpression) { + return paramTag.typeExpression.type.kind === SyntaxKind.JSDocOptionalType; + } + } + } + if (hasQuestionToken(node)) { return true; } @@ -3901,12 +4050,20 @@ namespace ts { getDeclaredTypeOfClassOrInterface(getMergedSymbol((declaration.parent).symbol)) : undefined; const typeParameters = classType ? classType.localTypeParameters : - declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; + declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : + getTypeParametersFromJSDocTemplate(declaration); const parameters: Symbol[] = []; let hasStringLiterals = false; let minArgumentCount = -1; - for (let i = 0, n = declaration.parameters.length; i < n; i++) { + const isJSConstructSignature = isJSDocConstructSignature(declaration); + let returnType: Type = undefined; + + // If this is a JSDoc construct signature, then skip the first parameter in the + // parameter list. The first parameter represents the return type of the construct + // signature. + for (let i = isJSConstructSignature ? 1 : 0, n = declaration.parameters.length; i < n; i++) { const param = declaration.parameters[i]; + let paramSymbol = param.symbol; // Include parameter symbol instead of property symbol in the signature if (paramSymbol && !!(paramSymbol.flags & SymbolFlags.Property) && !isBindingPattern(param.name)) { @@ -3914,6 +4071,7 @@ namespace ts { paramSymbol = resolvedSymbol; } parameters.push(paramSymbol); + if (param.type && param.type.kind === SyntaxKind.StringLiteralType) { hasStringLiterals = true; } @@ -3933,14 +4091,24 @@ namespace ts { minArgumentCount = declaration.parameters.length; } - let returnType: Type; - if (classType) { + if (isJSConstructSignature) { + minArgumentCount--; + returnType = getTypeFromTypeNode(declaration.parameters[0].type); + } + else if (classType) { returnType = classType; } else if (declaration.type) { returnType = getTypeFromTypeNode(declaration.type); } else { + if (declaration.parserContextFlags & ParserContextFlags.JavaScriptFile) { + const type = getReturnTypeFromJSDocComment(declaration); + if (type && type !== unknownType) { + returnType = type; + } + } + // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. if (declaration.kind === SyntaxKind.GetAccessor && !hasDynamicName(declaration)) { @@ -3977,6 +4145,7 @@ namespace ts { case SyntaxKind.SetAccessor: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: + case SyntaxKind.JSDocFunctionType: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -4116,7 +4285,7 @@ namespace ts { function hasConstraintReferenceTo(type: Type, target: TypeParameter): boolean { let checked: Type[]; - while (type && type.flags & TypeFlags.TypeParameter && !contains(checked, type)) { + while (type && !(type.flags & TypeFlags.ThisType) && type.flags & TypeFlags.TypeParameter && !contains(checked, type)) { if (type === target) { return true; } @@ -4196,7 +4365,7 @@ namespace ts { } // Get type from reference to class or interface - function getTypeFromClassOrInterfaceReference(node: TypeReferenceNode | ExpressionWithTypeArguments, symbol: Symbol): Type { + function getTypeFromClassOrInterfaceReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol): Type { const type = getDeclaredTypeOfSymbol(symbol); const typeParameters = type.localTypeParameters; if (typeParameters) { @@ -4219,7 +4388,7 @@ namespace ts { // Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include // references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the // declared type. Instantiations are cached using the type identities of the type arguments as the key. - function getTypeFromTypeAliasReference(node: TypeReferenceNode | ExpressionWithTypeArguments, symbol: Symbol): Type { + function getTypeFromTypeAliasReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol): Type { const type = getDeclaredTypeOfSymbol(symbol); const links = getSymbolLinks(symbol); const typeParameters = links.typeParameters; @@ -4240,7 +4409,7 @@ namespace ts { } // Get type from reference to named type that cannot be generic (enum or type parameter) - function getTypeFromNonGenericTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments, symbol: Symbol): Type { + function getTypeFromNonGenericTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol): Type { if (node.typeArguments) { error(node, Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); return unknownType; @@ -4248,18 +4417,83 @@ namespace ts { return getDeclaredTypeOfSymbol(symbol); } - function getTypeFromTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments): Type { + function getTypeReferenceName(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference): LeftHandSideExpression | EntityName { + switch (node.kind) { + case SyntaxKind.TypeReference: + return (node).typeName; + case SyntaxKind.JSDocTypeReference: + return (node).name; + case SyntaxKind.ExpressionWithTypeArguments: + // We only support expressions that are simple qualified names. For other + // expressions this produces undefined. + if (isSupportedExpressionWithTypeArguments(node)) { + return (node).expression; + } + + // fall through; + } + + return undefined; + } + + function resolveTypeReferenceName( + node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, + typeReferenceName: LeftHandSideExpression | EntityName) { + + if (!typeReferenceName) { + return unknownSymbol; + } + + return resolveEntityName(typeReferenceName, SymbolFlags.Type) || unknownSymbol; + } + + function getTypeReferenceType(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol) { + if (symbol === unknownSymbol) { + return unknownType; + } + + if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + return getTypeFromClassOrInterfaceReference(node, symbol); + } + + if (symbol.flags & SymbolFlags.TypeAlias) { + return getTypeFromTypeAliasReference(node, symbol); + } + + if (symbol.flags & SymbolFlags.Value && node.kind === SyntaxKind.JSDocTypeReference) { + // A JSDocTypeReference may have resolved to a value (as opposed to a type). In + // that case, the type of this reference is just the type of the value we resolved + // to. + return getTypeOfSymbol(symbol); + } + + return getTypeFromNonGenericTypeReference(node, symbol); + } + + function getTypeFromTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference): Type { const links = getNodeLinks(node); if (!links.resolvedType) { - // We only support expressions that are simple qualified names. For other expressions this produces undefined. - const typeNameOrExpression = node.kind === SyntaxKind.TypeReference ? (node).typeName : - isSupportedExpressionWithTypeArguments(node) ? (node).expression : - undefined; - const symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, SymbolFlags.Type) || unknownSymbol; - const type = symbol === unknownSymbol ? unknownType : - symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface) ? getTypeFromClassOrInterfaceReference(node, symbol) : - symbol.flags & SymbolFlags.TypeAlias ? getTypeFromTypeAliasReference(node, symbol) : - getTypeFromNonGenericTypeReference(node, symbol); + let symbol: Symbol; + let type: Type; + if (node.kind === SyntaxKind.JSDocTypeReference) { + const typeReferenceName = getTypeReferenceName(node); + symbol = resolveTypeReferenceName(node, typeReferenceName); + type = getTypeReferenceType(node, symbol); + + links.resolvedSymbol = symbol; + links.resolvedType = type; + } + else { + // We only support expressions that are simple qualified names. For other expressions this produces undefined. + const typeNameOrExpression = node.kind === SyntaxKind.TypeReference ? (node).typeName : + isSupportedExpressionWithTypeArguments(node) ? (node).expression : + undefined; + symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, SymbolFlags.Type) || unknownSymbol; + type = symbol === unknownSymbol ? unknownType : + symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface) ? getTypeFromClassOrInterfaceReference(node, symbol) : + symbol.flags & SymbolFlags.TypeAlias ? getTypeFromTypeAliasReference(node, symbol) : + getTypeFromNonGenericTypeReference(node, symbol); + } // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the // type reference in checkTypeReferenceOrExpressionWithTypeArguments. links.resolvedSymbol = symbol; @@ -4554,6 +4788,24 @@ namespace ts { return links.resolvedType; } + function getTypeFromJSDocVariadicType(node: JSDocVariadicType): Type { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const type = getTypeFromTypeNode(node.type); + links.resolvedType = type ? createArrayType(type) : unknownType; + } + return links.resolvedType; + } + + function getTypeFromJSDocTupleType(node: JSDocTupleType): Type { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const types = map(node.types, getTypeFromTypeNode); + links.resolvedType = createTupleType(types); + } + return links.resolvedType; + } + function getThisType(node: TypeNode): Type { const container = getThisContainer(node, /*includeArrowFunctions*/ false); const parent = container && container.parent; @@ -4597,6 +4849,8 @@ namespace ts { function getTypeFromTypeNode(node: TypeNode): Type { switch (node.kind) { case SyntaxKind.AnyKeyword: + case SyntaxKind.JSDocAllType: + case SyntaxKind.JSDocUnknownType: return anyType; case SyntaxKind.StringKeyword: return stringType; @@ -4613,6 +4867,7 @@ namespace ts { case SyntaxKind.StringLiteralType: return getTypeFromStringLiteralTypeNode(node); case SyntaxKind.TypeReference: + case SyntaxKind.JSDocTypeReference: return getTypeFromTypeReference(node); case SyntaxKind.TypePredicate: return getTypeFromPredicateTypeNode(node); @@ -4621,18 +4876,27 @@ namespace ts { case SyntaxKind.TypeQuery: return getTypeFromTypeQueryNode(node); case SyntaxKind.ArrayType: + case SyntaxKind.JSDocArrayType: return getTypeFromArrayTypeNode(node); case SyntaxKind.TupleType: return getTypeFromTupleTypeNode(node); case SyntaxKind.UnionType: + case SyntaxKind.JSDocUnionType: return getTypeFromUnionTypeNode(node); case SyntaxKind.IntersectionType: return getTypeFromIntersectionTypeNode(node); case SyntaxKind.ParenthesizedType: - return getTypeFromTypeNode((node).type); + case SyntaxKind.JSDocNullableType: + case SyntaxKind.JSDocNonNullableType: + case SyntaxKind.JSDocConstructorType: + case SyntaxKind.JSDocThisType: + case SyntaxKind.JSDocOptionalType: + return getTypeFromTypeNode((node).type); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: + case SyntaxKind.JSDocFunctionType: + case SyntaxKind.JSDocRecordType: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode @@ -4640,6 +4904,10 @@ namespace ts { case SyntaxKind.QualifiedName: const symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); + case SyntaxKind.JSDocTupleType: + return getTypeFromJSDocTupleType(node); + case SyntaxKind.JSDocVariadicType: + return getTypeFromJSDocVariadicType(node); default: return unknownType; } @@ -4903,6 +5171,10 @@ namespace ts { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? Ternary.True : Ternary.False; } + function compareTypesAssignable(source: Type, target: Type): Ternary { + return checkTypeRelatedTo(source, target, assignableRelation, /*errorNode*/ undefined) ? Ternary.True : Ternary.False; + } + function isTypeSubtypeOf(source: Type, target: Type): boolean { return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined); } @@ -4919,16 +5191,27 @@ namespace ts { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } + function isSignatureAssignableTo(source: Signature, + target: Signature, + ignoreReturnTypes: boolean): boolean { + return compareSignaturesRelated(source, target, ignoreReturnTypes, /*reportErrors*/ false, /*errorReporter*/ undefined, compareTypesAssignable) !== Ternary.False; + } + /** * See signatureRelatedTo, compareSignaturesIdentical */ - function isSignatureAssignableTo(source: Signature, target: Signature, ignoreReturnTypes: boolean): boolean { + function compareSignaturesRelated(source: Signature, + target: Signature, + ignoreReturnTypes: boolean, + reportErrors: boolean, + errorReporter: (d: DiagnosticMessage, arg0?: string, arg1?: string) => void, + compareTypes: (s: Type, t: Type, reportErrors?: boolean) => Ternary): Ternary { // TODO (drosen): De-duplicate code between related functions. if (source === target) { - return true; + return Ternary.True; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return Ternary.False; } // Spec 1.0 Section 3.8.3 & 3.8.4: @@ -4936,36 +5219,49 @@ namespace ts { source = getErasedSignature(source); target = getErasedSignature(target); + let result = Ternary.True; + const sourceMax = getNumNonRestParameters(source); const targetMax = getNumNonRestParameters(target); const checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + const sourceParams = source.parameters; + const targetParams = target.parameters; for (let i = 0; i < checkCount; i++) { - const s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - const t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - const related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + const s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); + const t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); + const related = compareTypes(t, s, /*reportErrors*/ false) || compareTypes(s, t, reportErrors); if (!related) { - return false; + if (reportErrors) { + errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, + sourceParams[i < sourceMax ? i : sourceMax].name, + targetParams[i < targetMax ? i : targetMax].name); + } + return Ternary.False; } + result &= related; } if (!ignoreReturnTypes) { const targetReturnType = getReturnTypeOfSignature(target); if (targetReturnType === voidType) { - return true; + return result; } const sourceReturnType = getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (targetReturnType.flags & TypeFlags.PredicateType && (targetReturnType as PredicateType).predicate.kind === TypePredicateKind.Identifier) { if (!(sourceReturnType.flags & TypeFlags.PredicateType)) { - return false; + if (reportErrors) { + errorReporter(Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); + } + return Ternary.False; } } - return isTypeAssignableTo(sourceReturnType, targetReturnType); + result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); } - return true; + return result; } function isImplementationCompatibleWithOverload(implementation: Signature, overload: Signature): boolean { @@ -5036,24 +5332,14 @@ namespace ts { let expandingFlags: number; let depth = 0; let overflow = false; - let elaborateErrors = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - const result = isRelatedTo(source, target, errorNode !== undefined, headMessage); + const result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage); if (overflow) { error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { - // If we already computed this relation, but in a context where we didn't want to report errors (e.g. overload resolution), - // then we'll only have a top-level error (e.g. 'Class X does not implement interface Y') without any details. If this happened, - // request a recompuation to get a complete error message. This will be skipped if we've already done this computation in a context - // where errors were being reported. - if (errorInfo.next === undefined) { - errorInfo = undefined; - elaborateErrors = true; - isRelatedTo(source, target, errorNode !== undefined, headMessage); - } if (containingMessageChain) { errorInfo = concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); } @@ -5063,6 +5349,7 @@ namespace ts { return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void { + Debug.assert(!!errorNode); errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } @@ -5200,14 +5487,14 @@ namespace ts { } // Even if relationship doesn't hold for unions, intersections, or generic type references, // it may hold in a structural comparison. - const apparentType = getApparentType(source); + const apparentSource = getApparentType(source); // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates // to X. Failing both of those we want to check if the aggregation of A and B's members structurally // relates to X. Thus, we include intersection types on the source side here. - if (apparentType.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) { + if (apparentSource.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) { // Report structural errors only if we haven't reported any errors yet - const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { + const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & TypeFlags.Primitive); + if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } @@ -5272,6 +5559,7 @@ namespace ts { // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. + Debug.assert(!!errorNode); errorNode = prop.valueDeclaration; reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); @@ -5374,7 +5662,7 @@ namespace ts { const id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; const related = relation[id]; if (related !== undefined) { - if (elaborateErrors && related === RelationComparisonResult.Failed) { + if (reportErrors && related === RelationComparisonResult.Failed) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. relation[id] = RelationComparisonResult.FailedAndReported; @@ -5594,7 +5882,7 @@ namespace ts { } // don't elaborate the primitive apparent types (like Number) // because the actual primitives will have already been reported. - if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + if (shouldElaborateErrors) { reportError(Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); @@ -5606,77 +5894,10 @@ namespace ts { } /** - * See signatureAssignableTo, signatureAssignableTo + * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): Ternary { - // TODO (drosen): De-duplicate code between related functions. - if (source === target) { - return Ternary.True; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return Ternary.False; - } - let sourceMax = source.parameters.length; - let targetMax = target.parameters.length; - let checkCount: number; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - // Spec 1.0 Section 3.8.3 & 3.8.4: - // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N - source = getErasedSignature(source); - target = getErasedSignature(target); - let result = Ternary.True; - for (let i = 0; i < checkCount; i++) { - const s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - const t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - const saveErrorInfo = errorInfo; - let related = isRelatedTo(s, t, reportErrors); - if (!related) { - related = isRelatedTo(t, s, /*reportErrors*/ false); - if (!related) { - if (reportErrors) { - reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, - source.parameters[i < sourceMax ? i : sourceMax].name, - target.parameters[i < targetMax ? i : targetMax].name); - } - return Ternary.False; - } - errorInfo = saveErrorInfo; - } - result &= related; - } - - const targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) { - return result; - } - const sourceReturnType = getReturnTypeOfSignature(source); - - // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions - if (targetReturnType.flags & TypeFlags.PredicateType && (targetReturnType as PredicateType).predicate.kind === TypePredicateKind.Identifier) { - if (!(sourceReturnType.flags & TypeFlags.PredicateType)) { - if (reportErrors) { - reportError(Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return Ternary.False; - } - } - - return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); + return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source: Type, target: Type, kind: SignatureKind): Ternary { @@ -6684,10 +6905,6 @@ namespace ts { if (typeInfo && typeInfo.type === undefinedType) { return type; } - // If the type to be narrowed is any and we're checking a primitive with assumeTrue=true, return the primitive - if (!!(type.flags & TypeFlags.Any) && typeInfo && assumeTrue) { - return typeInfo.type; - } let flags: TypeFlags; if (typeInfo) { flags = typeInfo.flags; @@ -6698,6 +6915,10 @@ namespace ts { } // At this point we can bail if it's not a union if (!(type.flags & TypeFlags.Union)) { + // If we're on the true branch and the type is a subtype, we should return the primitive type + if (assumeTrue && typeInfo && isTypeSubtypeOf(typeInfo.type, type)) { + return typeInfo.type; + } // If the active non-union type would be removed from a union by this type guard, return an empty union return filterUnion(type) ? type : emptyUnionType; } @@ -6926,7 +7147,6 @@ namespace ts { if (node.parserContextFlags & ParserContextFlags.Await) { getNodeLinks(container).flags |= NodeCheckFlags.CaptureArguments; - getNodeLinks(node).flags |= NodeCheckFlags.LexicalArguments; } } @@ -7070,18 +7290,25 @@ namespace ts { return container.flags & NodeFlags.Static ? getTypeOfSymbol(symbol) : (getDeclaredTypeOfSymbol(symbol)).thisType; } - // If this is a function in a JS file, it might be a class method. Check if it's the RHS - // of a x.prototype.y = function [name]() { .... } - if (isInJavaScriptFile(node) && container.kind === SyntaxKind.FunctionExpression) { - if (getSpecialPropertyAssignmentKind(container.parent) === SpecialPropertyAssignmentKind.PrototypeProperty) { - // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') - const className = (((container.parent as BinaryExpression) // x.protoype.y = f - .left as PropertyAccessExpression) // x.prototype.y - .expression as PropertyAccessExpression) // x.prototype - .expression; // x - const classSymbol = checkExpression(className).symbol; - if (classSymbol && classSymbol.members && (classSymbol.flags & SymbolFlags.Function)) { - return getInferredClassType(classSymbol); + if (isInJavaScriptFile(node)) { + const type = getTypeForThisExpressionFromJSDoc(container); + if (type && type !== unknownType) { + return type; + } + + // If this is a function in a JS file, it might be a class method. Check if it's the RHS + // of a x.prototype.y = function [name]() { .... } + if (container.kind === SyntaxKind.FunctionExpression) { + if (getSpecialPropertyAssignmentKind(container.parent) === SpecialPropertyAssignmentKind.PrototypeProperty) { + // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') + const className = (((container.parent as BinaryExpression) // x.protoype.y = f + .left as PropertyAccessExpression) // x.prototype.y + .expression as PropertyAccessExpression) // x.prototype + .expression; // x + const classSymbol = checkExpression(className).symbol; + if (classSymbol && classSymbol.members && (classSymbol.flags & SymbolFlags.Function)) { + return getInferredClassType(classSymbol); + } } } } @@ -7089,6 +7316,16 @@ namespace ts { return anyType; } + function getTypeForThisExpressionFromJSDoc(node: Node) { + const typeTag = getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression.type.kind === SyntaxKind.JSDocFunctionType) { + const jsDocFunctionType = typeTag.typeExpression.type; + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].type.kind === SyntaxKind.JSDocThisType) { + return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); + } + } + } + function isInConstructorArgumentInitializer(node: Node, constructorDecl: Node): boolean { for (let n = node; n && n !== constructorDecl; n = n.parent) { if (n.kind === SyntaxKind.Parameter) { @@ -7149,6 +7386,71 @@ namespace ts { getNodeLinks(node).flags |= nodeCheckFlag; + // Due to how we emit async functions, we need to specialize the emit for an async method that contains a `super` reference. + // This is due to the fact that we emit the body of an async function inside of a generator function. As generator + // functions cannot reference `super`, we emit a helper inside of the method body, but outside of the generator. This helper + // uses an arrow function, which is permitted to reference `super`. + // + // There are two primary ways we can access `super` from within an async method. The first is getting the value of a property + // or indexed access on super, either as part of a right-hand-side expression or call expression. The second is when setting the value + // of a property or indexed access, either as part of an assignment expression or destructuring assignment. + // + // The simplest case is reading a value, in which case we will emit something like the following: + // + // // ts + // ... + // async asyncMethod() { + // let x = await super.asyncMethod(); + // return x; + // } + // ... + // + // // js + // ... + // asyncMethod() { + // const _super = name => super[name]; + // return __awaiter(this, arguments, Promise, function *() { + // let x = yield _super("asyncMethod").call(this); + // return x; + // }); + // } + // ... + // + // The more complex case is when we wish to assign a value, especially as part of a destructuring assignment. As both cases + // are legal in ES6, but also likely less frequent, we emit the same more complex helper for both scenarios: + // + // // ts + // ... + // async asyncMethod(ar: Promise) { + // [super.a, super.b] = await ar; + // } + // ... + // + // // js + // ... + // asyncMethod(ar) { + // const _super = (function (geti, seti) { + // const cache = Object.create(null); + // return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); + // })(name => super[name], (name, value) => super[name] = value); + // return __awaiter(this, arguments, Promise, function *() { + // [_super("a").value, _super("b").value] = yield ar; + // }); + // } + // ... + // + // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. + // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment + // while a property access can. + if (container.kind === SyntaxKind.MethodDeclaration && container.flags & NodeFlags.Async) { + if (isSuperPropertyOrElementAccess(node.parent) && isAssignmentTarget(node.parent)) { + getNodeLinks(container).flags |= NodeCheckFlags.AsyncMethodWithSuperBinding; + } + else { + getNodeLinks(container).flags |= NodeCheckFlags.AsyncMethodWithSuper; + } + } + if (needToCaptureLexicalThis) { // call expressions are allowed only in constructors so they should always capture correct 'this' // super property access expressions can also appear in arrow functions - @@ -8120,6 +8422,7 @@ namespace ts { if (compilerOptions.noImplicitAny) { error(node, Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, JsxNames.IntrinsicElements); } + return unknownSymbol; } } @@ -8237,27 +8540,31 @@ namespace ts { // Get the element instance type (the result of newing or invoking this tag) const elemInstanceType = getJsxElementInstanceType(node); - // Is this is a stateless function component? See if its single signature is - // assignable to the JSX Element Type - const callSignature = getSingleCallSignature(getTypeOfSymbol(sym)); - const callReturnType = callSignature && getReturnTypeOfSignature(callSignature); - let paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); - if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType) && (paramType.flags & TypeFlags.ObjectType)) { - // Intersect in JSX.IntrinsicAttributes if it exists - const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttributes !== unknownType) { - paramType = intersectTypes(intrinsicAttributes, paramType); + const elemClassType = getJsxGlobalElementClassType(); + + if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) { + // Is this is a stateless function component? See if its single signature's return type is + // assignable to the JSX Element Type + const elemType = getTypeOfSymbol(sym); + const callSignatures = elemType && getSignaturesOfType(elemType, SignatureKind.Call); + const callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0]; + const callReturnType = callSignature && getReturnTypeOfSignature(callSignature); + let paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0])); + if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) { + // Intersect in JSX.IntrinsicAttributes if it exists + const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttributes !== unknownType) { + paramType = intersectTypes(intrinsicAttributes, paramType); + } + return links.resolvedJsxType = paramType; } - return paramType; } // Issue an error if this return type isn't assignable to JSX.ElementClass - const elemClassType = getJsxGlobalElementClassType(); if (elemClassType) { checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - if (isTypeAny(elemInstanceType)) { return links.resolvedJsxType = elemInstanceType; } @@ -8625,7 +8932,7 @@ namespace ts { function checkIndexedAccess(node: ElementAccessExpression): Type { // Grammar checking if (!node.argumentExpression) { - const sourceFile = getSourceFile(node); + const sourceFile = getSourceFileOfNode(node); if (node.parent.kind === SyntaxKind.NewExpression && (node.parent).expression === node) { const start = skipTrivia(sourceFile.text, node.expression.end); const end = node.end; @@ -9896,7 +10203,8 @@ namespace ts { if (declaration && declaration.kind !== SyntaxKind.Constructor && declaration.kind !== SyntaxKind.ConstructSignature && - declaration.kind !== SyntaxKind.ConstructorType) { + declaration.kind !== SyntaxKind.ConstructorType && + !isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -10016,6 +10324,13 @@ namespace ts { } } + function getReturnTypeFromJSDocComment(func: SignatureDeclaration | FunctionDeclaration): Type { + const returnTag = getJSDocReturnTag(func); + if (returnTag) { + return getTypeFromTypeNode(returnTag.typeExpression.type); + } + } + function createPromiseType(promisedType: Type): Type { // creates a `Promise` type where `T` is the promisedType argument const globalPromiseType = getGlobalPromiseType(); @@ -10166,7 +10481,8 @@ namespace ts { /* *TypeScript Specification 1.0 (6.3) - July 2014 - * An explicitly typed function whose return type isn't the Void or the Any type + * An explicitly typed function whose return type isn't the Void type, + * the Any type, or a union type containing the Void or Any type as a constituent * must have at least one return statement somewhere in its body. * An exception to this rule is if the function implementation consists of a single 'throw' statement. * @param returnType - return type of the function, can be undefined if return type is not explicitly specified @@ -10177,7 +10493,7 @@ namespace ts { } // Functions with with an explicitly specified 'void' or 'any' return type don't need any return expressions. - if (returnType === voidType || isTypeAny(returnType)) { + if (returnType === voidType || isTypeAny(returnType) || (returnType && (returnType.flags & TypeFlags.Union) && someConstituentTypeHasKind(returnType, TypeFlags.Any | TypeFlags.Void))) { return; } @@ -10226,11 +10542,6 @@ namespace ts { return anyFunctionType; } - const isAsync = isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } - const links = getNodeLinks(node); const type = getTypeOfSymbol(node.symbol); const contextSensitive = isContextSensitive(node); @@ -10279,10 +10590,6 @@ namespace ts { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); const isAsync = isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } - const returnOrPromisedType = node.type && (isAsync ? checkAsyncFunctionReturnType(node) : getTypeFromTypeNode(node.type)); if (!node.asteriskToken) { // return is not necessary in the body of generators @@ -11194,7 +11501,53 @@ namespace ts { return -1; } - function isInLegalParameterTypePredicatePosition(node: Node): boolean { + function checkTypePredicate(node: TypePredicateNode) { + const parent = getTypePredicateParent(node); + if (!parent) { + return; + } + const returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(parent)); + if (!returnType || !(returnType.flags & TypeFlags.PredicateType)) { + return; + } + const { parameterName } = node; + if (parameterName.kind === SyntaxKind.ThisType) { + getTypeFromThisTypeNode(parameterName as ThisTypeNode); + } + else { + const typePredicate = (returnType).predicate; + if (typePredicate.parameterIndex >= 0) { + if (parent.parameters[typePredicate.parameterIndex].dotDotDotToken) { + error(parameterName, + Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + } + else { + checkTypeAssignableTo(typePredicate.type, + getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), + node.type); + } + } + else if (parameterName) { + let hasReportedError = false; + for (const { name } of parent.parameters) { + if ((name.kind === SyntaxKind.ObjectBindingPattern || + name.kind === SyntaxKind.ArrayBindingPattern) && + checkIfTypePredicateVariableIsDeclaredInBindingPattern( + name, + parameterName, + typePredicate.parameterName)) { + hasReportedError = true; + break; + } + } + if (!hasReportedError) { + error(node.parameterName, Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + } + } + } + } + + function getTypePredicateParent(node: Node): SignatureDeclaration { switch (node.parent.kind) { case SyntaxKind.ArrowFunction: case SyntaxKind.CallSignature: @@ -11203,22 +11556,35 @@ namespace ts { case SyntaxKind.FunctionType: case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: - return node === (node.parent).type; + const parent = node.parent; + if (node === parent.type) { + return parent; + } } - return false; } - function isInLegalThisTypePredicatePosition(node: Node): boolean { - if (isInLegalParameterTypePredicatePosition(node)) { - return true; + function checkIfTypePredicateVariableIsDeclaredInBindingPattern( + pattern: BindingPattern, + predicateVariableNode: Node, + predicateVariableName: string) { + for (const { name } of pattern.elements) { + if (name.kind === SyntaxKind.Identifier && + (name).text === predicateVariableName) { + error(predicateVariableNode, + Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, + predicateVariableName); + return true; + } + else if (name.kind === SyntaxKind.ArrayBindingPattern || + name.kind === SyntaxKind.ObjectBindingPattern) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern( + name, + predicateVariableNode, + predicateVariableName)) { + return true; + } + } } - switch (node.parent.kind) { - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - case SyntaxKind.GetAccessor: - return node === (node.parent as (PropertyDeclaration | GetAccessorDeclaration | PropertySignature)).type; - } - return false; } function checkSignatureDeclaration(node: SignatureDeclaration) { @@ -11237,68 +11603,8 @@ namespace ts { forEach(node.parameters, checkParameter); - if (node.type) { - if (node.type.kind === SyntaxKind.TypePredicate) { - const returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - if (!returnType || !(returnType.flags & TypeFlags.PredicateType)) { - return; - } - const typePredicate = (returnType as PredicateType).predicate; - const typePredicateNode = node.type as TypePredicateNode; - checkSourceElement(typePredicateNode); - if (isIdentifierTypePredicate(typePredicate)) { - if (typePredicate.parameterIndex >= 0) { - if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { - error(typePredicateNode.parameterName, - Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); - } - else { - checkTypeAssignableTo(typePredicate.type, - getTypeOfNode(node.parameters[typePredicate.parameterIndex]), - typePredicateNode.type); - } - } - else if (typePredicateNode.parameterName) { - let hasReportedError = false; - for (var param of node.parameters) { - if (hasReportedError) { - break; - } - if (param.name.kind === SyntaxKind.ObjectBindingPattern || - param.name.kind === SyntaxKind.ArrayBindingPattern) { + checkSourceElement(node.type); - (function checkBindingPattern(pattern: BindingPattern) { - for (const element of pattern.elements) { - if (element.name.kind === SyntaxKind.Identifier && - (element.name).text === typePredicate.parameterName) { - - error(typePredicateNode.parameterName, - Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, - typePredicate.parameterName); - hasReportedError = true; - break; - } - else if (element.name.kind === SyntaxKind.ArrayBindingPattern || - element.name.kind === SyntaxKind.ObjectBindingPattern) { - - checkBindingPattern(element.name); - } - } - })(param.name); - } - } - if (!hasReportedError) { - error(typePredicateNode.parameterName, - Diagnostics.Cannot_find_parameter_0, - typePredicate.parameterName); - } - } - } - } - else { - checkSourceElement(node.type); - } - } if (produceDiagnostics) { checkCollisionWithArgumentsInGeneratedCode(node); @@ -12007,7 +12313,7 @@ namespace ts { case SyntaxKind.InterfaceDeclaration: return SymbolFlags.ExportType; case SyntaxKind.ModuleDeclaration: - return (d).name.kind === SyntaxKind.StringLiteral || getModuleInstanceState(d) !== ModuleInstanceState.NonInstantiated + return isAmbientModule(d) || getModuleInstanceState(d) !== ModuleInstanceState.NonInstantiated ? SymbolFlags.ExportNamespace | SymbolFlags.ExportValue : SymbolFlags.ExportNamespace; case SyntaxKind.ClassDeclaration: @@ -12416,11 +12722,6 @@ namespace ts { } } - emitDecorate = true; - if (node.kind === SyntaxKind.Parameter) { - emitParam = true; - } - forEach(node.decorators, checkDecorator); } @@ -12438,9 +12739,6 @@ namespace ts { checkDecorators(node); checkSignatureDeclaration(node); const isAsync = isAsyncFunctionLike(node); - if (isAsync) { - emitAwaiter = true; - } // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including @@ -12463,7 +12761,7 @@ namespace ts { // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function. const firstDeclaration = forEach(localSymbol.declarations, // Get first non javascript function declaration - declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFile(declaration)) ? + declaration => declaration.kind === node.kind && !isSourceFileJavaScript(getSourceFileOfNode(declaration)) ? declaration : undefined); // Only type check the symbol once @@ -13571,7 +13869,6 @@ namespace ts { const baseTypeNode = getClassExtendsHeritageClauseElement(node); if (baseTypeNode) { - emitExtends = emitExtends || !isInAmbientContext(node); const baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { const baseType = baseTypes[0]; @@ -14149,7 +14446,13 @@ namespace ts { function checkModuleDeclaration(node: ModuleDeclaration) { if (produceDiagnostics) { // Grammar checking - const isAmbientExternalModule = node.name.kind === SyntaxKind.StringLiteral; + const isGlobalAugmentation = isGlobalScopeAugmentation(node); + const inAmbientContext = isInAmbientContext(node); + if (isGlobalAugmentation && !inAmbientContext) { + error(node.name, Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + } + + const isAmbientExternalModule = isAmbientModule(node); const contextErrorMessage = isAmbientExternalModule ? Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module; @@ -14159,7 +14462,7 @@ namespace ts { } if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!isInAmbientContext(node) && node.name.kind === SyntaxKind.StringLiteral) { + if (!inAmbientContext && node.name.kind === SyntaxKind.StringLiteral) { grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); } } @@ -14172,7 +14475,7 @@ namespace ts { // The following checks only apply on a non-ambient instantiated module declaration. if (symbol.flags & SymbolFlags.ValueModule && symbol.declarations.length > 1 - && !isInAmbientContext(node) + && !inAmbientContext && isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) { const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { @@ -14193,19 +14496,107 @@ namespace ts { } } - // Checks for ambient external modules. if (isAmbientExternalModule) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + if (isExternalModuleAugmentation(node)) { + // body of the augmentation should be checked for consistency only if augmentation was applied to its target (either global scope or module) + // otherwise we'll be swamped in cascading errors. + // We can detect if augmentation was applied using following rules: + // - augmentation for a global scope is always applied + // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module). + const checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & SymbolFlags.Merged); + if (checkBody) { + // body of ambient external module is always a module block + for (const statement of (node.body).statements) { + checkModuleAugmentationElement(statement, isGlobalAugmentation); + } + } } - if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + else if (isGlobalSourceFile(node.parent)) { + if (isGlobalAugmentation) { + error(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else if (isExternalModuleNameRelative(node.name.text)) { + error(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + } + } + else { + if (isGlobalAugmentation) { + error(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } + else { + // Node is not an augmentation and is not located on the script level. + // This means that this is declaration of ambient module that is located in other module or namespace which is prohibited. + error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + } } } } checkSourceElement(node.body); } + function checkModuleAugmentationElement(node: Node, isGlobalAugmentation: boolean): void { + switch (node.kind) { + case SyntaxKind.VariableStatement: + // error each individual name in variable statement instead of marking the entire variable statement + for (const decl of (node).declarationList.declarations) { + checkModuleAugmentationElement(decl, isGlobalAugmentation); + } + break; + case SyntaxKind.ExportAssignment: + case SyntaxKind.ExportDeclaration: + grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); + break; + case SyntaxKind.ImportEqualsDeclaration: + if ((node).moduleReference.kind !== SyntaxKind.StringLiteral) { + error((node).name, Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + break; + } + // fallthrough + case SyntaxKind.ImportDeclaration: + grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); + break; + case SyntaxKind.BindingElement: + case SyntaxKind.VariableDeclaration: + const name = (node).name; + if (isBindingPattern(name)) { + for (const el of name.elements) { + // mark individual names in binding pattern + checkModuleAugmentationElement(el, isGlobalAugmentation); + } + break; + } + // fallthrough + case SyntaxKind.ClassDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.TypeAliasDeclaration: + const symbol = getSymbolOfNode(node); + if (symbol) { + // module augmentations cannot introduce new names on the top level scope of the module + // this is done it two steps + // 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error + // 2. main check - report error if value declaration of the parent symbol is module augmentation) + let reportError = !(symbol.flags & SymbolFlags.Merged); + if (!reportError) { + if (isGlobalAugmentation) { + // global symbol should not have parent since it is not explicitly exported + reportError = symbol.parent !== undefined; + } + else { + // symbol should not originate in augmentation + reportError = isExternalModuleAugmentation(symbol.parent.valueDeclaration); + } + } + if (reportError) { + error(node, Diagnostics.Module_augmentation_cannot_introduce_new_names_in_the_top_level_scope); + } + } + break; + } + } + function getFirstIdentifier(node: EntityName | Expression): Identifier { while (true) { if (node.kind === SyntaxKind.QualifiedName) { @@ -14228,7 +14619,7 @@ namespace ts { error(moduleName, Diagnostics.String_literal_expected); return false; } - const inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (node.parent.parent).name.kind === SyntaxKind.StringLiteral; + const inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && isAmbientModule(node.parent.parent); if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) { error(moduleName, node.kind === SyntaxKind.ExportDeclaration ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : @@ -14236,12 +14627,16 @@ namespace ts { return false; } if (inAmbientExternalModule && isExternalModuleNameRelative((moduleName).text)) { - // TypeScript 1.0 spec (April 2013): 12.1.6 - // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference - // other external modules only through top - level external module names. - // Relative external module names are not permitted. - error(node, Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); - return false; + // we have already reported errors on top level imports\exports in external module augmentations in checkModuleDeclaration + // no need to do this again. + if (!isTopLevelInExternalModuleAugmentation(node)) { + // TypeScript 1.0 spec (April 2013): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference + // other external modules only through top - level external module names. + // Relative external module names are not permitted. + error(node, Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + return false; + } } return true; } @@ -14347,7 +14742,7 @@ namespace ts { // export { x, y } from "foo" forEach(node.exportClause.elements, checkExportSpecifier); - const inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (node.parent.parent).name.kind === SyntaxKind.StringLiteral; + const inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && isAmbientModule(node.parent.parent); if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) { error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } @@ -14371,7 +14766,16 @@ namespace ts { function checkExportSpecifier(node: ExportSpecifier) { checkAliasSymbol(node); if (!(node.parent.parent).moduleSpecifier) { - markExportAsReferenced(node); + const exportedName = node.propertyName || node.name; + // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases) + const symbol = resolveName(exportedName, exportedName.text, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias, + /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); + if (symbol && (symbol === undefinedSymbol || isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { + error(exportedName, Diagnostics.Cannot_re_export_name_that_is_not_defined_in_the_module); + } + else { + markExportAsReferenced(node); + } } } @@ -14382,7 +14786,7 @@ namespace ts { } const container = node.parent.kind === SyntaxKind.SourceFile ? node.parent : node.parent.parent; - if (container.kind === SyntaxKind.ModuleDeclaration && (container).name.kind === SyntaxKind.Identifier) { + if (container.kind === SyntaxKind.ModuleDeclaration && !isAmbientModule(container)) { error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); return; } @@ -14412,7 +14816,7 @@ namespace ts { } function hasExportedMembers(moduleSymbol: Symbol) { - for (var id in moduleSymbol.exports) { + for (const id in moduleSymbol.exports) { if (id !== "export=") { return true; } @@ -14427,7 +14831,9 @@ namespace ts { const exportEqualsSymbol = moduleSymbol.exports["export="]; if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { const declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; - error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + if (!isTopLevelInExternalModuleAugmentation(declaration)) { + error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } } // Checks for export * conflicts const exports = getExportsOfModule(moduleSymbol); @@ -14454,20 +14860,6 @@ namespace ts { } } - function checkTypePredicate(node: TypePredicateNode) { - const { parameterName } = node; - if (parameterName.kind === SyntaxKind.Identifier && !isInLegalParameterTypePredicatePosition(node)) { - error(node, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } - else if (parameterName.kind === SyntaxKind.ThisType) { - if (!isInLegalThisTypePredicatePosition(node)) { - error(node, Diagnostics.A_this_based_type_predicate_is_only_allowed_within_a_class_or_interface_s_members_get_accessors_or_return_type_positions_for_functions_and_methods); - } - else { - getTypeFromThisTypeNode(parameterName as ThisTypeNode); - } - } - } function checkSourceElement(node: Node): void { if (!node) { @@ -14656,10 +15048,6 @@ namespace ts { // Grammar checking checkGrammarSourceFile(node); - emitExtends = false; - emitDecorate = false; - emitParam = false; - emitAwaiter = false; potentialThisCollisions.length = 0; deferredNodes = []; @@ -14676,26 +15064,6 @@ namespace ts { potentialThisCollisions.length = 0; } - if (emitExtends) { - links.flags |= NodeCheckFlags.EmitExtends; - } - - if (emitDecorate) { - links.flags |= NodeCheckFlags.EmitDecorate; - } - - if (emitParam) { - links.flags |= NodeCheckFlags.EmitParam; - } - - if (emitAwaiter) { - links.flags |= NodeCheckFlags.EmitAwaiter; - } - - if (emitGenerator || (emitAwaiter && languageVersion < ScriptTarget.ES6)) { - links.flags |= NodeCheckFlags.EmitGenerator; - } - links.flags |= NodeCheckFlags.TypeChecked; } } @@ -15071,11 +15439,18 @@ namespace ts { // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. if (location && location.kind === SyntaxKind.ShorthandPropertyAssignment) { - return resolveEntityName((location).name, SymbolFlags.Value); + return resolveEntityName((location).name, SymbolFlags.Value | SymbolFlags.Alias); } return undefined; } + /** Returns the target of an export specifier without following aliases */ + function getExportSpecifierLocalTargetSymbol(node: ExportSpecifier): Symbol { + return (node.parent.parent).moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias); + } + function getTypeOfNode(node: Node): Type { if (isInsideWithStatementBody(node)) { // We cannot answer semantic questions within a with block, do not proceed any further @@ -15518,13 +15893,13 @@ namespace ts { }; } - function getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration): SourceFile { - const specifier = getExternalModuleName(declaration); - const moduleSymbol = getSymbolAtLocation(specifier); - if (!moduleSymbol) { - return undefined; - } - return getDeclarationOfKind(moduleSymbol, SyntaxKind.SourceFile) as SourceFile; + function getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration): SourceFile { + const specifier = getExternalModuleName(declaration); + const moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); + if (!moduleSymbol) { + return undefined; + } + return getDeclarationOfKind(moduleSymbol, SyntaxKind.SourceFile) as SourceFile; } function initializeTypeChecker() { @@ -15533,13 +15908,27 @@ namespace ts { bindSourceFile(file, compilerOptions); }); + let augmentations: LiteralExpression[][]; // Initialize global symbol table forEach(host.getSourceFiles(), file => { if (!isExternalOrCommonJsModule(file)) { mergeSymbolTable(globals, file.locals); } + if (file.moduleAugmentations) { + (augmentations || (augmentations = [])).push(file.moduleAugmentations); + } }); + if (augmentations) { + // merge module augmentations. + // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed + for (const list of augmentations) { + for (const augmentation of list) { + mergeModuleAugmentation(augmentation); + } + } + } + // Setup global builtins addToSymbolTable(globals, builtinGlobals, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); @@ -16355,7 +16744,7 @@ namespace ts { return true; } else if (node.body === undefined) { - return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, Diagnostics._0_expected, "{"); + return grammarErrorAtPos(getSourceFileOfNode(node), node.end - 1, ";".length, Diagnostics._0_expected, "{"); } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 247a204e9bd..733e3158593 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -493,8 +493,8 @@ namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions: CompilerOptions = {}): ParsedCommandLine { - const { options: optionsFromJsonConfigFile, errors } = convertCompilerOptionsFromJson(json["compilerOptions"], basePath); + export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions: CompilerOptions = {}, configFileName?: string): ParsedCommandLine { + const { options: optionsFromJsonConfigFile, errors } = convertCompilerOptionsFromJson(json["compilerOptions"], basePath, configFileName); const options = extend(existingOptions, optionsFromJsonConfigFile); return { @@ -523,7 +523,7 @@ namespace ts { for (const extension of supportedExtensions) { const filesInDirWithExtension = host.readDirectory(basePath, extension, exclude); for (const fileName of filesInDirWithExtension) { - // .ts extension would read the .d.ts extension files too but since .d.ts is lower priority extension, + // .ts extension would read the .d.ts extension files too but since .d.ts is lower priority extension, // lets pick them when its turn comes up if (extension === ".ts" && fileExtensionIs(fileName, ".d.ts")) { continue; @@ -547,10 +547,15 @@ namespace ts { } } - export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string): { options: CompilerOptions, errors: Diagnostic[] } { + export function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions, errors: Diagnostic[] } { const options: CompilerOptions = {}; const errors: Diagnostic[] = []; + if (configFileName && getBaseFileName(configFileName) === "jsconfig.json") { + options.module = ModuleKind.CommonJS; + options.allowJs = true; + } + if (!jsonOptions) { return { options, errors }; } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 1ae130f0f2d..cfdcb2b930c 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -616,7 +616,9 @@ namespace ts { return path.substr(0, rootLength) + normalized.join(directorySeparator); } - export function getDirectoryPath(path: string) { + export function getDirectoryPath(path: Path): Path; + export function getDirectoryPath(path: string): string; + export function getDirectoryPath(path: string): any { return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(directorySeparator))); } @@ -716,7 +718,8 @@ namespace ts { } // Find the component that differs - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + let joinStartIndex: number; + for (joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } @@ -874,4 +877,11 @@ namespace ts { } return copiedList; } + + export function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string { + return useCaseSensitivefileNames + ? ((fileName) => fileName) + : ((fileName) => fileName.toLowerCase()); + } + } diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 75319d0ab51..9a57b4b1a37 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -54,6 +54,7 @@ namespace ts { let writer = createAndSetNewTextWriterWithSymbolWriter(); let enclosingDeclaration: Node; + let resultHasExternalModuleIndicator: boolean; let currentText: string; let currentLineMap: number[]; let currentIdentifiers: Map; @@ -101,6 +102,7 @@ namespace ts { }); } + resultHasExternalModuleIndicator = false; if (!isBundledEmit || !isExternalModule(sourceFile)) { noDeclare = false; emitSourceFile(sourceFile); @@ -139,6 +141,14 @@ namespace ts { allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } + + if (!isBundledEmit && isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { + // if file was external module with augmentations - this fact should be preserved in .d.ts as well. + // in case if we didn't write any external module specifiers in .d.ts we need to emit something + // that will force compiler to think that this file is an external module - 'export {}' is a reasonable choice here. + write("export {};"); + writeLine(); + } }); return { @@ -721,16 +731,25 @@ namespace ts { writer.writeLine(); } - function emitExternalModuleSpecifier(parent: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration) { + function emitExternalModuleSpecifier(parent: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration) { + // emitExternalModuleSpecifier is usually called when we emit something in the.d.ts file that will make it an external module (i.e. import/export declarations). + // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered + // external modules since they are indistingushable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' + // so compiler will treat them as external modules. + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== SyntaxKind.ModuleDeclaration; let moduleSpecifier: Node; if (parent.kind === SyntaxKind.ImportEqualsDeclaration) { const node = parent as ImportEqualsDeclaration; moduleSpecifier = getExternalModuleImportEqualsDeclarationExpression(node); } + else if (parent.kind === SyntaxKind.ModuleDeclaration) { + moduleSpecifier = (parent).name; + } else { const node = parent as (ImportDeclaration | ExportDeclaration); moduleSpecifier = node.moduleSpecifier; } + if (moduleSpecifier.kind === SyntaxKind.StringLiteral && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { const moduleName = getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -784,13 +803,23 @@ namespace ts { function writeModuleDeclaration(node: ModuleDeclaration) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); - if (node.flags & NodeFlags.Namespace) { - write("namespace "); + if (isGlobalScopeAugmentation(node)) { + write("global "); } else { - write("module "); + if (node.flags & NodeFlags.Namespace) { + write("namespace "); + } + else { + write("module "); + } + if (isExternalModuleAugmentation(node)) { + emitExternalModuleSpecifier(node); + } + else { + writeTextOfNode(currentText, node.name); + } } - writeTextOfNode(currentText, node.name); while (node.body.kind !== SyntaxKind.ModuleBlock) { node = node.body; write("."); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c97d529ca4a..d474a213a16 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -711,10 +711,6 @@ "category": "Error", "code": 1227 }, - "A type predicate is only allowed in return type position for functions and methods.": { - "category": "Error", - "code": 1228 - }, "A type predicate cannot reference a rest parameter.": { "category": "Error", "code": 1229 @@ -1655,10 +1651,6 @@ "category": "Error", "code": 2518 }, - "A 'this'-based type predicate is only allowed within a class or interface's members, get accessors, or return type positions for functions and methods.": { - "category": "Error", - "code": 2519 - }, "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions.": { "category": "Error", "code": 2520 @@ -1771,6 +1763,46 @@ "category": "Error", "code": 2660 }, + "Cannot re-export name that is not defined in the module.": { + "category": "Error", + "code": 2661 + }, + "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?": { + "category": "Error", + "code": 2662 + }, + "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?": { + "category": "Error", + "code": 2663 + }, + "Invalid module name in augmentation, module '{0}' cannot be found.": { + "category": "Error", + "code": 2664 + }, + "Module augmentation cannot introduce new names in the top level scope.": { + "category": "Error", + "code": 2665 + }, + "Exports and export assignments are not permitted in module augmentations.": { + "category": "Error", + "code": 2666 + }, + "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.": { + "category": "Error", + "code": 2667 + }, + "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.": { + "category": "Error", + "code": 2668 + }, + "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.": { + "category": "Error", + "code": 2669 + }, + "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context.": { + "category": "Error", + "code": 2670 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index e6286b06aac..a3fb38d32c8 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -319,17 +319,12 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { };`; const awaiterHelper = ` -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { - return new Promise(function (resolve, reject) { - generator = generator.call(thisArg, _arguments); - function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } - function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } - function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } - function step(verb, value) { - var result = generator[verb](value); - result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); - } - step("next", void 0); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); }); };`; @@ -464,8 +459,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const writer = createTextWriter(newLine); const { write, writeTextOfNode, writeLine, increaseIndent, decreaseIndent } = writer; - const sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? createSourceMapWriter(host, writer) : getNullSourceMapWriter(); - const { setSourceFile, emitStart, emitEnd, emitPos } = sourceMap; + let sourceMap = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? createSourceMapWriter(host, writer) : getNullSourceMapWriter(); + let { setSourceFile, emitStart, emitEnd, emitPos } = sourceMap; let currentSourceFile: SourceFile; let currentText: string; @@ -512,6 +507,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi /** If removeComments is true, no leading-comments needed to be emitted **/ const emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos: number) { } : emitLeadingCommentsOfPositionWorker; + const setSourceMapWriterEmit = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? changeSourceMapEmit : function (writer: SourceMapWriter) { }; + const moduleEmitDelegates: Map<(node: SourceFile, emitRelativePathAsModuleName?: boolean) => void> = { [ModuleKind.ES6]: emitES6Module, [ModuleKind.AMD]: emitAMDModule, @@ -1248,7 +1245,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi else { // One object literal with all the attributes in them write("{"); - for (var i = 0; i < attrs.length; i++) { + for (let i = 0, n = attrs.length; i < n; i++) { if (i > 0) { write(", "); } @@ -1260,7 +1257,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // Children if (children) { - for (var i = 0; i < children.length; i++) { + for (let i = 0; i < children.length; i++) { // Don't emit empty expressions if (children[i].kind === SyntaxKind.JsxExpression && !((children[i]).expression)) { continue; @@ -1354,7 +1351,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitJsxElement(node: JsxElement) { emitJsxOpeningOrSelfClosingElement(node.openingElement); - for (var i = 0, n = node.children.length; i < n; i++) { + for (let i = 0, n = node.children.length; i < n; i++) { emit(node.children[i]); } @@ -1491,11 +1488,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function emitExpressionIdentifier(node: Identifier) { - if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.LexicalArguments) { - write("_arguments"); - return; - } - const container = resolver.getReferencedExportContainer(node); if (container) { if (container.kind === SyntaxKind.SourceFile) { @@ -1975,7 +1967,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi result.expression = parenthesizeForAccess(expression); result.dotToken = createSynthesizedNode(SyntaxKind.DotToken); result.name = name; - return result; } @@ -2126,6 +2117,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return; } + if (languageVersion === ScriptTarget.ES6 && + node.expression.kind === SyntaxKind.SuperKeyword && + isInAsyncMethodWithSuperInES6(node)) { + const name = createSynthesizedNode(SyntaxKind.StringLiteral); + name.text = node.name.text; + emitSuperAccessInAsyncMethod(node.expression, name); + return; + } + emit(node.expression); const indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); @@ -2211,6 +2211,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (tryEmitConstantValue(node)) { return; } + + if (languageVersion === ScriptTarget.ES6 && + node.expression.kind === SyntaxKind.SuperKeyword && + isInAsyncMethodWithSuperInES6(node)) { + emitSuperAccessInAsyncMethod(node.expression, node.argumentExpression); + return; + } + emit(node.expression); write("["); emit(node.argumentExpression); @@ -2286,23 +2294,47 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(")"); } + function isInAsyncMethodWithSuperInES6(node: Node) { + if (languageVersion === ScriptTarget.ES6) { + const container = getSuperContainer(node, /*includeFunctions*/ false); + if (container && resolver.getNodeCheckFlags(container) & (NodeCheckFlags.AsyncMethodWithSuper | NodeCheckFlags.AsyncMethodWithSuperBinding)) { + return true; + } + } + + return false; + } + + function emitSuperAccessInAsyncMethod(superNode: Node, argumentExpression: Expression) { + const container = getSuperContainer(superNode, /*includeFunctions*/ false); + const isSuperBinding = resolver.getNodeCheckFlags(container) & NodeCheckFlags.AsyncMethodWithSuperBinding; + write("_super("); + emit(argumentExpression); + write(isSuperBinding ? ").value" : ")"); + } + function emitCallExpression(node: CallExpression) { if (languageVersion < ScriptTarget.ES6 && hasSpreadElement(node.arguments)) { emitCallWithSpread(node); return; } + + const expression = node.expression; let superCall = false; - if (node.expression.kind === SyntaxKind.SuperKeyword) { - emitSuper(node.expression); + let isAsyncMethodWithSuper = false; + if (expression.kind === SyntaxKind.SuperKeyword) { + emitSuper(expression); superCall = true; } else { - emit(node.expression); - superCall = node.expression.kind === SyntaxKind.PropertyAccessExpression && (node.expression).expression.kind === SyntaxKind.SuperKeyword; + superCall = isSuperPropertyOrElementAccess(expression); + isAsyncMethodWithSuper = superCall && isInAsyncMethodWithSuperInES6(node); + emit(expression); } - if (superCall && languageVersion < ScriptTarget.ES6) { + + if (superCall && (languageVersion < ScriptTarget.ES6 || isAsyncMethodWithSuper)) { write(".call("); - emitThis(node.expression); + emitThis(expression); if (node.arguments.length) { write(", "); emitCommaList(node.arguments); @@ -2568,7 +2600,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi leftHandSideExpression.argumentExpression.kind !== SyntaxKind.StringLiteral) { const tempArgumentExpression = createAndRecordTempVariable(TempFlags._i); (synthesizedLHS).argumentExpression = tempArgumentExpression; - emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true); + emitAssignment(tempArgumentExpression, leftHandSideExpression.argumentExpression, /*shouldEmitCommaBeforeAssignment*/ true, leftHandSideExpression.expression); } else { (synthesizedLHS).argumentExpression = leftHandSideExpression.argumentExpression; @@ -2796,7 +2828,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * Returns false if nothing was written - this can happen for source file level variable declarations * in system modules where such variable declarations are hoisted. */ - function tryEmitStartOfVariableDeclarationList(decl: VariableDeclarationList, startPos?: number): boolean { + function tryEmitStartOfVariableDeclarationList(decl: VariableDeclarationList): boolean { if (shouldHoistVariable(decl, /*checkIfSourceFileLevelDecl*/ true)) { // variables in variable declaration list were already hoisted return false; @@ -2811,34 +2843,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return false; } - let tokenKind = SyntaxKind.VarKeyword; + emitStart(decl); if (decl && languageVersion >= ScriptTarget.ES6) { if (isLet(decl)) { - tokenKind = SyntaxKind.LetKeyword; + write("let "); } else if (isConst(decl)) { - tokenKind = SyntaxKind.ConstKeyword; + write("const "); + } + else { + write("var "); } - } - - if (startPos !== undefined) { - emitToken(tokenKind, startPos); - write(" "); } else { - switch (tokenKind) { - case SyntaxKind.VarKeyword: - write("var "); - break; - case SyntaxKind.LetKeyword: - write("let "); - break; - case SyntaxKind.ConstKeyword: - write("const "); - break; - } + write("var "); } - + // Note here we specifically dont emit end so that if we are going to emit binding pattern + // we can alter the source map correctly return true; } @@ -2896,7 +2917,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: - if ((node).initializer.kind === SyntaxKind.VariableDeclarationList) { + const initializer = (node).initializer; + if (initializer && initializer.kind === SyntaxKind.VariableDeclarationList) { loopInitializer = (node).initializer; } break; @@ -3177,7 +3199,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi endPos = emitToken(SyntaxKind.OpenParenToken, endPos); if (node.initializer && node.initializer.kind === SyntaxKind.VariableDeclarationList) { const variableDeclarationList = node.initializer; - const startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + const startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList); if (startIsEmitted) { emitCommaList(variableDeclarationList.declarations); } @@ -3218,7 +3240,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (node.initializer.kind === SyntaxKind.VariableDeclarationList) { const variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { - tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); + tryEmitStartOfVariableDeclarationList(variableDeclarationList); emit(variableDeclarationList.declarations[0]); } } @@ -3305,21 +3327,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write("; "); // _i < _a.length; - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write(" < "); emitNodeWithCommentsAndWithoutSourcemap(rhsReference); write(".length"); - emitEnd(node.initializer); + emitEnd(node.expression); write("; "); // _i++) - emitStart(node.initializer); + emitStart(node.expression); emitNodeWithoutSourceMap(counter); write("++"); - emitEnd(node.initializer); + emitEnd(node.expression); emitToken(SyntaxKind.CloseParenToken, node.expression.end); // Body @@ -3719,7 +3741,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * @param value an expression as a right-hand-side operand of the assignment * @param shouldEmitCommaBeforeAssignment a boolean indicating whether to prefix an assignment with comma */ - function emitAssignment(name: Identifier, value: Expression, shouldEmitCommaBeforeAssignment: boolean) { + function emitAssignment(name: Identifier, value: Expression, shouldEmitCommaBeforeAssignment: boolean, nodeForSourceMap: Node) { if (shouldEmitCommaBeforeAssignment) { write(", "); } @@ -3735,15 +3757,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement); - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } + // If this is first var declaration, we need to start at var/let/const keyword instead + // otherwise use nodeForSourceMap as the start position + emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap); + withTemporaryNoSourceMap(() => { + if (isVariableDeclarationOrBindingElement) { + emitModuleMemberName(name.parent); + } + else { + emit(name); + } - write(" = "); - emit(value); + write(" = "); + emit(value); + }); + emitEnd(nodeForSourceMap, /*stopOverridingSpan*/true); if (exportChanged) { write(")"); @@ -3756,15 +3784,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * @param canDefineTempVariablesInPlace a boolean indicating whether you can define the temporary variable at an assignment location * @param shouldEmitCommaBeforeAssignment a boolean indicating whether an assignment should prefix with comma */ - function emitTempVariableAssignment(expression: Expression, canDefineTempVariablesInPlace: boolean, shouldEmitCommaBeforeAssignment: boolean): Identifier { + function emitTempVariableAssignment(expression: Expression, canDefineTempVariablesInPlace: boolean, shouldEmitCommaBeforeAssignment: boolean, sourceMapNode?: Node): Identifier { const identifier = createTempVariable(TempFlags.Auto); if (!canDefineTempVariablesInPlace) { recordTempDeclaration(identifier); } - emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment); + emitAssignment(identifier, expression, shouldEmitCommaBeforeAssignment, sourceMapNode || expression.parent); return identifier; } + function isFirstVariableDeclaration(root: Node) { + return root.kind === SyntaxKind.VariableDeclaration && + root.parent.kind === SyntaxKind.VariableDeclarationList && + (root.parent).declarations[0] === root; + } + function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) { let emitCount = 0; @@ -3787,6 +3821,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else { Debug.assert(!isAssignmentExpressionStatement); + // If first variable declaration of variable statement correct the start location + if (isFirstVariableDeclaration(root)) { + // Use emit location of "var " as next emit start entry + sourceMap.changeEmitSourcePos(); + } emitBindingElement(root, value); } @@ -3800,20 +3839,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi * @param reuseIdentifierExpressions true if identifier expressions can simply be returned; * false if it is necessary to always emit an identifier. */ - function ensureIdentifier(expr: Expression, reuseIdentifierExpressions: boolean): Expression { + function ensureIdentifier(expr: Expression, reuseIdentifierExpressions: boolean, sourceMapNode: Node): Expression { if (expr.kind === SyntaxKind.Identifier && reuseIdentifierExpressions) { return expr; } - const identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0); + const identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0, sourceMapNode); emitCount++; return identifier; } - function createDefaultValueCheck(value: Expression, defaultValue: Expression): Expression { + function createDefaultValueCheck(value: Expression, defaultValue: Expression, sourceMapNode: Node): Expression { // The value expression will be evaluated twice, so for anything but a simple identifier // we need to generate a temporary variable - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // If the temporary variable needs to be emitted use the source Map node for assignment of that statement + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); // Return the expression 'value === void 0 ? defaultValue : value' const equals = createSynthesizedNode(SyntaxKind.BinaryExpression); equals.left = value; @@ -3842,7 +3882,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi let index: Expression; const nameIsComputed = propName.kind === SyntaxKind.ComputedPropertyName; if (nameIsComputed) { - index = ensureIdentifier((propName).expression, /*reuseIdentifierExpressions*/ false); + // TODO to handle when we look into sourcemaps for computed properties, for now use propName + index = ensureIdentifier((propName).expression, /*reuseIdentifierExpressions*/ false, propName); } else { // We create a synthetic copy of the identifier in order to avoid the rewriting that might @@ -3866,61 +3907,66 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi return call; } - function emitObjectLiteralAssignment(target: ObjectLiteralExpression, value: Expression) { + function emitObjectLiteralAssignment(target: ObjectLiteralExpression, value: Expression, sourceMapNode: Node) { const properties = target.properties; if (properties.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (const p of properties) { if (p.kind === SyntaxKind.PropertyAssignment || p.kind === SyntaxKind.ShorthandPropertyAssignment) { const propName = (p).name; const target = p.kind === SyntaxKind.ShorthandPropertyAssignment ? p : (p).initializer || propName; - emitDestructuringAssignment(target, createPropertyAccessForDestructuringProperty(value, propName)); + // Assignment for target = value.propName should highligh whole property, hence use p as source map node + emitDestructuringAssignment(target, createPropertyAccessForDestructuringProperty(value, propName), p); } } } - function emitArrayLiteralAssignment(target: ArrayLiteralExpression, value: Expression) { + function emitArrayLiteralAssignment(target: ArrayLiteralExpression, value: Expression, sourceMapNode: Node) { const elements = target.elements; if (elements.length !== 1) { // For anything but a single element destructuring we need to generate a temporary // to ensure value is evaluated exactly once. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); + // When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode); } for (let i = 0; i < elements.length; i++) { const e = elements[i]; if (e.kind !== SyntaxKind.OmittedExpression) { + // Assignment for target = value.propName should highligh whole property, hence use e as source map node if (e.kind !== SyntaxKind.SpreadElementExpression) { - emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)), e); } else if (i === elements.length - 1) { - emitDestructuringAssignment((e).expression, createSliceCall(value, i)); + emitDestructuringAssignment((e).expression, createSliceCall(value, i), e); } } } } - function emitDestructuringAssignment(target: Expression | ShorthandPropertyAssignment, value: Expression) { + function emitDestructuringAssignment(target: Expression | ShorthandPropertyAssignment, value: Expression, sourceMapNode: Node) { + // When emitting target = value use source map node to highlight, including any temporary assignments needed for this if (target.kind === SyntaxKind.ShorthandPropertyAssignment) { if ((target).objectAssignmentInitializer) { - value = createDefaultValueCheck(value, (target).objectAssignmentInitializer); + value = createDefaultValueCheck(value, (target).objectAssignmentInitializer, sourceMapNode); } target = (target).name; } else if (target.kind === SyntaxKind.BinaryExpression && (target).operatorToken.kind === SyntaxKind.EqualsToken) { - value = createDefaultValueCheck(value, (target).right); + value = createDefaultValueCheck(value, (target).right, sourceMapNode); target = (target).left; } if (target.kind === SyntaxKind.ObjectLiteralExpression) { - emitObjectLiteralAssignment(target, value); + emitObjectLiteralAssignment(target, value, sourceMapNode); } else if (target.kind === SyntaxKind.ArrayLiteralExpression) { - emitArrayLiteralAssignment(target, value); + emitArrayLiteralAssignment(target, value, sourceMapNode); } else { - emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, sourceMapNode); emitCount++; } } @@ -3933,14 +3979,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi emit(value); } else if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + // Source map node for root.left = root.right is root + // but if root is synthetic, which could be in below case, use the target which is { a } + // for ({a} of {a: string}) { + // } + emitDestructuringAssignment(target, value, nodeIsSynthesized(root) ? target : root); } else { if (root.parent.kind !== SyntaxKind.ParenthesizedExpression) { write("("); } - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true); - emitDestructuringAssignment(target, value); + // Temporary assignment needed to emit root should highlight whole binary expression + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, root); + // Source map node for root.left = root.right is root + emitDestructuringAssignment(target, value, root); write(", "); emit(value); if (root.parent.kind !== SyntaxKind.ParenthesizedExpression) { @@ -3950,9 +4002,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } function emitBindingElement(target: BindingElement | VariableDeclaration, value: Expression) { + // Any temporary assignments needed to emit target = value should point to target if (target.initializer) { // Combine value and initializer - value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; + value = value ? createDefaultValueCheck(value, target.initializer, target) : target.initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer @@ -3968,7 +4021,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // to ensure value is evaluated exactly once. Additionally, if we have zero elements // we need to emit *something* to ensure that in case a 'var' keyword was already emitted, // so in that case, we'll intentionally create that temporary. - value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0); + value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ numElements !== 0, target); } for (let i = 0; i < numElements; i++) { @@ -3990,7 +4043,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } else { - emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0); + emitAssignment(target.name, value, /*shouldEmitCommaBeforeAssignment*/ emitCount > 0, target); emitCount++; } } @@ -4453,6 +4506,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi write(" {"); increaseIndent(); writeLine(); + + if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.AsyncMethodWithSuperBinding) { + writeLines(` +const _super = (function (geti, seti) { + const cache = Object.create(null); + return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); +})(name => super[name], (name, value) => super[name] = value);`); + writeLine(); + } + else if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.AsyncMethodWithSuper) { + write(`const _super = name => super[name];`); + writeLine(); + } + write("return"); } @@ -4472,12 +4539,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } // Emit the call to __awaiter. - if (hasLexicalArguments) { - write(", function* (_arguments)"); - } - else { - write(", function* ()"); - } + write(", function* ()"); // Emit the signature and body for the inner generator function. emitFunctionBody(node); @@ -5150,7 +5212,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // a lexical declaration such as a LexicalDeclaration or a ClassDeclaration. if (isClassExpressionWithStaticProperties) { - for (var property of staticProperties) { + for (const property of staticProperties) { write(","); writeLine(); emitPropertyDeclaration(node, property, /*receiver*/ tempVariable, /*isExpression*/ true); @@ -5697,7 +5759,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const parameters = valueDeclaration.parameters; const parameterCount = parameters.length; if (parameterCount > 0) { - for (var i = 0; i < parameterCount; i++) { + for (let i = 0; i < parameterCount; i++) { if (i > 0) { write(", "); } @@ -6083,6 +6145,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (contains(externalImports, node)) { const isExportedImport = node.kind === SyntaxKind.ImportEqualsDeclaration && (node.flags & NodeFlags.Export) !== 0; const namespaceDeclaration = getNamespaceDeclarationNode(node); + const varOrConst = (languageVersion <= ScriptTarget.ES5) ? "var " : "const "; if (modulekind !== ModuleKind.AMD) { emitLeadingComments(node); @@ -6090,7 +6153,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (namespaceDeclaration && !isDefaultImport(node)) { // import x = require("foo") // import * as x from "foo" - if (!isExportedImport) write("var "); + if (!isExportedImport) { + write(varOrConst); + }; emitModuleMemberName(namespaceDeclaration); write(" = "); } @@ -6102,7 +6167,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // import d, { x, y } from "foo" const isNakedImport = SyntaxKind.ImportDeclaration && !(node).importClause; if (!isNakedImport) { - write("var "); + write(varOrConst); write(getGeneratedNameForNode(node)); write(" = "); } @@ -6129,7 +6194,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else if (namespaceDeclaration && isDefaultImport(node)) { // import d, * as x from "foo" - write("var "); + write(varOrConst); emitModuleMemberName(namespaceDeclaration); write(" = "); write(getGeneratedNameForNode(node)); @@ -7332,12 +7397,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi if (!compilerOptions.noEmitHelpers) { // Only Emit __extends function when target ES5. // For target ES6 and above, we can emit classDeclaration as is. - if ((languageVersion < ScriptTarget.ES6) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitExtends)) { + if ((languageVersion < ScriptTarget.ES6) && (!extendsEmitted && node.flags & NodeFlags.HasClassExtends)) { writeLines(extendsHelper); extendsEmitted = true; } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitDecorate) { + if (!decorateEmitted && node.flags & NodeFlags.HasDecorators) { writeLines(decorateHelper); if (compilerOptions.emitDecoratorMetadata) { writeLines(metadataHelper); @@ -7345,12 +7410,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi decorateEmitted = true; } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitParam) { + if (!paramEmitted && node.flags & NodeFlags.HasParamDecorators) { writeLines(paramHelper); paramEmitted = true; } - if (!awaiterEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitAwaiter) { + if (!awaiterEmitted && node.flags & NodeFlags.HasAsyncFunctions) { writeLines(awaiterHelper); awaiterEmitted = true; } @@ -7434,6 +7499,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } } + function changeSourceMapEmit(writer: SourceMapWriter) { + sourceMap = writer; + emitStart = writer.emitStart; + emitEnd = writer.emitEnd; + emitPos = writer.emitPos; + setSourceFile = writer.setSourceFile; + } + + function withTemporaryNoSourceMap(callback: () => void) { + const prevSourceMap = sourceMap; + setSourceMapWriterEmit(getNullSourceMapWriter()); + callback(); + setSourceMapWriterEmit(prevSourceMap); + } + function isSpecializedCommentHandling(node: Node): boolean { switch (node.kind) { // All of these entities are emitted in a specialized fashion. As such, we allow diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 390ab210543..57bd9860d12 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -546,7 +546,7 @@ namespace ts { function getLanguageVariant(fileName: string) { // .tsx and .jsx files are treated as jsx language variant. - return fileExtensionIs(fileName, ".tsx") || fileExtensionIs(fileName, ".jsx") ? LanguageVariant.JSX : LanguageVariant.Standard; + return fileExtensionIs(fileName, ".tsx") || fileExtensionIs(fileName, ".jsx") || fileExtensionIs(fileName, ".js") ? LanguageVariant.JSX : LanguageVariant.Standard; } function initializeState(fileName: string, _sourceText: string, languageVersion: ScriptTarget, isJavaScriptFile: boolean, _syntaxCursor: IncrementalParser.SyntaxCursor) { @@ -611,44 +611,24 @@ namespace ts { fixupParentReferences(sourceFile); } - // If this is a javascript file, proactively see if we can get JSDoc comments for - // relevant nodes in the file. We'll use these to provide typing informaion if they're - // available. - if (isSourceFileJavaScript(sourceFile)) { - addJSDocComments(); - } - return sourceFile; } - function addJSDocComments() { - forEachChild(sourceFile, visit); - return; - function visit(node: Node) { - // Add additional cases as necessary depending on how we see JSDoc comments used - // in the wild. - switch (node.kind) { - case SyntaxKind.VariableStatement: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.Parameter: - addJSDocComment(node); - } - - forEachChild(node, visit); - } - } - - function addJSDocComment(node: Node) { - const comments = getLeadingCommentRangesOfNode(node, sourceFile); - if (comments) { - for (const comment of comments) { - const jsDocComment = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDocComment) { - node.jsDocComment = jsDocComment; + function addJSDocComment(node: T): T { + if (contextFlags & ParserContextFlags.JavaScriptFile) { + const comments = getLeadingCommentRangesOfNode(node, sourceFile); + if (comments) { + for (const comment of comments) { + const jsDocComment = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); + if (jsDocComment) { + node.jsDocComment = jsDocComment; + } } } } + + return node; } export function fixupParentReferences(sourceFile: Node) { @@ -896,17 +876,19 @@ namespace ts { return result; } - // Invokes the provided callback then unconditionally restores the parser to the state it - // was in immediately prior to invoking the callback. The result of invoking the callback - // is returned from this function. + /** Invokes the provided callback then unconditionally restores the parser to the state it + * was in immediately prior to invoking the callback. The result of invoking the callback + * is returned from this function. + */ function lookAhead(callback: () => T): T { return speculationHelper(callback, /*isLookAhead*/ true); } - // Invokes the provided callback. If the callback returns something falsy, then it restores - // the parser to the state it was in immediately prior to invoking the callback. If the - // callback returns something truthy, then the parser state is not rolled back. The result - // of invoking the callback is returned from this function. + /** Invokes the provided callback. If the callback returns something falsy, then it restores + * the parser to the state it was in immediately prior to invoking the callback. If the + * callback returns something truthy, then the parser state is not rolled back. The result + * of invoking the callback is returned from this function. + */ function tryParse(callback: () => T): T { return speculationHelper(callback, /*isLookAhead*/ false); } @@ -1948,11 +1930,8 @@ namespace ts { // TYPES - function parseTypeReferenceOrTypePredicate(): TypeReferenceNode | TypePredicateNode { + function parseTypeReference(): TypeReferenceNode { const typeName = parseEntityName(/*allowReservedWords*/ false, Diagnostics.Type_expected); - if (typeName.kind === SyntaxKind.Identifier && token === SyntaxKind.IsKeyword && !scanner.hasPrecedingLineBreak()) { - return parseTypePredicate(typeName as Identifier); - } const node = createNode(SyntaxKind.TypeReference, typeName.pos); node.typeName = typeName; if (!scanner.hasPrecedingLineBreak() && token === SyntaxKind.LessThanToken) { @@ -2068,7 +2047,8 @@ namespace ts { // contexts. In addition, parameter initializers are semantically disallowed in // overload signatures. So parameter initializers are transitively disallowed in // ambient contexts. - return finishNode(node); + + return addJSDocComment(finishNode(node)); } function parseBindingElementInitializer(inParameter: boolean) { @@ -2092,10 +2072,10 @@ namespace ts { if (returnTokenRequired) { parseExpected(returnToken); - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } else if (parseOptional(returnToken)) { - signature.type = parseType(); + signature.type = parseTypeOrTypePredicate(); } } @@ -2411,7 +2391,7 @@ namespace ts { case SyntaxKind.SymbolKeyword: // If these are followed by a dot, then parse these out as a dotted type reference instead. const node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReferenceOrTypePredicate(); + return node || parseTypeReference(); case SyntaxKind.StringLiteral: return parseStringLiteralTypeNode(); case SyntaxKind.VoidKeyword: @@ -2434,7 +2414,7 @@ namespace ts { case SyntaxKind.OpenParenToken: return parseParenthesizedType(); default: - return parseTypeReferenceOrTypePredicate(); + return parseTypeReference(); } } @@ -2541,6 +2521,28 @@ namespace ts { return false; } + function parseTypeOrTypePredicate(): TypeNode { + const typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); + const type = parseType(); + if (typePredicateVariable) { + const node = createNode(SyntaxKind.TypePredicate, typePredicateVariable.pos); + node.parameterName = typePredicateVariable; + node.type = type; + return finishNode(node); + } + else { + return type; + } + } + + function parseTypePredicatePrefix() { + const id = parseIdentifier(); + if (token === SyntaxKind.IsKeyword && !scanner.hasPrecedingLineBreak()) { + nextToken(); + return id; + } + } + function parseType(): TypeNode { // The rules about 'yield' only apply to actual code/expression contexts. They don't // apply to 'type' contexts. So we disable these parameters here before moving on. @@ -4409,6 +4411,9 @@ namespace ts { } continue; + case SyntaxKind.GlobalKeyword: + return nextToken() === SyntaxKind.OpenBraceToken; + case SyntaxKind.ImportKeyword: nextToken(); return token === SyntaxKind.StringLiteral || token === SyntaxKind.AsteriskToken || @@ -4473,6 +4478,7 @@ namespace ts { case SyntaxKind.ModuleKeyword: case SyntaxKind.NamespaceKeyword: case SyntaxKind.TypeKeyword: + case SyntaxKind.GlobalKeyword: // When these don't start a declaration, they're an identifier in an expression statement return true; @@ -4561,6 +4567,7 @@ namespace ts { case SyntaxKind.PublicKeyword: case SyntaxKind.AbstractKeyword: case SyntaxKind.StaticKeyword: + case SyntaxKind.GlobalKeyword: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -4588,6 +4595,7 @@ namespace ts { return parseTypeAliasDeclaration(fullStart, decorators, modifiers); case SyntaxKind.EnumKeyword: return parseEnumDeclaration(fullStart, decorators, modifiers); + case SyntaxKind.GlobalKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.NamespaceKeyword: return parseModuleDeclaration(fullStart, decorators, modifiers); @@ -4746,7 +4754,7 @@ namespace ts { setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); - return finishNode(node); + return addJSDocComment(finishNode(node)); } function parseFunctionDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray): FunctionDeclaration { @@ -4760,7 +4768,7 @@ namespace ts { const isAsync = !!(node.flags & NodeFlags.Async); fillSignature(SyntaxKind.ColonToken, /*yieldContext*/ isGenerator, /*awaitContext*/ isAsync, /*requireCompleteParameterList*/ false, node); node.body = parseFunctionBlockOrSemicolon(isGenerator, isAsync, Diagnostics.or_expected); - return finishNode(node); + return addJSDocComment(finishNode(node)); } function parseConstructorDeclaration(pos: number, decorators: NodeArray, modifiers: ModifiersArray): ConstructorDeclaration { @@ -5222,14 +5230,25 @@ namespace ts { const node = createNode(SyntaxKind.ModuleDeclaration, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - node.name = parseLiteralNode(/*internName*/ true); + if (token === SyntaxKind.GlobalKeyword) { + // parse 'global' as name of global scope augmentation + node.name = parseIdentifier(); + node.flags |= NodeFlags.GlobalAugmentation; + } + else { + node.name = parseLiteralNode(/*internName*/ true); + } node.body = parseModuleBlock(); return finishNode(node); } function parseModuleDeclaration(fullStart: number, decorators: NodeArray, modifiers: ModifiersArray): ModuleDeclaration { let flags = modifiers ? modifiers.flags : 0; - if (parseOptional(SyntaxKind.NamespaceKeyword)) { + if (token === SyntaxKind.GlobalKeyword) { + // global augmentation + return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); + } + else if (parseOptional(SyntaxKind.NamespaceKeyword)) { flags |= NodeFlags.Namespace; } else { @@ -5586,23 +5605,19 @@ namespace ts { export function parseJSDocTypeExpressionForTests(content: string, start: number, length: number) { initializeState("file.js", content, ScriptTarget.Latest, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); - const jsDocTypeExpression = parseJSDocTypeExpression(start, length); + scanner.setText(content, start, length); + token = scanner.scan(); + const jsDocTypeExpression = parseJSDocTypeExpression(); const diagnostics = parseDiagnostics; clearState(); return jsDocTypeExpression ? { jsDocTypeExpression, diagnostics } : undefined; } - // Parses out a JSDoc type expression. The starting position should be right at the open - // curly in the type expression. Returns 'undefined' if it encounters any errors while parsing. + // Parses out a JSDoc type expression. /* @internal */ - export function parseJSDocTypeExpression(start: number, length: number): JSDocTypeExpression { - scanner.setText(sourceText, start, length); - - // Prime the first token for us to start processing. - token = nextToken(); - - const result = createNode(SyntaxKind.JSDocTypeExpression); + export function parseJSDocTypeExpression(): JSDocTypeExpression { + const result = createNode(SyntaxKind.JSDocTypeExpression, scanner.getTokenPos()); parseExpected(SyntaxKind.OpenBraceToken); result.type = parseJSDocTopLevelType(); @@ -5900,7 +5915,8 @@ namespace ts { export function parseIsolatedJSDocComment(content: string, start: number, length: number) { initializeState("file.js", content, ScriptTarget.Latest, /*isJavaScriptFile*/ true, /*_syntaxCursor:*/ undefined); - const jsDocComment = parseJSDocComment(/*parent:*/ undefined, start, length); + sourceFile = { languageVariant: LanguageVariant.Standard, text: content }; + const jsDocComment = parseJSDocCommentWorker(start, length); const diagnostics = parseDiagnostics; clearState(); @@ -5908,12 +5924,19 @@ namespace ts { } export function parseJSDocComment(parent: Node, start: number, length: number): JSDocComment { + const saveToken = token; + const saveParseDiagnosticsLength = parseDiagnostics.length; + const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; + const comment = parseJSDocCommentWorker(start, length); if (comment) { - fixupParentReferences(comment); comment.parent = parent; } + token = saveToken; + parseDiagnostics.length = saveParseDiagnosticsLength; + parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; + return comment; } @@ -5928,69 +5951,69 @@ namespace ts { Debug.assert(end <= content.length); let tags: NodeArray; - let pos: number; - // NOTE(cyrusn): This is essentially a handwritten scanner for JSDocComments. I - // considered using an actual Scanner, but this would complicate things. The - // scanner would need to know it was in a Doc Comment. Otherwise, it would then - // produce comments *inside* the doc comment. In the end it was just easier to - // write a simple scanner rather than go that route. - if (length >= "/** */".length) { - if (content.charCodeAt(start) === CharacterCodes.slash && - content.charCodeAt(start + 1) === CharacterCodes.asterisk && - content.charCodeAt(start + 2) === CharacterCodes.asterisk && - content.charCodeAt(start + 3) !== CharacterCodes.asterisk) { + let result: JSDocComment; + // Check for /** (JSDoc opening part) + if (content.charCodeAt(start) === CharacterCodes.slash && + content.charCodeAt(start + 1) === CharacterCodes.asterisk && + content.charCodeAt(start + 2) === CharacterCodes.asterisk && + content.charCodeAt(start + 3) !== CharacterCodes.asterisk) { + + + // + 3 for leading /**, - 5 in total for /** */ + scanner.scanRange(start + 3, length - 5, () => { // Initially we can parse out a tag. We also have seen a starting asterisk. // This is so that /** * @type */ doesn't parse. let canParseTag = true; let seenAsterisk = true; - for (pos = start + "/**".length; pos < end; ) { - const ch = content.charCodeAt(pos); - pos++; + nextJSDocToken(); + while (token !== SyntaxKind.EndOfFileToken) { + switch (token) { + case SyntaxKind.AtToken: + if (canParseTag) { + parseTag(); + } + // This will take us to the end of the line, so it's OK to parse a tag on the next pass through the loop + seenAsterisk = false; + break; - if (ch === CharacterCodes.at && canParseTag) { - parseTag(); + case SyntaxKind.NewLineTrivia: + // After a line break, we can parse a tag, and we haven't seen an asterisk on the next line yet + canParseTag = true; + seenAsterisk = false; + break; - // Once we parse out a tag, we cannot keep parsing out tags on this line. - canParseTag = false; - continue; - } + case SyntaxKind.AsteriskToken: + if (seenAsterisk) { + // If we've already seen an asterisk, then we can no longer parse a tag on this line + canParseTag = false; + } + // Ignore the first asterisk on a line + seenAsterisk = true; + break; - if (isLineBreak(ch)) { - // After a line break, we can parse a tag, and we haven't seen as asterisk - // on the next line yet. - canParseTag = true; - seenAsterisk = false; - continue; - } - - if (isWhiteSpace(ch)) { - // Whitespace doesn't affect any of our parsing. - continue; - } - - // Ignore the first asterisk on a line. - if (ch === CharacterCodes.asterisk) { - if (seenAsterisk) { - // If we've already seen an asterisk, then we can no longer parse a tag - // on this line. + case SyntaxKind.Identifier: + // Anything else is doc comment text. We can't do anything with it. Because it + // wasn't a tag, we can no longer parse a tag on this line until we hit the next + // line break. canParseTag = false; - } - seenAsterisk = true; - continue; + break; + + case SyntaxKind.EndOfFileToken: + break; } - // Anything else is doc comment text. We can't do anything with it. Because it - // wasn't a tag, we can no longer parse a tag on this line until we hit the next - // line break. - canParseTag = false; + nextJSDocToken(); } - } + + result = createJSDocComment(); + + }); } - return createJSDocComment(); + return result; function createJSDocComment(): JSDocComment { if (!tags) { @@ -6003,17 +6026,18 @@ namespace ts { } function skipWhitespace(): void { - while (pos < end && isWhiteSpace(content.charCodeAt(pos))) { - pos++; + while (token === SyntaxKind.WhitespaceTrivia || token === SyntaxKind.NewLineTrivia) { + nextJSDocToken(); } } function parseTag(): void { - Debug.assert(content.charCodeAt(pos - 1) === CharacterCodes.at); - const atToken = createNode(SyntaxKind.AtToken, pos - 1); - atToken.end = pos; + Debug.assert(token === SyntaxKind.AtToken); + const atToken = createNode(SyntaxKind.AtToken, scanner.getTokenPos()); + atToken.end = scanner.getTextPos(); + nextJSDocToken(); - const tagName = scanIdentifier(); + const tagName = parseJSDocIdentifier(); if (!tagName) { return; } @@ -6044,7 +6068,7 @@ namespace ts { const result = createNode(SyntaxKind.JSDocTag, atToken.pos); result.atToken = atToken; result.tagName = tagName; - return finishNode(result, pos); + return finishNode(result); } function addTag(tag: JSDocTag): void { @@ -6060,14 +6084,11 @@ namespace ts { } function tryParseTypeExpression(): JSDocTypeExpression { - skipWhitespace(); - - if (content.charCodeAt(pos) !== CharacterCodes.openBrace) { + if (token !== SyntaxKind.OpenBraceToken) { return undefined; } - const typeExpression = parseJSDocTypeExpression(pos, end - pos); - pos = typeExpression.end; + const typeExpression = parseJSDocTypeExpression(); return typeExpression; } @@ -6077,18 +6098,25 @@ namespace ts { skipWhitespace(); let name: Identifier; let isBracketed: boolean; - if (content.charCodeAt(pos) === CharacterCodes.openBracket) { - pos++; - skipWhitespace(); - name = scanIdentifier(); + // Looking for something like '[foo]' or 'foo' + if (parseOptionalToken(SyntaxKind.OpenBracketToken)) { + name = parseJSDocIdentifier(); isBracketed = true; + + // May have an optional default, e.g. '[foo = 42]' + if (parseOptionalToken(SyntaxKind.EqualsToken)) { + parseExpression(); + } + + parseExpected(SyntaxKind.CloseBracketToken); } - else { - name = scanIdentifier(); + else if (token === SyntaxKind.Identifier) { + name = parseJSDocIdentifier(); } if (!name) { - parseErrorAtPosition(pos, 0, Diagnostics.Identifier_expected); + parseErrorAtPosition(scanner.getStartPos(), 0, Diagnostics.Identifier_expected); + return undefined; } let preName: Identifier, postName: Identifier; @@ -6110,95 +6138,90 @@ namespace ts { result.typeExpression = typeExpression; result.postParameterName = postName; result.isBracketed = isBracketed; - return finishNode(result, pos); + return finishNode(result); } function handleReturnTag(atToken: Node, tagName: Identifier): JSDocReturnTag { if (forEach(tags, t => t.kind === SyntaxKind.JSDocReturnTag)) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, Diagnostics._0_tag_already_specified, tagName.text); + parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, Diagnostics._0_tag_already_specified, tagName.text); } const result = createNode(SyntaxKind.JSDocReturnTag, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); - return finishNode(result, pos); + return finishNode(result); } function handleTypeTag(atToken: Node, tagName: Identifier): JSDocTypeTag { if (forEach(tags, t => t.kind === SyntaxKind.JSDocTypeTag)) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, Diagnostics._0_tag_already_specified, tagName.text); + parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, Diagnostics._0_tag_already_specified, tagName.text); } const result = createNode(SyntaxKind.JSDocTypeTag, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); - return finishNode(result, pos); + return finishNode(result); } function handleTemplateTag(atToken: Node, tagName: Identifier): JSDocTemplateTag { if (forEach(tags, t => t.kind === SyntaxKind.JSDocTemplateTag)) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, Diagnostics._0_tag_already_specified, tagName.text); + parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, Diagnostics._0_tag_already_specified, tagName.text); } + // Type parameter list looks like '@template T,U,V' const typeParameters = >[]; - typeParameters.pos = pos; + typeParameters.pos = scanner.getStartPos(); while (true) { - skipWhitespace(); - - const startPos = pos; - const name = scanIdentifier(); + const name = parseJSDocIdentifier(); if (!name) { - parseErrorAtPosition(startPos, 0, Diagnostics.Identifier_expected); + parseErrorAtPosition(scanner.getStartPos(), 0, Diagnostics.Identifier_expected); return undefined; } const typeParameter = createNode(SyntaxKind.TypeParameter, name.pos); typeParameter.name = name; - finishNode(typeParameter, pos); + finishNode(typeParameter); typeParameters.push(typeParameter); - skipWhitespace(); - if (content.charCodeAt(pos) !== CharacterCodes.comma) { + if (token === SyntaxKind.CommaToken) { + nextJSDocToken(); + } + else { break; } - - pos++; } - typeParameters.end = pos; - const result = createNode(SyntaxKind.JSDocTemplateTag, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = typeParameters; - return finishNode(result, pos); + finishNode(result); + typeParameters.end = result.end; + return result; } - function scanIdentifier(): Identifier { - const startPos = pos; - for (; pos < end; pos++) { - const ch = content.charCodeAt(pos); - if (pos === startPos && isIdentifierStart(ch, ScriptTarget.Latest)) { - continue; - } - else if (pos > startPos && isIdentifierPart(ch, ScriptTarget.Latest)) { - continue; - } + function nextJSDocToken(): SyntaxKind { + return token = scanner.scanJSDocToken(); + } - break; - } - - if (startPos === pos) { + function parseJSDocIdentifier(): Identifier { + if (token !== SyntaxKind.Identifier) { + parseErrorAtCurrentToken(Diagnostics.Identifier_expected); return undefined; } - const result = createNode(SyntaxKind.Identifier, startPos); - result.text = content.substring(startPos, pos); - return finishNode(result, pos); + const pos = scanner.getTokenPos(); + const end = scanner.getTextPos(); + const result = createNode(SyntaxKind.Identifier, pos); + result.text = content.substring(pos, end); + finishNode(result, end); + + nextJSDocToken(); + return result; } } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 6905e01b1e6..3fed8dcb596 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -12,7 +12,7 @@ namespace ts { const emptyArray: any[] = []; - export const version = "1.8.0"; + export const version = "1.9.0"; export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean): string { let fileName = "tsconfig.json"; @@ -361,7 +361,24 @@ namespace ts { const currentDirectory = host.getCurrentDirectory(); const resolveModuleNamesWorker = host.resolveModuleNames ? ((moduleNames: string[], containingFile: string) => host.resolveModuleNames(moduleNames, containingFile)) - : ((moduleNames: string[], containingFile: string) => map(moduleNames, moduleName => resolveModuleName(moduleName, containingFile, options, host).resolvedModule)); + : ((moduleNames: string[], containingFile: string) => { + const resolvedModuleNames: ResolvedModule[] = []; + // resolveModuleName does not store any results between calls. + // lookup is a local cache to avoid resolving the same module name several times + const lookup: Map = {}; + for (const moduleName of moduleNames) { + let resolvedName: ResolvedModule; + if (hasProperty(lookup, moduleName)) { + resolvedName = lookup[moduleName]; + } + else { + resolvedName = resolveModuleName(moduleName, containingFile, options, host).resolvedModule; + lookup[moduleName] = resolvedName; + } + resolvedModuleNames.push(resolvedName); + } + return resolvedModuleNames; + }); const filesByName = createFileMap(); // stores 'filename -> file association' ignoring case @@ -498,15 +515,19 @@ namespace ts { return false; } - // check imports + // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed return false; } + if (!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { + // moduleAugmentations has changed + return false; + } if (resolveModuleNamesWorker) { - const moduleNames = map(newSourceFile.imports, name => name.text); + const moduleNames = map(concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral); const resolutions = resolveModuleNamesWorker(moduleNames, getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory)); // ensure that module resolution results are still correct for (let i = 0; i < moduleNames.length; i++) { @@ -895,65 +916,85 @@ namespace ts { return a.text === b.text; } + function getTextOfLiteral(literal: LiteralExpression): string { + return literal.text; + } + function collectExternalModuleReferences(file: SourceFile): void { if (file.imports) { return; } const isJavaScriptFile = isSourceFileJavaScript(file); + const isExternalModuleFile = isExternalModule(file); let imports: LiteralExpression[]; + let moduleAugmentations: LiteralExpression[]; + for (const node of file.statements) { - collect(node, /*allowRelativeModuleNames*/ true, /*collectOnlyRequireCalls*/ false); + collectModuleReferences(node, /*inAmbientModule*/ false); + if (isJavaScriptFile) { + collectRequireCalls(node); + } } file.imports = imports || emptyArray; + file.moduleAugmentations = moduleAugmentations || emptyArray; return; - function collect(node: Node, allowRelativeModuleNames: boolean, collectOnlyRequireCalls: boolean): void { - if (!collectOnlyRequireCalls) { - switch (node.kind) { - case SyntaxKind.ImportDeclaration: - case SyntaxKind.ImportEqualsDeclaration: - case SyntaxKind.ExportDeclaration: - let moduleNameExpr = getExternalModuleName(node); - if (!moduleNameExpr || moduleNameExpr.kind !== SyntaxKind.StringLiteral) { - break; - } - if (!(moduleNameExpr).text) { - break; - } - - if (allowRelativeModuleNames || !isExternalModuleNameRelative((moduleNameExpr).text)) { - (imports || (imports = [])).push(moduleNameExpr); - } + function collectModuleReferences(node: Node, inAmbientModule: boolean): void { + switch (node.kind) { + case SyntaxKind.ImportDeclaration: + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ExportDeclaration: + let moduleNameExpr = getExternalModuleName(node); + if (!moduleNameExpr || moduleNameExpr.kind !== SyntaxKind.StringLiteral) { break; - case SyntaxKind.ModuleDeclaration: - if ((node).name.kind === SyntaxKind.StringLiteral && (node.flags & NodeFlags.Ambient || isDeclarationFile(file))) { - // TypeScript 1.0 spec (April 2014): 12.1.6 + } + if (!(moduleNameExpr).text) { + break; + } + + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference other external modules + // only through top - level external module names. Relative external module names are not permitted. + if (!inAmbientModule || !isExternalModuleNameRelative((moduleNameExpr).text)) { + (imports || (imports = [])).push(moduleNameExpr); + } + break; + case SyntaxKind.ModuleDeclaration: + if (isAmbientModule(node) && (inAmbientModule || node.flags & NodeFlags.Ambient || isDeclarationFile(file))) { + const moduleName = (node).name; + // Ambient module declarations can be interpreted as augmentations for some existing external modules. + // This will happen in two cases: + // - if current file is external module then module augmentation is a ambient module declaration defined in the top level scope + // - if current file is not external module then module augmentation is an ambient module declaration with non-relative module name + // immediately nested in top level ambient module declaration . + if (isExternalModuleFile || (inAmbientModule && !isExternalModuleNameRelative(moduleName.text))) { + (moduleAugmentations || (moduleAugmentations = [])).push(moduleName); + } + else if (!inAmbientModule) { // An AmbientExternalModuleDeclaration declares an external module. // This type of declaration is permitted only in the global module. // The StringLiteral must specify a top - level external module name. // Relative external module names are not permitted - forEachChild((node).body, node => { - // TypeScript 1.0 spec (April 2014): 12.1.6 - // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules - // only through top - level external module names. Relative external module names are not permitted. - collect(node, /*allowRelativeModuleNames*/ false, collectOnlyRequireCalls); - }); - } - break; - } - } - if (isJavaScriptFile) { - if (isRequireCall(node)) { - (imports || (imports = [])).push((node).arguments[0]); - } - else { - forEachChild(node, node => collect(node, allowRelativeModuleNames, /*collectOnlyRequireCalls*/ true)); - } + // NOTE: body of ambient module is always a module block + for (const statement of ((node).body).statements) { + collectModuleReferences(statement, /*inAmbientModule*/ true); + } + } + } + } + } + + function collectRequireCalls(node: Node): void { + if (isRequireCall(node)) { + (imports || (imports = [])).push((node).arguments[0]); + } + else { + forEachChild(node, collectRequireCalls); } } } @@ -1083,14 +1124,22 @@ namespace ts { function processImportedModules(file: SourceFile, basePath: string) { collectExternalModuleReferences(file); - if (file.imports.length) { + if (file.imports.length || file.moduleAugmentations.length) { file.resolvedModules = {}; - const moduleNames = map(file.imports, name => name.text); + const moduleNames = map(concatenate(file.imports, file.moduleAugmentations), getTextOfLiteral); const resolutions = resolveModuleNamesWorker(moduleNames, getNormalizedAbsolutePath(file.fileName, currentDirectory)); - for (let i = 0; i < file.imports.length; i++) { + for (let i = 0; i < moduleNames.length; i++) { const resolution = resolutions[i]; setResolvedModule(file, moduleNames[i], resolution); - if (resolution && !options.noResolve) { + // add file to program only if: + // - resolution was successfull + // - noResolve is falsy + // - module name come from the list fo imports + const shouldAddFile = resolution && + !options.noResolve && + i < file.imports.length; + + if (shouldAddFile) { const importedFile = findSourceFile(resolution.resolvedFileName, toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, file, skipTrivia(file.text, file.imports[i].pos), file.imports[i].end); if (importedFile && resolution.isExternalLibraryImport) { @@ -1168,7 +1217,7 @@ namespace ts { if (sourceFiles) { const absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var sourceFile of sourceFiles) { + for (const sourceFile of sourceFiles) { if (!isDeclarationFile(sourceFile)) { const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 8161ea998c4..e716da20250 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -29,6 +29,7 @@ namespace ts { scanJsxIdentifier(): SyntaxKind; reScanJsxToken(): SyntaxKind; scanJsxToken(): SyntaxKind; + scanJSDocToken(): SyntaxKind; scan(): SyntaxKind; // Sets the text for the scanner to scan. An optional subrange starting point and length // can be provided to have the scanner only scan a portion of the text. @@ -42,6 +43,10 @@ namespace ts { // is returned from this function. lookAhead(callback: () => T): T; + // Invokes the callback with the scanner set to scan the specified range. When the callback + // returns, the scanner is restored to the state it was in before scanRange was called. + scanRange(start: number, length: number, callback: () => T): T; + // Invokes the provided callback. If the callback returns something falsy, then it restores // the scanner to the state it was in immediately prior to invoking the callback. If the // callback returns something truthy, then the scanner state is not rolled back. The result @@ -94,6 +99,7 @@ namespace ts { "protected": SyntaxKind.ProtectedKeyword, "public": SyntaxKind.PublicKeyword, "require": SyntaxKind.RequireKeyword, + "global": SyntaxKind.GlobalKeyword, "return": SyntaxKind.ReturnKeyword, "set": SyntaxKind.SetKeyword, "static": SyntaxKind.StaticKeyword, @@ -749,6 +755,7 @@ namespace ts { scanJsxIdentifier, reScanJsxToken, scanJsxToken, + scanJSDocToken, scan, setText, setScriptTarget, @@ -757,6 +764,7 @@ namespace ts { setTextPos, tryScan, lookAhead, + scanRange, }; function error(message: DiagnosticMessage, length?: number): void { @@ -1664,6 +1672,60 @@ namespace ts { return token; } + function scanJSDocToken(): SyntaxKind { + if (pos >= end) { + return token = SyntaxKind.EndOfFileToken; + } + + startPos = pos; + + // Eat leading whitespace + let ch = text.charCodeAt(pos); + while (pos < end) { + ch = text.charCodeAt(pos); + if (isWhiteSpace(ch)) { + pos++; + } + else { + break; + } + } + tokenPos = pos; + + switch (ch) { + case CharacterCodes.at: + return pos += 1, token = SyntaxKind.AtToken; + case CharacterCodes.lineFeed: + case CharacterCodes.carriageReturn: + return pos += 1, token = SyntaxKind.NewLineTrivia; + case CharacterCodes.asterisk: + return pos += 1, token = SyntaxKind.AsteriskToken; + case CharacterCodes.openBrace: + return pos += 1, token = SyntaxKind.OpenBraceToken; + case CharacterCodes.closeBrace: + return pos += 1, token = SyntaxKind.CloseBraceToken; + case CharacterCodes.openBracket: + return pos += 1, token = SyntaxKind.OpenBracketToken; + case CharacterCodes.closeBracket: + return pos += 1, token = SyntaxKind.CloseBracketToken; + case CharacterCodes.equals: + return pos += 1, token = SyntaxKind.EqualsToken; + case CharacterCodes.comma: + return pos += 1, token = SyntaxKind.CommaToken; + } + + if (isIdentifierStart(ch, ScriptTarget.Latest)) { + pos++; + while (isIdentifierPart(text.charCodeAt(pos), ScriptTarget.Latest) && pos < end) { + pos++; + } + return token = SyntaxKind.Identifier; + } + else { + return pos += 1, token = SyntaxKind.Unknown; + } + } + function speculationHelper(callback: () => T, isLookahead: boolean): T { const savePos = pos; const saveStartPos = startPos; @@ -1686,6 +1748,33 @@ namespace ts { return result; } + function scanRange(start: number, length: number, callback: () => T): T { + const saveEnd = end; + const savePos = pos; + const saveStartPos = startPos; + const saveTokenPos = tokenPos; + const saveToken = token; + const savePrecedingLineBreak = precedingLineBreak; + const saveTokenValue = tokenValue; + const saveHasExtendedUnicodeEscape = hasExtendedUnicodeEscape; + const saveTokenIsUnterminated = tokenIsUnterminated; + + setText(text, start, length); + const result = callback(); + + end = saveEnd; + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + precedingLineBreak = savePrecedingLineBreak; + tokenValue = saveTokenValue; + hasExtendedUnicodeEscape = saveHasExtendedUnicodeEscape; + tokenIsUnterminated = saveTokenIsUnterminated; + + return result; + } + function lookAhead(callback: () => T): T { return speculationHelper(callback, /*isLookahead*/ true); } diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 50644201544..8abf1432b0c 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -7,7 +7,8 @@ namespace ts { setSourceFile(sourceFile: SourceFile): void; emitPos(pos: number): void; emitStart(range: TextRange): void; - emitEnd(range: TextRange): void; + emitEnd(range: TextRange, stopOverridingSpan?: boolean): void; + changeEmitSourcePos(): void; getText(): string; getSourceMappingURL(): string; initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean): void; @@ -22,8 +23,9 @@ namespace ts { getSourceMapData(): SourceMapData { return undefined; }, setSourceFile(sourceFile: SourceFile): void { }, emitStart(range: TextRange): void { }, - emitEnd(range: TextRange): void { }, + emitEnd(range: TextRange, stopOverridingSpan?: boolean): void { }, emitPos(pos: number): void { }, + changeEmitSourcePos(): void { }, getText(): string { return undefined; }, getSourceMappingURL(): string { return undefined; }, initialize(filePath: string, sourceMapFilePath: string, sourceFiles: SourceFile[], isBundledEmit: boolean): void { }, @@ -38,6 +40,8 @@ namespace ts { const compilerOptions = host.getCompilerOptions(); let currentSourceFile: SourceFile; let sourceMapDir: string; // The directory in which sourcemap will be + let stopOverridingSpan = false; + let modifyLastSourcePos = false; // Current source map file and its index in the sources list let sourceMapSourceIndex: number; @@ -56,6 +60,7 @@ namespace ts { emitPos, emitStart, emitEnd, + changeEmitSourcePos, getText, getSourceMappingURL, initialize, @@ -142,6 +147,45 @@ namespace ts { sourceMapData = undefined; } + function updateLastEncodedAndRecordedSpans() { + if (modifyLastSourcePos) { + // Reset the source pos + modifyLastSourcePos = false; + + // Change Last recorded Map with last encoded emit line and character + lastRecordedSourceMapSpan.emittedLine = lastEncodedSourceMapSpan.emittedLine; + lastRecordedSourceMapSpan.emittedColumn = lastEncodedSourceMapSpan.emittedColumn; + + // Pop sourceMapDecodedMappings to remove last entry + sourceMapData.sourceMapDecodedMappings.pop(); + + // Change the last encoded source map + lastEncodedSourceMapSpan = sourceMapData.sourceMapDecodedMappings.length ? + sourceMapData.sourceMapDecodedMappings[sourceMapData.sourceMapDecodedMappings.length - 1] : + undefined; + + // TODO: Update lastEncodedNameIndex + // Since we dont support this any more, lets not worry about it right now. + // When we start supporting nameIndex, we will get back to this + + // Change the encoded source map + const sourceMapMappings = sourceMapData.sourceMapMappings; + let lenthToSet = sourceMapMappings.length - 1; + for (; lenthToSet >= 0; lenthToSet--) { + const currentChar = sourceMapMappings.charAt(lenthToSet); + if (currentChar === ",") { + // Separator for the entry found + break; + } + if (currentChar === ";" && lenthToSet !== 0 && sourceMapMappings.charAt(lenthToSet - 1) !== ";") { + // Last line separator found + break; + } + } + sourceMapData.sourceMapMappings = sourceMapMappings.substr(0, Math.max(0, lenthToSet)); + } + } + // Encoding for sourcemap span function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { @@ -178,6 +222,7 @@ namespace ts { // 5. Relative namePosition 0 based if (lastRecordedSourceMapSpan.nameIndex >= 0) { + Debug.assert(false, "We do not support name index right now, Make sure to update updateLastEncodedAndRecordedSpans when we start using this"); sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; } @@ -219,22 +264,36 @@ namespace ts { sourceColumn: sourceLinePos.character, sourceIndex: sourceMapSourceIndex }; + + stopOverridingSpan = false; } - else { + else if (!stopOverridingSpan) { // Take the new pos instead since there is no change in emittedLine and column since last location lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } + + updateLastEncodedAndRecordedSpans(); + } + + function getStartPos(range: TextRange) { + const rangeHasDecorators = !!(range as Node).decorators; + return range.pos !== -1 ? skipTrivia(currentSourceFile.text, rangeHasDecorators ? (range as Node).decorators.end : range.pos) : -1; } function emitStart(range: TextRange) { - const rangeHasDecorators = !!(range as Node).decorators; - emitPos(range.pos !== -1 ? skipTrivia(currentSourceFile.text, rangeHasDecorators ? (range as Node).decorators.end : range.pos) : -1); + emitPos(getStartPos(range)); } - function emitEnd(range: TextRange) { + function emitEnd(range: TextRange, stopOverridingEnd?: boolean) { emitPos(range.end); + stopOverridingSpan = stopOverridingEnd; + } + + function changeEmitSourcePos() { + Debug.assert(!modifyLastSourcePos); + modifyLastSourcePos = true; } function setSourceFile(sourceFile: SourceFile) { diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index c99c28bc0dd..bf25d39aa43 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1,6 +1,9 @@ /// namespace ts { + export type FileWatcherCallback = (path: string, removed?: boolean) => void; + export type DirectoryWatcherCallback = (path: string) => void; + export interface System { args: string[]; newLine: string; @@ -8,8 +11,8 @@ namespace ts { write(s: string): void; readFile(path: string, encoding?: string): string; writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; - watchFile?(path: string, callback: (path: string, removed?: boolean) => void): FileWatcher; - watchDirectory?(path: string, callback: (path: string) => void, recursive?: boolean): FileWatcher; + watchFile?(path: Path, callback: FileWatcherCallback): FileWatcher; + watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; resolvePath(path: string): string; fileExists(path: string): boolean; directoryExists(path: string): boolean; @@ -22,15 +25,20 @@ namespace ts { } interface WatchedFile { - fileName: string; - callback: (fileName: string, removed?: boolean) => void; - mtime: Date; + filePath: Path; + callback: FileWatcherCallback; + mtime?: Date; } export interface FileWatcher { close(): void; } + export interface DirectoryWatcher extends FileWatcher { + directoryPath: Path; + referenceCount: number; + } + declare var require: any; declare var module: any; declare var process: any; @@ -62,8 +70,8 @@ namespace ts { readFile(path: string): string; writeFile(path: string, contents: string): void; readDirectory(path: string, extension?: string, exclude?: string[]): string[]; - watchFile?(path: string, callback: (path: string, removed?: boolean) => void): FileWatcher; - watchDirectory?(path: string, callback: (path: string) => void, recursive?: boolean): FileWatcher; + watchFile?(path: string, callback: FileWatcherCallback): FileWatcher; + watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; }; export var sys: System = (function () { @@ -221,7 +229,7 @@ namespace ts { // average async stat takes about 30 microseconds // set chunk size to do 30 files in < 1 millisecond - function createWatchedFileSet(interval = 2500, chunkSize = 30) { + function createPollingWatchedFileSet(interval = 2500, chunkSize = 30) { let watchedFiles: WatchedFile[] = []; let nextFileToCheck = 0; let watchTimer: any; @@ -236,13 +244,13 @@ namespace ts { return; } - _fs.stat(watchedFile.fileName, (err: any, stats: any) => { + _fs.stat(watchedFile.filePath, (err: any, stats: any) => { if (err) { - watchedFile.callback(watchedFile.fileName); + watchedFile.callback(watchedFile.filePath); } else if (watchedFile.mtime.getTime() !== stats.mtime.getTime()) { - watchedFile.mtime = getModifiedTime(watchedFile.fileName); - watchedFile.callback(watchedFile.fileName, watchedFile.mtime.getTime() === 0); + watchedFile.mtime = getModifiedTime(watchedFile.filePath); + watchedFile.callback(watchedFile.filePath, watchedFile.mtime.getTime() === 0); } }); } @@ -270,11 +278,11 @@ namespace ts { }, interval); } - function addFile(fileName: string, callback: (fileName: string, removed?: boolean) => void): WatchedFile { + function addFile(filePath: Path, callback: FileWatcherCallback): WatchedFile { const file: WatchedFile = { - fileName, + filePath, callback, - mtime: getModifiedTime(fileName) + mtime: getModifiedTime(filePath) }; watchedFiles.push(file); @@ -297,6 +305,90 @@ namespace ts { }; } + function createWatchedFileSet() { + const dirWatchers = createFileMap(); + // One file can have multiple watchers + const fileWatcherCallbacks = createFileMap(); + return { addFile, removeFile }; + + function reduceDirWatcherRefCountForFile(filePath: Path) { + const dirPath = getDirectoryPath(filePath); + if (dirWatchers.contains(dirPath)) { + const watcher = dirWatchers.get(dirPath); + watcher.referenceCount -= 1; + if (watcher.referenceCount <= 0) { + watcher.close(); + dirWatchers.remove(dirPath); + } + } + } + + function addDirWatcher(dirPath: Path): void { + if (dirWatchers.contains(dirPath)) { + const watcher = dirWatchers.get(dirPath); + watcher.referenceCount += 1; + return; + } + + const watcher: DirectoryWatcher = _fs.watch( + dirPath, + { persistent: true }, + (eventName: string, relativeFileName: string) => fileEventHandler(eventName, relativeFileName, dirPath) + ); + watcher.referenceCount = 1; + dirWatchers.set(dirPath, watcher); + return; + } + + function addFileWatcherCallback(filePath: Path, callback: FileWatcherCallback): void { + if (fileWatcherCallbacks.contains(filePath)) { + fileWatcherCallbacks.get(filePath).push(callback); + } + else { + fileWatcherCallbacks.set(filePath, [callback]); + } + } + + function addFile(filePath: Path, callback: FileWatcherCallback): WatchedFile { + addFileWatcherCallback(filePath, callback); + addDirWatcher(getDirectoryPath(filePath)); + + return { filePath, callback }; + } + + function removeFile(watchedFile: WatchedFile) { + removeFileWatcherCallback(watchedFile.filePath, watchedFile.callback); + reduceDirWatcherRefCountForFile(watchedFile.filePath); + } + + function removeFileWatcherCallback(filePath: Path, callback: FileWatcherCallback) { + if (fileWatcherCallbacks.contains(filePath)) { + const newCallbacks = copyListRemovingItem(callback, fileWatcherCallbacks.get(filePath)); + if (newCallbacks.length === 0) { + fileWatcherCallbacks.remove(filePath); + } + else { + fileWatcherCallbacks.set(filePath, newCallbacks); + } + } + } + + /** + * @param watcherPath is the path from which the watcher is triggered. + */ + function fileEventHandler(eventName: string, relativeFileName: string, baseDirPath: Path) { + // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" + const filePath = typeof relativeFileName !== "string" + ? undefined + : toPath(relativeFileName, baseDirPath, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)); + if (eventName === "change" && fileWatcherCallbacks.contains(filePath)) { + for (const fileCallback of fileWatcherCallbacks.get(filePath)) { + fileCallback(filePath); + } + } + } + } + // REVIEW: for now this implementation uses polling. // The advantage of polling is that it works reliably // on all os and with network mounted files. @@ -310,8 +402,13 @@ namespace ts { // changes for large reference sets? If so, do we want // to increase the chunk size or decrease the interval // time dynamically to match the large reference set? + const pollingWatchedFileSet = createPollingWatchedFileSet(); const watchedFileSet = createWatchedFileSet(); + function isNode4OrLater(): boolean { + return parseInt(process.version.charAt(1)) >= 4; + } + const platform: string = _os.platform(); // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive const useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; @@ -365,7 +462,7 @@ namespace ts { } function getCanonicalPath(path: string): string { - return useCaseSensitiveFileNames ? path.toLowerCase() : path; + return useCaseSensitiveFileNames ? path : path.toLowerCase(); } function readDirectory(path: string, extension?: string, exclude?: string[]): string[] { @@ -405,29 +502,38 @@ namespace ts { }, readFile, writeFile, - watchFile: (fileName, callback) => { + watchFile: (filePath, callback) => { // Node 4.0 stablized the `fs.watch` function on Windows which avoids polling // and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649 // and https://github.com/Microsoft/TypeScript/issues/4643), therefore // if the current node.js version is newer than 4, use `fs.watch` instead. - const watchedFile = watchedFileSet.addFile(fileName, callback); + const watchSet = isNode4OrLater() ? watchedFileSet : pollingWatchedFileSet; + const watchedFile = watchSet.addFile(filePath, callback); return { - close: () => watchedFileSet.removeFile(watchedFile) + close: () => watchSet.removeFile(watchedFile) }; }, watchDirectory: (path, callback, recursive) => { // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) + let options: any; + if (isNode4OrLater() && (process.platform === "win32" || process.platform === "darwin")) { + options = { persistent: true, recursive: !!recursive }; + } + else { + options = { persistent: true }; + } + return _fs.watch( path, - { persistent: true, recursive: !!recursive }, + options, (eventName: string, relativeFileName: string) => { // In watchDirectory we only care about adding and removing files (when event name is // "rename"); changes made within files are handled by corresponding fileWatchers (when // event name is "change") if (eventName === "rename") { // When deleting a file, the passed baseFileName is null - callback(!relativeFileName ? relativeFileName : normalizePath(ts.combinePaths(path, relativeFileName))); + callback(!relativeFileName ? relativeFileName : normalizePath(combinePaths(path, relativeFileName))); }; } ); @@ -511,5 +617,3 @@ namespace ts { } })(); } - - diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index d064ec54c9c..9b2457d0916 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -334,12 +334,13 @@ namespace ts { return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } if (configFileName) { - configFileWatcher = sys.watchFile(configFileName, configFileChanged); + const configFilePath = toPath(configFileName, sys.getCurrentDirectory(), createGetCanonicalFileName(sys.useCaseSensitiveFileNames)); + configFileWatcher = sys.watchFile(configFilePath, configFileChanged); } if (sys.watchDirectory && configFileName) { const directory = ts.getDirectoryPath(configFileName); directoryWatcher = sys.watchDirectory( - // When the configFileName is just "tsconfig.json", the watched directory should be + // When the configFileName is just "tsconfig.json", the watched directory should be // the current direcotry; if there is a given "project" parameter, then the configFileName // is an absolute file name. directory == "" ? "." : directory, @@ -442,7 +443,8 @@ namespace ts { const sourceFile = hostGetSourceFile(fileName, languageVersion, onError); if (sourceFile && compilerOptions.watch) { // Attach a file watcher - sourceFile.fileWatcher = sys.watchFile(sourceFile.fileName, (fileName: string, removed?: boolean) => sourceFileChanged(sourceFile, removed)); + const filePath = toPath(sourceFile.fileName, sys.getCurrentDirectory(), createGetCanonicalFileName(sys.useCaseSensitiveFileNames)); + sourceFile.fileWatcher = sys.watchFile(filePath, (fileName: string, removed?: boolean) => sourceFileChanged(sourceFile, removed)); } return sourceFile; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 63ccaf4137e..b15783a52a8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -170,6 +170,7 @@ namespace ts { SymbolKeyword, TypeKeyword, FromKeyword, + GlobalKeyword, OfKeyword, // LastKeyword and LastToken // Parse tree nodes @@ -311,11 +312,11 @@ namespace ts { // Top-level nodes SourceFile, - // JSDoc nodes. + // JSDoc nodes JSDocTypeExpression, - // The * type. + // The * type JSDocAllType, - // The ? type. + // The ? type JSDocUnknownType, JSDocArrayType, JSDocUnionType, @@ -389,11 +390,18 @@ namespace ts { ContainsThis = 1 << 18, // Interface contains references to "this" HasImplicitReturn = 1 << 19, // If function implicitly returns on one of codepaths (initialized by binding) HasExplicitReturn = 1 << 20, // If function has explicit reachable return on one of codepaths (initialized by binding) + GlobalAugmentation = 1 << 21, // Set if module declaration is an augmentation for the global scope + HasClassExtends = 1 << 22, // If the file has a non-ambient class with an extends clause in ES5 or lower (initialized by binding) + HasDecorators = 1 << 23, // If the file has decorators (initialized by binding) + HasParamDecorators = 1 << 24, // If the file has parameter decorators (initialized by binding) + HasAsyncFunctions = 1 << 25, // If the file has async functions (initialized by binding) + Modifier = Export | Ambient | Public | Private | Protected | Static | Abstract | Default | Async, AccessibilityModifier = Public | Private | Protected, BlockScoped = Let | Const, - ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn + ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn, + EmitHelperFlags = HasClassExtends | HasDecorators | HasParamDecorators | HasAsyncFunctions, } /* @internal */ @@ -996,7 +1004,7 @@ namespace ts { } // @kind(SyntaxKind.CallExpression) - export interface CallExpression extends LeftHandSideExpression { + export interface CallExpression extends LeftHandSideExpression, Declaration { expression: LeftHandSideExpression; typeArguments?: NodeArray; arguments: NodeArray; @@ -1475,6 +1483,8 @@ namespace ts { type: JSDocType; } + export type JSDocTypeReferencingNode = JSDocThisType | JSDocConstructorType | JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType; + // @kind(SyntaxKind.JSDocRecordMember) export interface JSDocRecordMember extends PropertySignature { name: Identifier | LiteralExpression; @@ -1577,6 +1587,7 @@ namespace ts { // Content of this fiels should never be used directly - use getResolvedModuleFileName/setResolvedModuleFileName functions instead /* @internal */ resolvedModules: Map; /* @internal */ imports: LiteralExpression[]; + /* @internal */ moduleAugmentations: LiteralExpression[]; } export interface ScriptReferenceHost { @@ -1725,6 +1736,7 @@ namespace ts { getSymbolAtLocation(node: Node): Symbol; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; getShorthandAssignmentValueSymbol(location: Node): Symbol; + getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol; getTypeAtLocation(node: Node): Type; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; @@ -1738,6 +1750,7 @@ namespace ts { isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; + isUnknownSymbol(symbol: Symbol): boolean; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; @@ -1909,7 +1922,7 @@ namespace ts { isOptionalParameter(node: ParameterDeclaration): boolean; moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean; isArgumentsLocalBinding(node: Identifier): boolean; - getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration): SourceFile; + getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration): SourceFile; } export const enum SymbolFlags { @@ -2042,23 +2055,19 @@ namespace ts { TypeChecked = 0x00000001, // Node has been type checked LexicalThis = 0x00000002, // Lexical 'this' reference CaptureThis = 0x00000004, // Lexical 'this' used in body - EmitExtends = 0x00000008, // Emit __extends - EmitDecorate = 0x00000010, // Emit __decorate - EmitParam = 0x00000020, // Emit __param helper for decorators - EmitAwaiter = 0x00000040, // Emit __awaiter - EmitGenerator = 0x00000080, // Emit __generator SuperInstance = 0x00000100, // Instance 'super' reference SuperStatic = 0x00000200, // Static 'super' reference ContextChecked = 0x00000400, // Contextual types have been assigned - LexicalArguments = 0x00000800, - CaptureArguments = 0x00001000, // Lexical 'arguments' used in body (for async functions) + AsyncMethodWithSuper = 0x00000800, // An async method that reads a value from a member of 'super'. + AsyncMethodWithSuperBinding = 0x00001000, // An async method that assigns a value to a member of 'super'. + CaptureArguments = 0x00002000, // Lexical 'arguments' used in body (for async functions) // Values for enum members have been computed, and any errors have been reported for them. - EnumValuesComputed = 0x00002000, - BlockScopedBindingInLoop = 0x00004000, - LexicalModuleMergesWithClass = 0x00008000, // Instantiated lexical module declaration is merged with a previous class declaration. - LoopWithBlockScopedBindingCapturedInFunction = 0x00010000, // Loop that contains block scoped variable captured in closure - HasSeenSuperCall = 0x00040000, // Set during the binding when encounter 'super' + EnumValuesComputed = 0x00004000, + BlockScopedBindingInLoop = 0x00008000, + LexicalModuleMergesWithClass = 0x00010000, // Instantiated lexical module declaration is merged with a previous class declaration. + LoopWithBlockScopedBindingCapturedInFunction = 0x00020000, // Loop that contains block scoped variable captured in closure + HasSeenSuperCall = 0x00040000, // Set during the binding when encounter 'super' } /* @internal */ diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 7bc708c7178..4bf1422e888 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -251,6 +251,31 @@ namespace ts { isCatchClauseVariableDeclaration(declaration); } + export function isAmbientModule(node: Node): boolean { + return node && node.kind === SyntaxKind.ModuleDeclaration && + ((node).name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(node)); + } + + export function isGlobalScopeAugmentation(module: ModuleDeclaration): boolean { + return !!(module.flags & NodeFlags.GlobalAugmentation); + } + + export function isExternalModuleAugmentation(node: Node): boolean { + // external module augmentation is a ambient module declaration that is either: + // - defined in the top level scope and source file is an external module + // - defined inside ambient module declaration located in the top level scope and source file not an external module + if (!node || !isAmbientModule(node)) { + return false; + } + switch (node.parent.kind) { + case SyntaxKind.SourceFile: + return isExternalModule(node.parent); + case SyntaxKind.ModuleBlock: + return isAmbientModule(node.parent.parent) && !isExternalModule(node.parent.parent.parent); + } + return false; + } + // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. export function getEnclosingBlockScopeContainer(node: Node): Node { @@ -343,6 +368,7 @@ namespace ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.MethodDeclaration: + case SyntaxKind.TypeAliasDeclaration: errorNode = (node).name; break; } @@ -776,10 +802,10 @@ namespace ts { } /** - * Given an super call\property node returns a closest node where either - * - super call\property is legal in the node and not legal in the parent node the node. + * Given an super call\property node returns a closest node where either + * - super call\property is legal in the node and not legal in the parent node the node. * i.e. super call is legal in constructor but not legal in the class body. - * - node is arrow function (so caller might need to call getSuperContainer in case if he needs to climb higher) + * - node is arrow function (so caller might need to call getSuperContainer in case it needs to climb higher) * - super call\property is definitely illegal in the node (but might be legal in some subnode) * i.e. super property access is illegal in function declaration but can be legal in the statement list */ @@ -824,6 +850,16 @@ namespace ts { } } + /** + * Determines whether a node is a property or element access expression for super. + */ + export function isSuperPropertyOrElementAccess(node: Node) { + return (node.kind === SyntaxKind.PropertyAccessExpression + || node.kind === SyntaxKind.ElementAccessExpression) + && (node).expression.kind === SyntaxKind.SuperKeyword; + } + + export function getEntityNameFromTypeNode(node: TypeNode): EntityName | Expression { if (node) { switch (node.kind) { @@ -859,54 +895,28 @@ namespace ts { // property declarations are valid if their parent is a class declaration. return node.parent.kind === SyntaxKind.ClassDeclaration; - case SyntaxKind.Parameter: - // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; - return (node.parent).body && node.parent.parent.kind === SyntaxKind.ClassDeclaration; - case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.MethodDeclaration: // if this method has a body and its parent is a class declaration, this is a valid target. - return (node).body && node.parent.kind === SyntaxKind.ClassDeclaration; + return (node).body !== undefined + && node.parent.kind === SyntaxKind.ClassDeclaration; + + case SyntaxKind.Parameter: + // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; + return (node.parent).body !== undefined + && (node.parent.kind === SyntaxKind.Constructor + || node.parent.kind === SyntaxKind.MethodDeclaration + || node.parent.kind === SyntaxKind.SetAccessor) + && node.parent.parent.kind === SyntaxKind.ClassDeclaration; } return false; } export function nodeIsDecorated(node: Node): boolean { - switch (node.kind) { - case SyntaxKind.ClassDeclaration: - if (node.decorators) { - return true; - } - - return false; - - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.Parameter: - if (node.decorators) { - return true; - } - - return false; - - case SyntaxKind.GetAccessor: - if ((node).body && node.decorators) { - return true; - } - - return false; - - case SyntaxKind.MethodDeclaration: - case SyntaxKind.SetAccessor: - if ((node).body && node.decorators) { - return true; - } - - return false; - } - - return false; + return node.decorators !== undefined + && nodeCanBeDecorated(node); } export function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression { @@ -1054,7 +1064,7 @@ namespace ts { /** * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one string literal argument. + * exactly one argument. * This function does not test if the node is in a JavaScript file or not. */ export function isRequireCall(expression: Node): expression is CallExpression { @@ -1062,8 +1072,7 @@ namespace ts { return expression.kind === SyntaxKind.CallExpression && (expression).expression.kind === SyntaxKind.Identifier && ((expression).expression).text === "require" && - (expression).arguments.length === 1 && - (expression).arguments[0].kind === SyntaxKind.StringLiteral; + (expression).arguments.length === 1; } /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property @@ -1115,6 +1124,9 @@ namespace ts { if (node.kind === SyntaxKind.ExportDeclaration) { return (node).moduleSpecifier; } + if (node.kind === SyntaxKind.ModuleDeclaration && (node).name.kind === SyntaxKind.StringLiteral) { + return (node).name; + } } export function hasQuestionToken(node: Node) { @@ -1140,26 +1152,56 @@ namespace ts { (node).parameters[0].type.kind === SyntaxKind.JSDocConstructorType; } - function getJSDocTag(node: Node, kind: SyntaxKind): JSDocTag { - if (node && node.jsDocComment) { - for (const tag of node.jsDocComment.tags) { - if (tag.kind === kind) { - return tag; - } + function getJSDocTag(node: Node, kind: SyntaxKind, checkParentVariableStatement: boolean): JSDocTag { + if (!node) { + return undefined; + } + + const jsDocComment = getJSDocComment(node, checkParentVariableStatement); + if (!jsDocComment) { + return undefined; + } + + for (const tag of jsDocComment.tags) { + if (tag.kind === kind) { + return tag; } } } + function getJSDocComment(node: Node, checkParentVariableStatement: boolean): JSDocComment { + if (node.jsDocComment) { + return node.jsDocComment; + } + // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. + // /** + // * @param {number} name + // * @returns {number} + // */ + // var x = function(name) { return name.length; } + if (checkParentVariableStatement) { + const isInitializerOfVariableDeclarationInStatement = + node.parent.kind === SyntaxKind.VariableDeclaration && + (node.parent).initializer === node && + node.parent.parent.parent.kind === SyntaxKind.VariableStatement; + + const variableStatementNode = isInitializerOfVariableDeclarationInStatement ? node.parent.parent.parent : undefined; + return variableStatementNode && variableStatementNode.jsDocComment; + } + + return undefined; + } + export function getJSDocTypeTag(node: Node): JSDocTypeTag { - return getJSDocTag(node, SyntaxKind.JSDocTypeTag); + return getJSDocTag(node, SyntaxKind.JSDocTypeTag, /*checkParentVariableStatement*/ false); } export function getJSDocReturnTag(node: Node): JSDocReturnTag { - return getJSDocTag(node, SyntaxKind.JSDocReturnTag); + return getJSDocTag(node, SyntaxKind.JSDocReturnTag, /*checkParentVariableStatement*/ true); } export function getJSDocTemplateTag(node: Node): JSDocTemplateTag { - return getJSDocTag(node, SyntaxKind.JSDocTemplateTag); + return getJSDocTag(node, SyntaxKind.JSDocTemplateTag, /*checkParentVariableStatement*/ false); } export function getCorrespondingJSDocParameterTag(parameter: ParameterDeclaration): JSDocParameterTag { @@ -1168,19 +1210,21 @@ namespace ts { // annotation. const parameterName = (parameter.name).text; - const docComment = parameter.parent.jsDocComment; - if (docComment) { - return forEach(docComment.tags, t => { - if (t.kind === SyntaxKind.JSDocParameterTag) { - const parameterTag = t; + const jsDocComment = getJSDocComment(parameter.parent, /*checkParentVariableStatement*/ true); + if (jsDocComment) { + for (const tag of jsDocComment.tags) { + if (tag.kind === SyntaxKind.JSDocParameterTag) { + const parameterTag = tag; const name = parameterTag.preParameterName || parameterTag.postParameterName; if (name.text === parameterName) { - return t; + return parameterTag; } } - }); + } } } + + return undefined; } export function hasRestParameter(s: SignatureDeclaration): boolean { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 30626a83d62..ee1bf4846df 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -572,6 +572,31 @@ namespace FourSlash { } } + public verifyCompletionListStartsWithItemsInOrder(items: string[]): void { + if (items.length === 0) { + return; + } + + const entries = this.getCompletionListAtCaret().entries; + assert.isTrue(items.length <= entries.length, `Amount of expected items in completion list [ ${items.length} ] is greater than actual number of items in list [ ${entries.length} ]`); + for (let i = 0; i < items.length; i++) { + assert.equal(entries[i].name, items[i], `Unexpected item in completion list`); + } + } + + public noItemsWithSameNameButDifferentKind(): void { + const completions = this.getCompletionListAtCaret(); + const uniqueItems: ts.Map = {}; + for (const item of completions.entries) { + if (!ts.hasProperty(uniqueItems, item.name)) { + uniqueItems[item.name] = item.kind; + } + else { + assert.equal(item.kind, uniqueItems[item.name], `Items should have the same kind, got ${item.kind} and ${uniqueItems[item.name]}`); + } + } + } + public verifyMemberListIsEmpty(negative: boolean) { const members = this.getMemberListAtCaret(); if ((!members || members.entries.length === 0) && negative) { @@ -1080,9 +1105,15 @@ namespace FourSlash { } public baselineCurrentFileBreakpointLocations() { + let baselineFile = this.testData.globalOptions[metadataOptionNames.baselineFile]; + if (!baselineFile) { + baselineFile = this.activeFile.fileName.replace(this.basePath + "/breakpointValidation", "bpSpan"); + baselineFile = baselineFile.replace(".ts", ".baseline"); + + } Harness.Baseline.runBaseline( "Breakpoint Locations for " + this.activeFile.fileName, - this.testData.globalOptions[metadataOptionNames.baselineFile], + baselineFile, () => { return this.baselineCurrentFileLocations(pos => this.getBreakpointStatementLocation(pos)); }, @@ -3285,6 +3316,30 @@ namespace FourSlashInterface { return getClassification("typeAliasName", text, position); } + export function jsxOpenTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxOpenTagName", text, position); + } + + export function jsxCloseTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxCloseTagName", text, position); + } + + export function jsxSelfClosingTagName(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxSelfClosingTagName", text, position); + } + + export function jsxAttribute(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxAttribute", text, position); + } + + export function jsxText(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxText", text, position); + } + + export function jsxAttributeStringLiteralValue(text: string, position?: number): { classificationType: string; text: string; textSpan?: FourSlash.TextSpan } { + return getClassification("jsxAttributeStringLiteralValue", text, position); + } + function getClassification(type: string, text: string, position?: number) { return { classificationType: type, diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 12df449931e..dbd4d37ef96 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -1,5 +1,3 @@ -/// - ///////////////////////////// /// ECMAScript APIs ///////////////////////////// diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 0144d752b99..9970749e5a8 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -1255,7 +1255,7 @@ interface Console { select(element: Element): void; time(timerName?: string): void; timeEnd(timerName?: string): void; - trace(): void; + trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; } @@ -1514,9 +1514,9 @@ interface DataTransferItemList { length: number; add(data: File): DataTransferItem; clear(): void; - item(index: number): File; + item(index: number): DataTransferItem; remove(index: number): void; - [index: number]: File; + [index: number]: DataTransferItem; } declare var DataTransferItemList: { @@ -2569,6 +2569,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * @param content The text and HTML tags to write. */ writeln(...content: string[]): void; + createElement(tagName: "picture"): HTMLPictureElement; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -2981,6 +2983,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec webkitRequestFullscreen(): void; getElementsByClassName(classNames: string): NodeListOf; matches(selector: string): boolean; + getElementsByTagName(tagname: "picture"): NodeListOf; addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; @@ -3770,6 +3773,7 @@ interface HTMLCanvasElement extends HTMLElement { * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; + toBlob(): Blob; } declare var HTMLCanvasElement: { @@ -6924,7 +6928,7 @@ interface IDBDatabase extends EventTarget { objectStoreNames: DOMStringList; onabort: (ev: Event) => any; onerror: (ev: Event) => any; - version: string; + version: number; close(): void; createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; @@ -7640,7 +7644,7 @@ declare var MediaQueryList: { interface MediaSource extends EventTarget { activeSourceBuffers: SourceBufferList; duration: number; - readyState: number; + readyState: string; sourceBuffers: SourceBufferList; addSourceBuffer(type: string): SourceBuffer; endOfStream(error?: number): void; @@ -10369,17 +10373,16 @@ declare var Storage: { } interface StorageEvent extends Event { - key: string; - newValue: any; - oldValue: any; - storageArea: Storage; url: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; + key?: string; + oldValue?: string; + newValue?: string; + storageArea?: Storage; } declare var StorageEvent: { prototype: StorageEvent; - new(): StorageEvent; + new (type: string, eventInitDict?: StorageEventInit): StorageEvent; } interface StyleMedia { @@ -11977,7 +11980,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window msMatchMedia(mediaQuery: string): MediaQueryList; msRequestAnimationFrame(callback: FrameRequestCallback): number; msWriteProfilerMark(profilerMarkName: string): void; - open(url?: string, target?: string, features?: string, replace?: boolean): any; + open(url?: string, target?: string, features?: string, replace?: boolean): Window; postMessage(message: any, targetOrigin: string, ports?: any): void; print(): void; prompt(message?: string, _default?: string): string; @@ -12579,6 +12582,14 @@ interface XMLHttpRequestEventTarget { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } +interface StorageEventInit extends EventInit { + key?: string; + oldValue?: string; + newValue?: string; + url: string; + storageArea?: Storage; +} + interface IDBObjectStoreParameters { keyPath?: string | string[]; autoIncrement?: boolean; @@ -12633,6 +12644,14 @@ declare var HTMLTemplateElement: { new(): HTMLTemplateElement; } +interface HTMLPictureElement extends HTMLElement { +} + +declare var HTMLPictureElement: { + prototype: HTMLPictureElement; + new(): HTMLPictureElement; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface ErrorEventHandler { @@ -12829,7 +12848,7 @@ declare function msCancelRequestAnimationFrame(handle: number): void; declare function msMatchMedia(mediaQuery: string): MediaQueryList; declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; declare function postMessage(message: any, targetOrigin: string, ports?: any): void; declare function print(): void; declare function prompt(message?: string, _default?: string): string; diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 84128a01cf2..f5d6b06bc47 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -819,7 +819,6 @@ interface MapConstructor { declare var Map: MapConstructor; interface WeakMap { - clear(): void; delete(key: K): boolean; get(key: K): V; has(key: K): boolean; @@ -859,7 +858,6 @@ declare var Set: SetConstructor; interface WeakSet { add(value: T): WeakSet; - clear(): void; delete(value: T): boolean; has(value: T): boolean; [Symbol.toStringTag]: "WeakSet"; @@ -1281,15 +1279,15 @@ interface PromiseConstructor { * @param values An array of Promises. * @returns A new Promise. */ - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; all(values: Iterable>): Promise; /** diff --git a/src/lib/es7.d.ts b/src/lib/es7.d.ts new file mode 100644 index 00000000000..17b3eaac1d3 --- /dev/null +++ b/src/lib/es7.d.ts @@ -0,0 +1,89 @@ +interface Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: T, fromIndex?: number): boolean; +} + +interface Int8Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint8Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint8ClampedArray { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Int16Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint16Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Int32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Uint32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Float32Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} + +interface Float64Array { + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + * @param fromIndex The position in this array at which to begin searching for searchElement. + */ + includes(searchElement: number, fromIndex?: number): boolean; +} \ No newline at end of file diff --git a/src/lib/header.d.ts b/src/lib/header.d.ts new file mode 100644 index 00000000000..129e4739a83 --- /dev/null +++ b/src/lib/header.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index a1d87f79787..d2008542cc6 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -69,7 +69,7 @@ interface Console { select(element: any): void; time(timerName?: string): void; timeEnd(timerName?: string): void; - trace(): void; + trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; } @@ -309,7 +309,7 @@ interface IDBDatabase extends EventTarget { objectStoreNames: DOMStringList; onabort: (ev: Event) => any; onerror: (ev: Event) => any; - version: string; + version: number; close(): void; createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 76720ba2850..e2ec5cc159f 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -120,7 +120,7 @@ namespace ts.server { if (!resolution) { const existingResolution = currentResolutionsInFile && ts.lookUp(currentResolutionsInFile, moduleName); if (moduleResolutionIsValid(existingResolution)) { - // ok, it is safe to use existing module resolution results + // ok, it is safe to use existing module resolution results resolution = existingResolution; } else { @@ -145,8 +145,8 @@ namespace ts.server { } if (resolution.resolvedModule) { - // TODO: consider checking failedLookupLocations - // TODO: use lastCheckTime to track expiration for module name resolution + // TODO: consider checking failedLookupLocations + // TODO: use lastCheckTime to track expiration for module name resolution return true; } @@ -483,7 +483,7 @@ namespace ts.server { openFileRootsConfigured: ScriptInfo[] = []; // a path to directory watcher map that detects added tsconfig files directoryWatchersForTsconfig: ts.Map = {}; - // count of how many projects are using the directory watcher. If the + // count of how many projects are using the directory watcher. If the // number becomes 0 for a watcher, then we should close it. directoryWatchersRefCount: ts.Map = {}; hostConfiguration: HostConfiguration; @@ -564,11 +564,11 @@ namespace ts.server { // We check if the project file list has changed. If so, we update the project. if (!arrayIsEqualTo(currentRootFiles && currentRootFiles.sort(), newRootFiles && newRootFiles.sort())) { // For configured projects, the change is made outside the tsconfig file, and - // it is not likely to affect the project for other files opened by the client. We can + // it is not likely to affect the project for other files opened by the client. We can // just update the current project. this.updateConfiguredProject(project); - // Call updateProjectStructure to clean up inferred projects we may have + // Call updateProjectStructure to clean up inferred projects we may have // created for the new files this.updateProjectStructure(); } @@ -792,8 +792,8 @@ namespace ts.server { * @param info The file that has been closed or newly configured */ closeOpenFile(info: ScriptInfo) { - // Closing file should trigger re-reading the file content from disk. This is - // because the user may chose to discard the buffer content before saving + // Closing file should trigger re-reading the file content from disk. This is + // because the user may chose to discard the buffer content before saving // to the disk, and the server's version of the file can be out of sync. info.svc.reloadFromFile(info.fileName); @@ -891,8 +891,8 @@ namespace ts.server { } /** - * This function is to update the project structure for every projects. - * It is called on the premise that all the configured projects are + * This function is to update the project structure for every projects. + * It is called on the premise that all the configured projects are * up to date. */ updateProjectStructure() { @@ -946,7 +946,7 @@ namespace ts.server { if (rootFile.defaultProject && rootFile.defaultProject.isConfiguredProject()) { // If the root file has already been added into a configured project, - // meaning the original inferred project is gone already. + // meaning the original inferred project is gone already. if (!rootedProject.isConfiguredProject()) { this.removeProject(rootedProject); } @@ -1002,7 +1002,9 @@ namespace ts.server { info.setFormatOptions(this.getFormatCodeOptions()); this.filenameToScriptInfo[fileName] = info; if (!info.isOpen) { - info.fileWatcher = this.host.watchFile(fileName, _ => { this.watchedFileChanged(fileName); }); + info.fileWatcher = this.host.watchFile( + toPath(fileName, fileName, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)), + _ => { this.watchedFileChanged(fileName); }); } } } @@ -1024,10 +1026,16 @@ namespace ts.server { // the newly opened file. findConfigFile(searchPath: string): string { while (true) { - const fileName = ts.combinePaths(searchPath, "tsconfig.json"); - if (this.host.fileExists(fileName)) { - return fileName; + const tsconfigFileName = ts.combinePaths(searchPath, "tsconfig.json"); + if (this.host.fileExists(tsconfigFileName)) { + return tsconfigFileName; } + + const jsconfigFileName = ts.combinePaths(searchPath, "jsconfig.json"); + if (this.host.fileExists(jsconfigFileName)) { + return jsconfigFileName; + } + const parentPath = ts.getDirectoryPath(searchPath); if (parentPath === searchPath) { break; @@ -1051,9 +1059,9 @@ namespace ts.server { } /** - * This function tries to search for a tsconfig.json for the given file. If we found it, + * This function tries to search for a tsconfig.json for the given file. If we found it, * we first detect if there is already a configured project created for it: if so, we re-read - * the tsconfig file content and update the project; otherwise we create a new one. + * the tsconfig file content and update the project; otherwise we create a new one. */ openOrUpdateConfiguredProjectForFile(fileName: string) { const searchPath = ts.normalizePath(getDirectoryPath(fileName)); @@ -1178,7 +1186,7 @@ namespace ts.server { return { succeeded: false, error: rawConfig.error }; } else { - const parsedCommandLine = ts.parseJsonConfigFileContent(rawConfig.config, this.host, dirPath); + const parsedCommandLine = ts.parseJsonConfigFileContent(rawConfig.config, this.host, dirPath, /*existingOptions*/ {}, configFilename); Debug.assert(!!parsedCommandLine.fileNames); if (parsedCommandLine.errors && (parsedCommandLine.errors.length > 0)) { @@ -1215,7 +1223,9 @@ namespace ts.server { } } project.finishGraph(); - project.projectFileWatcher = this.host.watchFile(configFilename, _ => this.watchedProjectConfigFileChanged(project)); + project.projectFileWatcher = this.host.watchFile( + toPath(configFilename, configFilename, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)), + _ => this.watchedProjectConfigFileChanged(project)); this.log("Add recursive watcher for: " + ts.getDirectoryPath(configFilename)); project.directoryWatcher = this.host.watchDirectory( ts.getDirectoryPath(configFilename), @@ -1255,7 +1265,7 @@ namespace ts.server { info = this.openFile(fileName, /*openedByClient*/ false); } else { - // if the root file was opened by client, it would belong to either + // if the root file was opened by client, it would belong to either // openFileRoots or openFileReferenced. if (info.isOpen) { if (this.openFileRoots.indexOf(info) >= 0) { diff --git a/src/server/session.ts b/src/server/session.ts index 9b9bf35a4a5..c1bafdf5ba8 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -792,7 +792,9 @@ namespace ts.server { } private closeClientFile(fileName: string) { - if (!fileName) { return; } + if (!fileName) { + return; + } const file = ts.normalizePath(fileName); this.projectService.closeClientFile(file); } diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 31ab5d2adec..b7e909f69d8 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -45,6 +45,10 @@ namespace ts.BreakpointResolver { return createTextSpanFromBounds(start, (endNode || startNode).getEnd()); } + function textSpanEndingAtNextToken(startNode: Node, previousTokenToFindNextEndToken: Node): TextSpan { + return textSpan(startNode, findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent)); + } + function spanInNodeIfStartsOnSameLine(node: Node, otherwiseOnNode?: Node): TextSpan { if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { return spanInNode(node); @@ -66,33 +70,6 @@ namespace ts.BreakpointResolver { function spanInNode(node: Node): TextSpan { if (node) { - if (isExpression(node)) { - if (node.parent.kind === SyntaxKind.DoStatement) { - // Set span as if on while keyword - return spanInPreviousNode(node); - } - - if (node.parent.kind === SyntaxKind.Decorator) { - // Set breakpoint on the decorator emit - return spanInNode(node.parent); - } - - if (node.parent.kind === SyntaxKind.ForStatement) { - // For now lets set the span on this expression, fix it later - return textSpan(node); - } - - if (node.parent.kind === SyntaxKind.BinaryExpression && (node.parent).operatorToken.kind === SyntaxKind.CommaToken) { - // if this is comma expression, the breakpoint is possible in this expression - return textSpan(node); - } - - if (node.parent.kind === SyntaxKind.ArrowFunction && (node.parent).body === node) { - // If this is body of arrow function, it is allowed to have the breakpoint - return textSpan(node); - } - } - switch (node.kind) { case SyntaxKind.VariableStatement: // Span on first variable declaration @@ -120,7 +97,7 @@ namespace ts.BreakpointResolver { if (isFunctionBlock(node)) { return spanInFunctionBlock(node); } - // Fall through + // Fall through case SyntaxKind.ModuleBlock: return spanInBlock(node); @@ -137,7 +114,7 @@ namespace ts.BreakpointResolver { case SyntaxKind.WhileStatement: // Span on while(...) - return textSpan(node, findNextToken((node).expression, node)); + return textSpanEndingAtNextToken(node, (node).expression); case SyntaxKind.DoStatement: // span in statement of the do statement @@ -149,7 +126,7 @@ namespace ts.BreakpointResolver { case SyntaxKind.IfStatement: // set on if(..) span - return textSpan(node, findNextToken((node).expression, node)); + return textSpanEndingAtNextToken(node, (node).expression); case SyntaxKind.LabeledStatement: // span in statement @@ -164,13 +141,16 @@ namespace ts.BreakpointResolver { return spanInForStatement(node); case SyntaxKind.ForInStatement: + // span of for (a in ...) + return textSpanEndingAtNextToken(node, (node).expression); + case SyntaxKind.ForOfStatement: - // span on for (a in ...) - return textSpan(node, findNextToken((node).expression, node)); + // span in initializer + return spanInInitializerOfForLike(node); case SyntaxKind.SwitchStatement: // span on switch(...) - return textSpan(node, findNextToken((node).expression, node)); + return textSpanEndingAtNextToken(node, (node).expression); case SyntaxKind.CaseClause: case SyntaxKind.DefaultClause: @@ -210,8 +190,7 @@ namespace ts.BreakpointResolver { case SyntaxKind.ClassDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.EnumMember: - case SyntaxKind.CallExpression: - case SyntaxKind.NewExpression: + case SyntaxKind.BindingElement: // span on complete node return textSpan(node); @@ -222,6 +201,10 @@ namespace ts.BreakpointResolver { case SyntaxKind.Decorator: return spanInNodeArray(node.parent.decorators); + case SyntaxKind.ObjectBindingPattern: + case SyntaxKind.ArrayBindingPattern: + return spanInBindingPattern(node); + // No breakpoint in interface, type alias case SyntaxKind.InterfaceDeclaration: case SyntaxKind.TypeAliasDeclaration: @@ -234,14 +217,17 @@ namespace ts.BreakpointResolver { case SyntaxKind.CommaToken: return spanInPreviousNode(node) - + case SyntaxKind.OpenBraceToken: return spanInOpenBraceToken(node); case SyntaxKind.CloseBraceToken: return spanInCloseBraceToken(node); - case SyntaxKind.OpenParenToken: + case SyntaxKind.CloseBracketToken: + return spanInCloseBracketToken(node); + + case SyntaxKind.OpenParenToken: return spanInOpenParenToken(node); case SyntaxKind.CloseParenToken: @@ -263,15 +249,93 @@ namespace ts.BreakpointResolver { case SyntaxKind.FinallyKeyword: return spanInNextNode(node); + case SyntaxKind.OfKeyword: + return spanInOfKeyword(node); + default: - // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === SyntaxKind.PropertyAssignment && (node.parent).name === node) { - return spanInNode((node.parent).initializer); + // Destructuring pattern in destructuring assignment + // [a, b, c] of + // [a, b, c] = expression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); + } + + // Set breakpoint on identifier element of destructuring pattern + // a or ...c or d: x from + // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern + if ((node.kind === SyntaxKind.Identifier || + node.kind == SyntaxKind.SpreadElementExpression || + node.kind === SyntaxKind.PropertyAssignment || + node.kind === SyntaxKind.ShorthandPropertyAssignment) && + isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + return textSpan(node); } + if (node.kind === SyntaxKind.BinaryExpression) { + const binaryExpression = node; + // Set breakpoint in destructuring pattern if its destructuring assignment + // [a, b, c] or {a, b, c} of + // [a, b, c] = expression or + // {a, b, c} = expression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern( + binaryExpression.left); + } + + if (binaryExpression.operatorToken.kind === SyntaxKind.EqualsToken && + isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + // Set breakpoint on assignment expression element of destructuring pattern + // a = expression of + // [a = expression, b, c] = someExpression or + // { a = expression, b, c } = someExpression + return textSpan(node); + } + + if (binaryExpression.operatorToken.kind === SyntaxKind.CommaToken) { + return spanInNode(binaryExpression.left); + } + } + + if (isExpression(node)) { + switch (node.parent.kind) { + case SyntaxKind.DoStatement: + // Set span as if on while keyword + return spanInPreviousNode(node); + + case SyntaxKind.Decorator: + // Set breakpoint on the decorator emit + return spanInNode(node.parent); + + case SyntaxKind.ForStatement: + case SyntaxKind.ForOfStatement: + return textSpan(node); + + case SyntaxKind.BinaryExpression: + if ((node.parent).operatorToken.kind === SyntaxKind.CommaToken) { + // if this is comma expression, the breakpoint is possible in this expression + return textSpan(node); + } + break; + + case SyntaxKind.ArrowFunction: + if ((node.parent).body === node) { + // If this is body of arrow function, it is allowed to have the breakpoint + return textSpan(node); + } + break; + } + } + + // If this is name of property assignment, set breakpoint in the initializer + if (node.parent.kind === SyntaxKind.PropertyAssignment && + (node.parent).name === node && + !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { + return spanInNode((node.parent).initializer); + } + // Breakpoint in type assertion goes to its operand if (node.parent.kind === SyntaxKind.TypeAssertionExpression && (node.parent).type === node) { - return spanInNode((node.parent).expression); + return spanInNextNode((node.parent).type); } // return type of function go to previous token @@ -279,48 +343,70 @@ namespace ts.BreakpointResolver { return spanInPreviousNode(node); } + // initializer of variable/parameter declaration go to previous node + if ((node.parent.kind === SyntaxKind.VariableDeclaration || + node.parent.kind === SyntaxKind.Parameter)) { + const paramOrVarDecl = node.parent; + if (paramOrVarDecl.initializer === node || + paramOrVarDecl.type === node || + isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + } + + if (node.parent.kind === SyntaxKind.BinaryExpression) { + const binaryExpression = node.parent; + if (isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && + (binaryExpression.right === node || + binaryExpression.operatorToken === node)) { + // If initializer of destructuring assignment move to previous token + return spanInPreviousNode(node); + } + } + // Default go to parent to set the breakpoint return spanInNode(node.parent); } } + function textSpanFromVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { + let declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] === variableDeclaration) { + // First declaration - include let keyword + return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + else { + // Span only on this declaration + return textSpan(variableDeclaration); + } + } + function spanInVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === SyntaxKind.ForInStatement || - variableDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement) { + if (variableDeclaration.parent.parent.kind === SyntaxKind.ForInStatement) { return spanInNode(variableDeclaration.parent.parent); } - - let isParentVariableStatement = variableDeclaration.parent.parent.kind === SyntaxKind.VariableStatement; - let isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === SyntaxKind.ForStatement && contains(((variableDeclaration.parent.parent).initializer).declarations, variableDeclaration); - let declarations = isParentVariableStatement - ? (variableDeclaration.parent.parent).declarationList.declarations - : isDeclarationOfForStatement - ? ((variableDeclaration.parent.parent).initializer).declarations - : undefined; + + // If this is a destructuring pattern set breakpoint in binding pattern + if (isBindingPattern(variableDeclaration.name)) { + return spanInBindingPattern(variableDeclaration.name); + } // Breakpoint is possible in variableDeclaration only if there is initialization - if (variableDeclaration.initializer || (variableDeclaration.flags & NodeFlags.Export)) { - if (declarations && declarations[0] === variableDeclaration) { - if (isParentVariableStatement) { - // First declaration - include let keyword - return textSpan(variableDeclaration.parent, variableDeclaration); - } - else { - Debug.assert(isDeclarationOfForStatement); - // Include let keyword from for statement declarations in the span - return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); - } - } - else { - // Span only on this declaration - return textSpan(variableDeclaration); - } + // or its declaration from 'for of' + if (variableDeclaration.initializer || + (variableDeclaration.flags & NodeFlags.Export) || + variableDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement) { + return textSpanFromVariableDeclaration(variableDeclaration); } - else if (declarations && declarations[0] !== variableDeclaration) { + + let declarations = variableDeclaration.parent.declarations; + if (declarations && declarations[0] !== variableDeclaration) { // If we cant set breakpoint on this declaration, set it on previous one - let indexOfCurrentDeclaration = indexOf(declarations, variableDeclaration); - return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + // Because the variable declaration may be binding pattern and + // we would like to set breakpoint in last binding element if thats the case, + // use preceding token instead + return spanInNode(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } } @@ -331,7 +417,11 @@ namespace ts.BreakpointResolver { } function spanInParameterDeclaration(parameter: ParameterDeclaration): TextSpan { - if (canHaveSpanInParameterDeclaration(parameter)) { + if (isBindingPattern(parameter.name)) { + // set breakpoint in binding pattern + return spanInBindingPattern(parameter.name); + } + else if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); } else { @@ -388,11 +478,11 @@ namespace ts.BreakpointResolver { case SyntaxKind.WhileStatement: case SyntaxKind.IfStatement: case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block case SyntaxKind.ForStatement: + case SyntaxKind.ForOfStatement: return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } @@ -400,17 +490,23 @@ namespace ts.BreakpointResolver { return spanInNode(block.statements[0]); } + function spanInInitializerOfForLike(forLikeStaement: ForStatement | ForOfStatement | ForInStatement): TextSpan { + if (forLikeStaement.initializer.kind === SyntaxKind.VariableDeclarationList) { + // declaration list, set breakpoint in first declaration + let variableDeclarationList = forLikeStaement.initializer; + if (variableDeclarationList.declarations.length > 0) { + return spanInNode(variableDeclarationList.declarations[0]); + } + } + else { + // Expression - set breakpoint in it + return spanInNode(forLikeStaement.initializer); + } + } + function spanInForStatement(forStatement: ForStatement): TextSpan { if (forStatement.initializer) { - if (forStatement.initializer.kind === SyntaxKind.VariableDeclarationList) { - let variableDeclarationList = forStatement.initializer; - if (variableDeclarationList.declarations.length > 0) { - return spanInNode(variableDeclarationList.declarations[0]); - } - } - else { - return spanInNode(forStatement.initializer); - } + return spanInInitializerOfForLike(forStatement); } if (forStatement.condition) { @@ -421,6 +517,45 @@ namespace ts.BreakpointResolver { } } + function spanInBindingPattern(bindingPattern: BindingPattern): TextSpan { + // Set breakpoint in first binding element + let firstBindingElement = forEach(bindingPattern.elements, + element => element.kind !== SyntaxKind.OmittedExpression ? element : undefined); + + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + + // Empty binding pattern of binding element, set breakpoint on binding element + if (bindingPattern.parent.kind === SyntaxKind.BindingElement) { + return textSpan(bindingPattern.parent); + } + + // Variable declaration is used as the span + return textSpanFromVariableDeclaration(bindingPattern.parent); + } + + function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node: DestructuringPattern): TextSpan { + Debug.assert(node.kind !== SyntaxKind.ArrayBindingPattern && node.kind !== SyntaxKind.ObjectBindingPattern); + const elements: NodeArray = + node.kind === SyntaxKind.ArrayLiteralExpression ? + (node).elements : + (node).properties; + + const firstBindingElement = forEach(elements, + element => element.kind !== SyntaxKind.OmittedExpression ? element : undefined); + + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + + // Could be ArrayLiteral from destructuring assignment or + // just nested element in another destructuring assignment + // set breakpoint on assignment when parent is destructuring assignment + // Otherwise set breakpoint for this element + return textSpan(node.parent.kind === SyntaxKind.BinaryExpression ? node.parent : node); + } + // Tokens: function spanInOpenBraceToken(node: Node): TextSpan { switch (node.parent.kind) { @@ -472,18 +607,52 @@ namespace ts.BreakpointResolver { } return undefined; + case SyntaxKind.ObjectBindingPattern: + // Breakpoint in last binding element or binding pattern if it contains no elements + let bindingPattern = node.parent; + return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern); + // Default to parent node default: + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + let objectLiteral = node.parent; + return textSpan(lastOrUndefined(objectLiteral.properties) || objectLiteral); + } + return spanInNode(node.parent); + } + } + + function spanInCloseBracketToken(node: Node): TextSpan { + switch (node.parent.kind) { + case SyntaxKind.ArrayBindingPattern: + // Breakpoint in last binding element or binding pattern if it contains no elements + let bindingPattern = node.parent; + return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern); + + default: + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + // Breakpoint in last binding element or binding pattern if it contains no elements + let arrayLiteral = node.parent; + return textSpan(lastOrUndefined(arrayLiteral.elements) || arrayLiteral); + } + + // Default to parent node return spanInNode(node.parent); } } function spanInOpenParenToken(node: Node): TextSpan { - if (node.parent.kind === SyntaxKind.DoStatement) { - // Go to while keyword and do action instead + if (node.parent.kind === SyntaxKind.DoStatement || // Go to while keyword and do action instead + node.parent.kind === SyntaxKind.CallExpression || + node.parent.kind === SyntaxKind.NewExpression) { return spanInPreviousNode(node); } + if (node.parent.kind === SyntaxKind.ParenthesizedExpression) { + return spanInNextNode(node); + } + // Default to parent node return spanInNode(node.parent); } @@ -502,6 +671,10 @@ namespace ts.BreakpointResolver { case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement: case SyntaxKind.ForStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.ParenthesizedExpression: return spanInPreviousNode(node); // Default to parent node @@ -512,7 +685,9 @@ namespace ts.BreakpointResolver { function spanInColonToken(node: Node): TextSpan { // Is this : specifying return annotation of the function declaration - if (isFunctionLike(node.parent) || node.parent.kind === SyntaxKind.PropertyAssignment) { + if (isFunctionLike(node.parent) || + node.parent.kind === SyntaxKind.PropertyAssignment || + node.parent.kind === SyntaxKind.Parameter) { return spanInPreviousNode(node); } @@ -521,7 +696,7 @@ namespace ts.BreakpointResolver { function spanInGreaterThanOrLessThanToken(node: Node): TextSpan { if (node.parent.kind === SyntaxKind.TypeAssertionExpression) { - return spanInNode((node.parent).expression); + return spanInNextNode(node); } return spanInNode(node.parent); @@ -530,7 +705,17 @@ namespace ts.BreakpointResolver { function spanInWhileKeyword(node: Node): TextSpan { if (node.parent.kind === SyntaxKind.DoStatement) { // Set span on while expression - return textSpan(node, findNextToken((node.parent).expression, node.parent)); + return textSpanEndingAtNextToken(node, (node.parent).expression); + } + + // Default to parent node + return spanInNode(node.parent); + } + + function spanInOfKeyword(node: Node): TextSpan { + if (node.parent.kind === SyntaxKind.ForOfStatement) { + // set using next token + return spanInNextNode(node); } // Default to parent node diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 46ec807a881..f62c6cb1700 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -387,7 +387,7 @@ namespace ts.NavigationBar { function getModuleName(moduleDeclaration: ModuleDeclaration): string { // We want to maintain quotation marks. - if (moduleDeclaration.name.kind === SyntaxKind.StringLiteral) { + if (isAmbientModule(moduleDeclaration)) { return getTextOfNode(moduleDeclaration.name); } diff --git a/src/services/services.ts b/src/services/services.ts index 2c8982f10ea..28f7f848835 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -811,6 +811,7 @@ namespace ts { public nameTable: Map; public resolvedModules: Map; public imports: LiteralExpression[]; + public moduleAugmentations: LiteralExpression[]; private namedDeclarations: Map; constructor(kind: SyntaxKind, pos: number, end: number) { @@ -1616,6 +1617,9 @@ namespace ts { public static jsxOpenTagName = "jsx open tag name"; public static jsxCloseTagName = "jsx close tag name"; public static jsxSelfClosingTagName = "jsx self closing tag name"; + public static jsxAttribute = "jsx attribute"; + public static jsxText = "jsx text"; + public static jsxAttributeStringLiteralValue = "jsx attribute string literal value"; } export const enum ClassificationType { @@ -1640,7 +1644,9 @@ namespace ts { jsxOpenTagName = 19, jsxCloseTagName = 20, jsxSelfClosingTagName = 21, - jsxAttribute = 22 + jsxAttribute = 22, + jsxText = 23, + jsxAttributeStringLiteralValue = 24, } /// Language Service @@ -2013,13 +2019,6 @@ namespace ts { return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true); } - export function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string { - return useCaseSensitivefileNames - ? ((fileName) => fileName) - : ((fileName) => fileName.toLowerCase()); - } - - export function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory = ""): DocumentRegistry { // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have // for those settings. @@ -3100,6 +3099,7 @@ namespace ts { } else if (kind === SyntaxKind.SlashToken && contextToken.parent.kind === SyntaxKind.JsxClosingElement) { isStartingCloseTag = true; + location = contextToken; } } } @@ -3125,8 +3125,11 @@ namespace ts { } else if (isStartingCloseTag) { const tagName = (contextToken.parent.parent).openingElement.tagName; - symbols = [typeChecker.getSymbolAtLocation(tagName)]; + const tagSymbol = typeChecker.getSymbolAtLocation(tagName); + if (!typeChecker.isUnknownSymbol(tagSymbol)) { + symbols = [tagSymbol]; + } isMemberCompletion = true; isNewIdentifierLocation = false; } @@ -3832,7 +3835,23 @@ namespace ts { } else { if (!symbols || symbols.length === 0) { - return undefined; + if (sourceFile.languageVariant === LanguageVariant.JSX && + location.parent && location.parent.kind === SyntaxKind.JsxClosingElement) { + // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, + // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. + // For example: + // var x =
completion list at "1" will contain "div" with type any + const tagName = (location.parent.parent).openingElement.tagName; + entries.push({ + name: (tagName).text, + kind: undefined, + kindModifiers: undefined, + sortText: "0", + }); + } + else { + return undefined; + } } getCompletionEntriesFromSymbols(symbols, entries); @@ -4440,7 +4459,7 @@ namespace ts { const typeChecker = program.getTypeChecker(); const symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { + if (!symbol || typeChecker.isUnknownSymbol(symbol)) { // Try getting just type at this position and show switch (node.kind) { case SyntaxKind.Identifier: @@ -5492,10 +5511,8 @@ namespace ts { }; } - function isImportOrExportSpecifierImportSymbol(symbol: Symbol) { - return (symbol.flags & SymbolFlags.Alias) && forEach(symbol.declarations, declaration => { - return declaration.kind === SyntaxKind.ImportSpecifier || declaration.kind === SyntaxKind.ExportSpecifier; - }); + function isImportSpecifierSymbol(symbol: Symbol) { + return (symbol.flags & SymbolFlags.Alias) && !!getDeclarationOfKind(symbol, SyntaxKind.ImportSpecifier); } function getInternedName(symbol: Symbol, location: Node, declarations: Declaration[]): string { @@ -5939,8 +5956,17 @@ namespace ts { let result = [symbol]; // If the symbol is an alias, add what it alaises to the list - if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeChecker.getAliasedSymbol(symbol)); + if (isImportSpecifierSymbol(symbol)) { + result.push(typeChecker.getAliasedSymbol(symbol)); + } + + // For export specifiers, the exported name can be refering to a local symbol, e.g.: + // import {a} from "mod"; + // export {a as somethingElse} + // We want the *local* declaration of 'a' as declared in the import, + // *not* as declared within "mod" (or farther) + if (location.parent.kind === SyntaxKind.ExportSpecifier) { + result.push(typeChecker.getExportSpecifierLocalTargetSymbol(location.parent)); } // If the location is in a context sensitive location (i.e. in an object literal) try @@ -5986,15 +6012,43 @@ namespace ts { // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ {}); } }); return result; } - function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, result: Symbol[]): void { - if (symbol && symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + /** + * Find symbol of the given property-name and add the symbol to the given result array + * @param symbol a symbol to start searching for the given propertyName + * @param propertyName a name of property to serach for + * @param result an array of symbol of found property symbols + * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisitng of the same symbol. + * The value of previousIterationSymbol is undefined when the function is first called. + */ + function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, result: Symbol[], + previousIterationSymbolsCache: SymbolTable): void { + if (!symbol) { + return; + } + + // If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited + // This is particularly important for the following cases, so that we do not infinitely visit the same symbol. + // For example: + // interface C extends C { + // /*findRef*/propName: string; + // } + // The first time getPropertySymbolsFromBaseTypes is called when finding-all-references at propName, + // the symbol argument will be the symbol of an interface "C" and previousIterationSymbol is undefined, + // the function will add any found symbol of the property-name, then its sub-routine will call + // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already + // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. + if (hasProperty(previousIterationSymbolsCache, symbol.name)) { + return; + } + + if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { forEach(symbol.getDeclarations(), declaration => { if (declaration.kind === SyntaxKind.ClassDeclaration) { getPropertySymbolFromTypeReference(getClassExtendsHeritageClauseElement(declaration)); @@ -6017,7 +6071,8 @@ namespace ts { } // Visit the typeReference as well to see if it directly or indirectly use that property - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); + previousIterationSymbolsCache[symbol.name] = symbol; + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); } } } @@ -6030,13 +6085,24 @@ namespace ts { // If the reference symbol is an alias, check if what it is aliasing is one of the search // symbols. - if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { + if (isImportSpecifierSymbol(referenceSymbol)) { const aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); if (searchSymbols.indexOf(aliasedSymbol) >= 0) { return aliasedSymbol; } } + // For export specifiers, it can be a local symbol, e.g. + // import {a} from "mod"; + // export {a as somethingElse} + // We want the local target of the export (i.e. the import symbol) and not the final target (i.e. "mod".a) + if (referenceLocation.parent.kind === SyntaxKind.ExportSpecifier) { + const aliasedSymbol = typeChecker.getExportSpecifierLocalTargetSymbol(referenceLocation.parent); + if (searchSymbols.indexOf(aliasedSymbol) >= 0) { + return aliasedSymbol; + } + } + // If the reference location is in an object literal, try to get the contextual type for the // object literal, lookup the property symbol in the contextual type, and use this symbol to // compare to our searchSymbol @@ -6058,7 +6124,7 @@ namespace ts { // see if any is in the list if (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { const result: Symbol[] = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ {}); return forEach(result, s => searchSymbols.indexOf(s) >= 0 ? s : undefined); } @@ -6231,7 +6297,7 @@ namespace ts { return SemanticMeaning.Value | SemanticMeaning.Type; case SyntaxKind.ModuleDeclaration: - if ((node).name.kind === SyntaxKind.StringLiteral) { + if (isAmbientModule(node)) { return SemanticMeaning.Namespace | SemanticMeaning.Value; } else if (getModuleInstanceState(node) === ModuleInstanceState.Instantiated) { @@ -6575,6 +6641,9 @@ namespace ts { case ClassificationType.jsxOpenTagName: return ClassificationTypeNames.jsxOpenTagName; case ClassificationType.jsxCloseTagName: return ClassificationTypeNames.jsxCloseTagName; case ClassificationType.jsxSelfClosingTagName: return ClassificationTypeNames.jsxSelfClosingTagName; + case ClassificationType.jsxAttribute: return ClassificationTypeNames.jsxAttribute; + case ClassificationType.jsxText: return ClassificationTypeNames.jsxText; + case ClassificationType.jsxAttributeStringLiteralValue: return ClassificationTypeNames.jsxAttributeStringLiteralValue; } } @@ -6759,7 +6828,8 @@ namespace ts { function classifyDisabledMergeCode(text: string, start: number, end: number) { // Classify the line that the ======= marker is on as a comment. Then just lex // all further tokens and add them to the result. - for (var i = start; i < end; i++) { + let i: number; + for (i = start; i < end; i++) { if (isLineBreak(text.charCodeAt(i))) { break; } @@ -6783,12 +6853,12 @@ namespace ts { } } - function classifyToken(token: Node): void { + function classifyTokenOrJsxText(token: Node): void { if (nodeIsMissing(token)) { return; } - const tokenStart = classifyLeadingTriviaAndGetTokenStart(token); + const tokenStart = token.kind === SyntaxKind.JsxText ? token.pos : classifyLeadingTriviaAndGetTokenStart(token); const tokenWidth = token.end - tokenStart; Debug.assert(tokenWidth >= 0); @@ -6824,7 +6894,8 @@ namespace ts { // the '=' in a variable declaration is special cased here. if (token.parent.kind === SyntaxKind.VariableDeclaration || token.parent.kind === SyntaxKind.PropertyDeclaration || - token.parent.kind === SyntaxKind.Parameter) { + token.parent.kind === SyntaxKind.Parameter || + token.parent.kind === SyntaxKind.JsxAttribute) { return ClassificationType.operator; } } @@ -6843,7 +6914,7 @@ namespace ts { return ClassificationType.numericLiteral; } else if (tokenKind === SyntaxKind.StringLiteral || tokenKind === SyntaxKind.StringLiteralType) { - return ClassificationType.stringLiteral; + return token.parent.kind === SyntaxKind.JsxAttribute ? ClassificationType.jsxAttributeStringLiteralValue : ClassificationType.stringLiteral; } else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { // TODO: we should get another classification type for these literals. @@ -6853,6 +6924,9 @@ namespace ts { // TODO (drosen): we should *also* get another classification type for these literals. return ClassificationType.stringLiteral; } + else if (tokenKind === SyntaxKind.JsxText) { + return ClassificationType.jsxText; + } else if (tokenKind === SyntaxKind.Identifier) { if (token) { switch (token.parent.kind) { @@ -6926,8 +7000,8 @@ namespace ts { const children = element.getChildren(sourceFile); for (let i = 0, n = children.length; i < n; i++) { const child = children[i]; - if (isToken(child)) { - classifyToken(child); + if (isToken(child) || child.kind === SyntaxKind.JsxText) { + classifyTokenOrJsxText(child); } else { // Recurse into our child nodes. @@ -7105,8 +7179,7 @@ namespace ts { const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); - // TODO: call a helper method instead once PR #4133 gets merged in. - const newLine = host.getNewLine ? host.getNewLine() : "\r\n"; + const newLine = getNewLineOrDefaultFromHost(host); let docParams = ""; for (let i = 0, numParams = parameters.length; i < numParams; i++) { diff --git a/src/services/shims.ts b/src/services/shims.ts index 3dc28763b17..e836eeed3e0 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -946,7 +946,8 @@ namespace ts { }; } - const configFile = parseJsonConfigFileContent(result.config, this.host, getDirectoryPath(normalizeSlashes(fileName))); + const normalizedFileName = normalizeSlashes(fileName); + const configFile = parseJsonConfigFileContent(result.config, this.host, getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName); return { options: configFile.options, @@ -1056,6 +1057,6 @@ namespace TypeScript.Services { // TODO: it should be moved into a namespace though. /* @internal */ -const toolsVersion = "1.8"; +const toolsVersion = "1.9"; /* tslint:enable:no-unused-variable */ \ No newline at end of file diff --git a/src/services/utilities.ts b/src/services/utilities.ts index b3b4ec31a02..afdc85fffd8 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -608,6 +608,36 @@ namespace ts { } return true; } + + export function isArrayLiteralOrObjectLiteralDestructuringPattern(node: Node) { + if (node.kind === SyntaxKind.ArrayLiteralExpression || + node.kind === SyntaxKind.ObjectLiteralExpression) { + // [a,b,c] from: + // [a, b, c] = someExpression; + if (node.parent.kind === SyntaxKind.BinaryExpression && + (node.parent).left === node && + (node.parent).operatorToken.kind === SyntaxKind.EqualsToken) { + return true; + } + + // [a, b, c] from: + // for([a, b, c] of expression) + if (node.parent.kind === SyntaxKind.ForOfStatement && + (node.parent).initializer === node) { + return true; + } + + // [a, b, c] of + // [x, [a, b, c] ] = someExpression + // or + // {x, a: {a, b, c} } = someExpression + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === SyntaxKind.PropertyAssignment ? node.parent.parent : node.parent)) { + return true; + } + } + + return false; + } } // Display-part writer helpers diff --git a/tests/baselines/reference/ES5For-of1.js.map b/tests/baselines/reference/ES5For-of1.js.map index 568ac1987e7..bd729517462 100644 --- a/tests/baselines/reference/ES5For-of1.js.map +++ b/tests/baselines/reference/ES5For-of1.js.map @@ -1,2 +1,2 @@ //// [ES5For-of1.js.map] -{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file +{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.sourcemap.txt b/tests/baselines/reference/ES5For-of1.sourcemap.txt index 7bdd7edfa13..5ae1084df25 100644 --- a/tests/baselines/reference/ES5For-of1.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of1.sourcemap.txt @@ -41,9 +41,9 @@ sourceFile:ES5For-of1.ts 12> 'c' 13> ] 14> -15> var v +15> ['a', 'b', 'c'] 16> -17> var v of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -58,9 +58,9 @@ sourceFile:ES5For-of1.ts 11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) 12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) 13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) 17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) 18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of13.js.map b/tests/baselines/reference/ES5For-of13.js.map index 5ff54bb8816..3fa2bd27348 100644 --- a/tests/baselines/reference/ES5For-of13.js.map +++ b/tests/baselines/reference/ES5For-of13.js.map @@ -1,2 +1,2 @@ //// [ES5For-of13.js.map] -{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file +{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13.sourcemap.txt b/tests/baselines/reference/ES5For-of13.sourcemap.txt index c3a188e7221..410560ac78e 100644 --- a/tests/baselines/reference/ES5For-of13.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of13.sourcemap.txt @@ -41,9 +41,9 @@ sourceFile:ES5For-of13.ts 12> 'c' 13> ] 14> -15> let v +15> ['a', 'b', 'c'] 16> -17> let v of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -58,9 +58,9 @@ sourceFile:ES5For-of13.ts 11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) 12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) 13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) 17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) 18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of25.js.map b/tests/baselines/reference/ES5For-of25.js.map index 1c4d8c2101f..5ccc838a488 100644 --- a/tests/baselines/reference/ES5For-of25.js.map +++ b/tests/baselines/reference/ES5For-of25.js.map @@ -1,2 +1,2 @@ //// [ES5For-of25.js.map] -{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAD,OAAC,EAAV,eAAK,EAAL,IAAU,CAAC;IAAX,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC,CAAC;IAAX,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25.sourcemap.txt b/tests/baselines/reference/ES5For-of25.sourcemap.txt index 453eef4ee46..765aa707701 100644 --- a/tests/baselines/reference/ES5For-of25.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of25.sourcemap.txt @@ -69,9 +69,9 @@ sourceFile:ES5For-of25.ts 6 > 7 > a 8 > -9 > var v +9 > a 10> -11> var v of a +11> a 12> ) 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 4) Source(2, 4) + SourceIndex(0) @@ -80,9 +80,9 @@ sourceFile:ES5For-of25.ts 5 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) 6 >Emitted(2, 18) Source(2, 15) + SourceIndex(0) 7 >Emitted(2, 25) Source(2, 16) + SourceIndex(0) -8 >Emitted(2, 27) Source(2, 6) + SourceIndex(0) -9 >Emitted(2, 42) Source(2, 11) + SourceIndex(0) -10>Emitted(2, 44) Source(2, 6) + SourceIndex(0) +8 >Emitted(2, 27) Source(2, 15) + SourceIndex(0) +9 >Emitted(2, 42) Source(2, 16) + SourceIndex(0) +10>Emitted(2, 44) Source(2, 15) + SourceIndex(0) 11>Emitted(2, 48) Source(2, 16) + SourceIndex(0) 12>Emitted(2, 49) Source(2, 17) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of26.js.map b/tests/baselines/reference/ES5For-of26.js.map index 704a3a24f2a..9dcebf97134 100644 --- a/tests/baselines/reference/ES5For-of26.js.map +++ b/tests/baselines/reference/ES5For-of26.js.map @@ -1,2 +1,2 @@ //// [ES5For-of26.js.map] -{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAA5B,cAAkB,EAAlB,IAA4B,CAAC;IAA7B,6BAAK,CAAC,mBAAG,CAAC,mBAAE,CAAC,mBAAG,CAAC,KAAC;IACnB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM,CAAC;IAA7B,eAAkB,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.sourcemap.txt b/tests/baselines/reference/ES5For-of26.sourcemap.txt index c9942b1e861..00a1cc55f37 100644 --- a/tests/baselines/reference/ES5For-of26.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of26.sourcemap.txt @@ -38,9 +38,9 @@ sourceFile:ES5For-of26.ts 10> 3 11> ] 12> -13> var [a = 0, b = 1] +13> [2, 3] 14> -15> var [a = 0, b = 1] of [2, 3] +15> [2, 3] 16> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -53,50 +53,50 @@ sourceFile:ES5For-of26.ts 9 >Emitted(1, 27) Source(1, 32) + SourceIndex(0) 10>Emitted(1, 28) Source(1, 33) + SourceIndex(0) 11>Emitted(1, 29) Source(1, 34) + SourceIndex(0) -12>Emitted(1, 31) Source(1, 6) + SourceIndex(0) -13>Emitted(1, 45) Source(1, 24) + SourceIndex(0) -14>Emitted(1, 47) Source(1, 6) + SourceIndex(0) +12>Emitted(1, 31) Source(1, 28) + SourceIndex(0) +13>Emitted(1, 45) Source(1, 34) + SourceIndex(0) +14>Emitted(1, 47) Source(1, 28) + SourceIndex(0) 15>Emitted(1, 51) Source(1, 34) + SourceIndex(0) 16>Emitted(1, 52) Source(1, 35) + SourceIndex(0) --- >>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; 1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^ -5 > ^ -6 > ^^^^^^^^^^^^^^^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^ -9 > ^ -10> ^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> -2 > var [ -3 > a -4 > = -5 > 0 -6 > , -7 > b -8 > = -9 > 1 -10> ] +2 > var [a = 0, b = 1] +3 > +4 > a = 0 +5 > +6 > a = 0 +7 > , +8 > b = 1 +9 > +10> b = 1 1->Emitted(2, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(2, 34) Source(1, 11) + SourceIndex(0) -3 >Emitted(2, 35) Source(1, 12) + SourceIndex(0) -4 >Emitted(2, 54) Source(1, 15) + SourceIndex(0) -5 >Emitted(2, 55) Source(1, 16) + SourceIndex(0) -6 >Emitted(2, 74) Source(1, 18) + SourceIndex(0) -7 >Emitted(2, 75) Source(1, 19) + SourceIndex(0) -8 >Emitted(2, 94) Source(1, 22) + SourceIndex(0) -9 >Emitted(2, 95) Source(1, 23) + SourceIndex(0) -10>Emitted(2, 100) Source(1, 24) + SourceIndex(0) +2 >Emitted(2, 20) Source(1, 24) + SourceIndex(0) +3 >Emitted(2, 22) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 32) Source(1, 16) + SourceIndex(0) +5 >Emitted(2, 34) Source(1, 11) + SourceIndex(0) +6 >Emitted(2, 60) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 62) Source(1, 18) + SourceIndex(0) +8 >Emitted(2, 72) Source(1, 23) + SourceIndex(0) +9 >Emitted(2, 74) Source(1, 18) + SourceIndex(0) +10>Emitted(2, 100) Source(1, 23) + SourceIndex(0) --- >>> a; 1 >^^^^ 2 > ^ 3 > ^ 4 > ^-> -1 > of [2, 3]) { +1 >] of [2, 3]) { > 2 > a 3 > ; diff --git a/tests/baselines/reference/ES5For-of3.js.map b/tests/baselines/reference/ES5For-of3.js.map index 7454e1ca85d..5a91ff28e9c 100644 --- a/tests/baselines/reference/ES5For-of3.js.map +++ b/tests/baselines/reference/ES5For-of3.js.map @@ -1,2 +1,2 @@ //// [ES5For-of3.js.map] -{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3.sourcemap.txt b/tests/baselines/reference/ES5For-of3.sourcemap.txt index dd0bca37b68..1c728f5df67 100644 --- a/tests/baselines/reference/ES5For-of3.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of3.sourcemap.txt @@ -41,9 +41,9 @@ sourceFile:ES5For-of3.ts 12> 'c' 13> ] 14> -15> var v +15> ['a', 'b', 'c'] 16> -17> var v of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) @@ -58,9 +58,9 @@ sourceFile:ES5For-of3.ts 11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) 12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) 13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) 17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) 18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) --- diff --git a/tests/baselines/reference/ES5For-of8.js.map b/tests/baselines/reference/ES5For-of8.js.map index f4e62e46e18..3a1497eadcd 100644 --- a/tests/baselines/reference/ES5For-of8.js.map +++ b/tests/baselines/reference/ES5For-of8.js.map @@ -1,2 +1,2 @@ //// [ES5For-of8.js.map] -{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA;IACI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAA1B,cAAO,EAAP,IAA0B,CAAC;IAA3B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA;IACI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,CAAC;IAA3B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.sourcemap.txt b/tests/baselines/reference/ES5For-of8.sourcemap.txt index 7a87dbf3998..dbfce707ca6 100644 --- a/tests/baselines/reference/ES5For-of8.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of8.sourcemap.txt @@ -88,9 +88,9 @@ sourceFile:ES5For-of8.ts 12> 'c' 13> ] 14> -15> foo().x +15> ['a', 'b', 'c'] 16> -17> foo().x of ['a', 'b', 'c'] +17> ['a', 'b', 'c'] 18> ) 1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) 2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) @@ -105,9 +105,9 @@ sourceFile:ES5For-of8.ts 11>Emitted(4, 34) Source(4, 28) + SourceIndex(0) 12>Emitted(4, 37) Source(4, 31) + SourceIndex(0) 13>Emitted(4, 38) Source(4, 32) + SourceIndex(0) -14>Emitted(4, 40) Source(4, 6) + SourceIndex(0) -15>Emitted(4, 54) Source(4, 13) + SourceIndex(0) -16>Emitted(4, 56) Source(4, 6) + SourceIndex(0) +14>Emitted(4, 40) Source(4, 17) + SourceIndex(0) +15>Emitted(4, 54) Source(4, 32) + SourceIndex(0) +16>Emitted(4, 56) Source(4, 17) + SourceIndex(0) 17>Emitted(4, 60) Source(4, 32) + SourceIndex(0) 18>Emitted(4, 61) Source(4, 33) + SourceIndex(0) --- diff --git a/tests/baselines/reference/YieldExpression11_es6.errors.txt b/tests/baselines/reference/YieldExpression11_es6.errors.txt index c19e8b6cfa5..1b0c08bd79a 100644 --- a/tests/baselines/reference/YieldExpression11_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression11_es6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS1220: Generators are only available when targeting ECMAScript 6 or higher. -tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): error TS2304: Cannot find name 'foo'. +tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): error TS2663: Cannot find name 'foo'. Did you mean the instance member 'this.foo'? ==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (2 errors) ==== @@ -9,6 +9,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): err !!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher. yield(foo); ~~~ -!!! error TS2304: Cannot find name 'foo'. +!!! error TS2663: Cannot find name 'foo'. Did you mean the instance member 'this.foo'? } } \ No newline at end of file diff --git a/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.errors.txt b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.errors.txt new file mode 100644 index 00000000000..0ce9c614618 --- /dev/null +++ b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/accessInstanceMemberFromStaticMethod01.ts(5,17): error TS2662: Cannot find name 'foo'. Did you mean the static member 'C.foo'? + + +==== tests/cases/compiler/accessInstanceMemberFromStaticMethod01.ts (1 errors) ==== + class C { + static foo: string; + + bar() { + let k = foo; + ~~~ +!!! error TS2662: Cannot find name 'foo'. Did you mean the static member 'C.foo'? + } + } \ No newline at end of file diff --git a/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js new file mode 100644 index 00000000000..763be0568dc --- /dev/null +++ b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js @@ -0,0 +1,18 @@ +//// [accessInstanceMemberFromStaticMethod01.ts] +class C { + static foo: string; + + bar() { + let k = foo; + } +} + +//// [accessInstanceMemberFromStaticMethod01.js] +var C = (function () { + function C() { + } + C.prototype.bar = function () { + var k = foo; + }; + return C; +}()); diff --git a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.errors.txt b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.errors.txt new file mode 100644 index 00000000000..612a89a1043 --- /dev/null +++ b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/accessStaticMemberFromInstanceMethod01.ts(5,17): error TS2304: Cannot find name 'foo'. + + +==== tests/cases/compiler/accessStaticMemberFromInstanceMethod01.ts (1 errors) ==== + class C { + foo: string; + + static bar() { + let k = foo; + ~~~ +!!! error TS2304: Cannot find name 'foo'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js new file mode 100644 index 00000000000..fd8ee14b2e1 --- /dev/null +++ b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js @@ -0,0 +1,18 @@ +//// [accessStaticMemberFromInstanceMethod01.ts] +class C { + foo: string; + + static bar() { + let k = foo; + } +} + +//// [accessStaticMemberFromInstanceMethod01.js] +var C = (function () { + function C() { + } + C.bar = function () { + var k = foo; + }; + return C; +}()); diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index fe13faba581..18ea36c5d00 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. - Property 'someClass' is missing in type 'Number'. tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. @@ -9,7 +8,6 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tes x = 1; // Should be error ~ !!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. -!!! error TS2322: Property 'someClass' is missing in type 'Number'. var y = 1; y = moduleA; // should be error ~ diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt index 0e508470b13..4edf3bf7966 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2664: Invalid module name in augmentation, module 'ext' cannot be found. tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find module 'ext'. @@ -9,7 +9,7 @@ tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): err declare module "ext" { ~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'ext' cannot be found. export class C { } } diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt index 7e4ac795d0d..c892c91bfd7 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts(2,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. -==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts (1 errors) ==== +==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts (2 errors) ==== module M { export declare module "M" { } + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt index e5905aaaf8f..1599069e67d 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.errors.txt @@ -1,7 +1,10 @@ -tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts(1,23): error TS2664: Invalid module name in augmentation, module 'M' cannot be found. -==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts (1 errors) ==== +==== tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts (2 errors) ==== export declare module "M" { } + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. \ No newline at end of file +!!! error TS2664: Invalid module name in augmentation, module 'M' cannot be found. \ No newline at end of file diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 812bbe15da4..89ef8ded91c 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ==== @@ -8,5 +7,4 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'IArguments'. -!!! error TS2322: Property 'length' is missing in type 'Number'. } \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index d3a7fafed05..3cce5658c13 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -26,10 +26,13 @@ tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is Property 'C2M1' is missing in type 'C3'. tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. Type 'C2' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'C2'. tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. Type 'C1' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'C1'. tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. Type 'I1' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'I1'. tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. @@ -159,14 +162,17 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n ~~~~~~ !!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. !!! error TS2322: Type 'C2' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C2'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ !!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. !!! error TS2322: Type 'C1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C1'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ !!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. !!! error TS2322: Type 'I1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'I1'. arr_any = f1; // should be an error - is ~~~~~~~ diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index 637fb3e3bc4..5409075a55c 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -18,7 +18,6 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error Types of parameters 'items' and 'items' are incompatible. Type 'number | string' is not assignable to type 'Number'. Type 'string' is not assignable to type 'Number'. - Property 'toFixed' is missing in type 'String'. ==== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts (6 errors) ==== @@ -82,5 +81,4 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Types of parameters 'items' and 'items' are incompatible. !!! error TS2322: Type 'number | string' is not assignable to type 'Number'. !!! error TS2322: Type 'string' is not assignable to type 'Number'. -!!! error TS2322: Property 'toFixed' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt index b70b659773c..1968957363c 100644 --- a/tests/baselines/reference/arraySigChecking.errors.txt +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -4,7 +4,6 @@ tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is n tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. Type 'number[]' is not assignable to type 'number[][]'. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/arraySigChecking.ts (3 errors) ==== @@ -39,7 +38,6 @@ tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' !!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. !!! error TS2322: Type 'number[]' is not assignable to type 'number[][]'. !!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. function isEmpty(l: { length: number }) { return l.length === 0; diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt index 41446dfceab..1c37f04be72 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. - Property 'isArray' is missing in type 'Number'. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,22): error TS1005: '=' expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. @@ -16,7 +15,6 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( var xs3: typeof Array; ~~~ !!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. -!!! error TS2322: Property 'isArray' is missing in type 'Number'. ~ !!! error TS1005: '=' expected. ~ diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 7539af92887..0936c532ab3 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -3,9 +3,7 @@ tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: st tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [index: number]: any; }'. tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. - Index signature is missing in type 'String'. tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. - Index signature is missing in type 'Boolean'. ==== tests/cases/compiler/assignmentCompat1.ts (4 errors) ==== @@ -25,11 +23,9 @@ tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is y = "foo"; // Error ~ !!! error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. -!!! error TS2322: Index signature is missing in type 'String'. z = "foo"; // OK, string has numeric indexer z = false; // Error ~ !!! error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. -!!! error TS2322: Index signature is missing in type 'Boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index e00d1eea042..a75b5fafac1 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -8,6 +8,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type 'Base' is not assignable to type '{ foo: number; }'. + Types of property 'foo' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (2 errors) ==== @@ -76,6 +80,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var b10: (...x: T[]) => T; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index 6cd40f6c8c1..da9ffba1ee1 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -8,6 +8,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type 'Base' is not assignable to type '{ foo: number; }'. + Types of property 'foo' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. @@ -15,6 +19,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. + Type '{ new (a: number): number; new (a?: number): number; }' provides no match for the signature '(a: any): any' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. @@ -22,6 +27,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. + Type '{ new (a: T): T; new (a: T): T; }' provides no match for the signature '(a: any): any' ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts (6 errors) ==== @@ -90,6 +96,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var b10: new (...x: T[]) => T; @@ -124,6 +134,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' provides no match for the signature '(a: any): any' var b17: new (x: (a: T) => T) => any[]; a17 = b17; // error @@ -137,6 +148,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' provides no match for the signature '(a: any): any' } module WithGenericSignaturesInBaseType { diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt index 266d72b3232..71a93f11b35 100644 --- a/tests/baselines/reference/assignmentCompatability16.errors.txt +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability16.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt index b37f39d082f..a87bcff2e92 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'any[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability17.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'any[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt index 2be4a037575..8ab5e5dcd07 100644 --- a/tests/baselines/reference/assignmentCompatability18.errors.txt +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability18.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt index ae97af6aa7e..e84e665cefa 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability19.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt index 750310ac5cc..2e67a2a2033 100644 --- a/tests/baselines/reference/assignmentCompatability20.errors.txt +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability20.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt index 8da52fe42c6..44e24e7d0b5 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'string[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability21.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'string[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'string[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt index f0799a92f5c..cb42a7abaef 100644 --- a/tests/baselines/reference/assignmentCompatability22.errors.txt +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability22.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt index a005eaa02d1..7b54e8559eb 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'boolean[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability23.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt index 194ae4ab675..9ba5c35d528 100644 --- a/tests/baselines/reference/assignmentCompatability29.errors.txt +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability29.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt index b025705517c..43f7f3f9c0a 100644 --- a/tests/baselines/reference/assignmentCompatability30.errors.txt +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability30.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt index 8e19905eba7..8874ebf06a6 100644 --- a/tests/baselines/reference/assignmentCompatability31.errors.txt +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability31.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt index 6d6321f5e50..00164a48fd6 100644 --- a/tests/baselines/reference/assignmentCompatability32.errors.txt +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability32.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index e5db4f9ab96..33a2269f747 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable'. - Property 'apply' is missing in type 'String'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'string[]'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable'. - Property 'apply' is missing in type 'Number'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. @@ -26,7 +24,6 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi x = ''; ~ !!! error TS2322: Type 'string' is not assignable to type 'Applicable'. -!!! error TS2322: Property 'apply' is missing in type 'String'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Applicable'. @@ -34,7 +31,6 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi x = 4; ~ !!! error TS2322: Type 'number' is not assignable to type 'Applicable'. -!!! error TS2322: Property 'apply' is missing in type 'Number'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Applicable'. diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index f3ff6f1b792..1651e5082ee 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable'. - Property 'call' is missing in type 'String'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable'. Property 'call' is missing in type 'string[]'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable'. - Property 'call' is missing in type 'Number'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable'. Property 'call' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. @@ -26,7 +24,6 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio x = ''; ~ !!! error TS2322: Type 'string' is not assignable to type 'Callable'. -!!! error TS2322: Property 'call' is missing in type 'String'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Callable'. @@ -34,7 +31,6 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio x = 4; ~ !!! error TS2322: Type 'number' is not assignable to type 'Callable'. -!!! error TS2322: Property 'call' is missing in type 'Number'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Callable'. diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js index c24259cf0b5..fdaa365836d 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js @@ -11,6 +11,6 @@ class C { class C { method() { function other() { } - var fn = () => __awaiter(this, arguments, Promise, function* (_arguments) { return yield other.apply(this, _arguments); }); + var fn = () => __awaiter(this, arguments, Promise, function* () { return yield other.apply(this, arguments); }); } } diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.js b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.js index 7007c66ae28..213ecfd53a6 100644 --- a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.js +++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.js @@ -40,17 +40,12 @@ module M { } //// [asyncAwaitIsolatedModules_es6.js] -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { - return new Promise(function (resolve, reject) { - generator = generator.call(thisArg, _arguments); - function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } - function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } - function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } - function step(verb, value) { - var result = generator[verb](value); - result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); - } - step("next", void 0); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); }); }; function f0() { diff --git a/tests/baselines/reference/asyncAwait_es6.js b/tests/baselines/reference/asyncAwait_es6.js index 155a44d339d..14dfc7fc9aa 100644 --- a/tests/baselines/reference/asyncAwait_es6.js +++ b/tests/baselines/reference/asyncAwait_es6.js @@ -40,17 +40,12 @@ module M { } //// [asyncAwait_es6.js] -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { - return new Promise(function (resolve, reject) { - generator = generator.call(thisArg, _arguments); - function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } - function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } - function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } - function step(verb, value) { - var result = generator[verb](value); - result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); - } - step("next", void 0); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); }); }; function f0() { diff --git a/tests/baselines/reference/asyncFunctionsAcrossFiles.js b/tests/baselines/reference/asyncFunctionsAcrossFiles.js new file mode 100644 index 00000000000..7e8a58205e2 --- /dev/null +++ b/tests/baselines/reference/asyncFunctionsAcrossFiles.js @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/asyncFunctionsAcrossFiles.ts] //// + +//// [a.ts] +import { b } from './b'; +export const a = { + f: async () => { + await b.f(); + } +}; +//// [b.ts] +import { a } from './a'; +export const b = { + f: async () => { + await a.f(); + } +}; + +//// [b.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +import { a } from './a'; +export const b = { + f: () => __awaiter(this, void 0, Promise, function* () { + yield a.f(); + }) +}; +//// [a.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +import { b } from './b'; +export const a = { + f: () => __awaiter(this, void 0, Promise, function* () { + yield b.f(); + }) +}; diff --git a/tests/baselines/reference/asyncFunctionsAcrossFiles.symbols b/tests/baselines/reference/asyncFunctionsAcrossFiles.symbols new file mode 100644 index 00000000000..2e9c52d5d91 --- /dev/null +++ b/tests/baselines/reference/asyncFunctionsAcrossFiles.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/a.ts === +import { b } from './b'; +>b : Symbol(b, Decl(a.ts, 0, 8)) + +export const a = { +>a : Symbol(a, Decl(a.ts, 1, 12)) + + f: async () => { +>f : Symbol(f, Decl(a.ts, 1, 18)) + + await b.f(); +>b.f : Symbol(f, Decl(b.ts, 1, 18)) +>b : Symbol(b, Decl(a.ts, 0, 8)) +>f : Symbol(f, Decl(b.ts, 1, 18)) + } +}; +=== tests/cases/compiler/b.ts === +import { a } from './a'; +>a : Symbol(a, Decl(b.ts, 0, 8)) + +export const b = { +>b : Symbol(b, Decl(b.ts, 1, 12)) + + f: async () => { +>f : Symbol(f, Decl(b.ts, 1, 18)) + + await a.f(); +>a.f : Symbol(f, Decl(a.ts, 1, 18)) +>a : Symbol(a, Decl(b.ts, 0, 8)) +>f : Symbol(f, Decl(a.ts, 1, 18)) + } +}; diff --git a/tests/baselines/reference/asyncFunctionsAcrossFiles.types b/tests/baselines/reference/asyncFunctionsAcrossFiles.types new file mode 100644 index 00000000000..0b946141541 --- /dev/null +++ b/tests/baselines/reference/asyncFunctionsAcrossFiles.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/a.ts === +import { b } from './b'; +>b : { f: () => Promise; } + +export const a = { +>a : { f: () => Promise; } +>{ f: async () => { await b.f(); }} : { f: () => Promise; } + + f: async () => { +>f : () => Promise +>async () => { await b.f(); } : () => Promise + + await b.f(); +>await b.f() : void +>b.f() : Promise +>b.f : () => Promise +>b : { f: () => Promise; } +>f : () => Promise + } +}; +=== tests/cases/compiler/b.ts === +import { a } from './a'; +>a : { f: () => Promise; } + +export const b = { +>b : { f: () => Promise; } +>{ f: async () => { await a.f(); }} : { f: () => Promise; } + + f: async () => { +>f : () => Promise +>async () => { await a.f(); } : () => Promise + + await a.f(); +>await a.f() : void +>a.f() : Promise +>a.f : () => Promise +>a : { f: () => Promise; } +>f : () => Promise + } +}; diff --git a/tests/baselines/reference/asyncImportedPromise_es6.js b/tests/baselines/reference/asyncImportedPromise_es6.js index a9c7540d88f..dfff0b7bd3e 100644 --- a/tests/baselines/reference/asyncImportedPromise_es6.js +++ b/tests/baselines/reference/asyncImportedPromise_es6.js @@ -16,20 +16,15 @@ class Task extends Promise { exports.Task = Task; //// [test.js] "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { - return new Promise(function (resolve, reject) { - generator = generator.call(thisArg, _arguments); - function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } - function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } - function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } - function step(verb, value) { - var result = generator[verb](value); - result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); - } - step("next", void 0); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); }); }; -var task_1 = require("./task"); +const task_1 = require("./task"); class Test { example() { return __awaiter(this, void 0, task_1.Task, function* () { return; }); diff --git a/tests/baselines/reference/asyncMethodWithSuper_es6.js b/tests/baselines/reference/asyncMethodWithSuper_es6.js new file mode 100644 index 00000000000..74d4de79881 --- /dev/null +++ b/tests/baselines/reference/asyncMethodWithSuper_es6.js @@ -0,0 +1,99 @@ +//// [asyncMethodWithSuper_es6.ts] +class A { + x() { + } +} + +class B extends A { + // async method with only call/get on 'super' does not require a binding + async simple() { + // call with property access + super.x(); + + // call with element access + super["x"](); + + // property access (read) + const a = super.x; + + // element access (read) + const b = super["x"]; + } + + // async method with assignment/destructuring on 'super' requires a binding + async advanced() { + const f = () => {}; + + // call with property access + super.x(); + + // call with element access + super["x"](); + + // property access (read) + const a = super.x; + + // element access (read) + const b = super["x"]; + + // property access (assign) + super.x = f; + + // element access (assign) + super["x"] = f; + + // destructuring assign with property access + ({ f: super.x } = { f }); + + // destructuring assign with element access + ({ f: super["x"] } = { f }); + } +} + +//// [asyncMethodWithSuper_es6.js] +class A { + x() { + } +} +class B extends A { + // async method with only call/get on 'super' does not require a binding + simple() { + const _super = name => super[name]; + return __awaiter(this, void 0, Promise, function* () { + // call with property access + _super("x").call(this); + // call with element access + _super("x").call(this); + // property access (read) + const a = _super("x"); + // element access (read) + const b = _super("x"); + }); + } + // async method with assignment/destructuring on 'super' requires a binding + advanced() { + const _super = (function (geti, seti) { + const cache = Object.create(null); + return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); + })(name => super[name], (name, value) => super[name] = value); + return __awaiter(this, void 0, Promise, function* () { + const f = () => { }; + // call with property access + _super("x").value.call(this); + // call with element access + _super("x").value.call(this); + // property access (read) + const a = _super("x").value; + // element access (read) + const b = _super("x").value; + // property access (assign) + _super("x").value = f; + // element access (assign) + _super("x").value = f; + // destructuring assign with property access + ({ f: _super("x").value } = { f }); + // destructuring assign with element access + ({ f: _super("x").value } = { f }); + }); + } +} diff --git a/tests/baselines/reference/asyncMethodWithSuper_es6.symbols b/tests/baselines/reference/asyncMethodWithSuper_es6.symbols new file mode 100644 index 00000000000..37937a061a8 --- /dev/null +++ b/tests/baselines/reference/asyncMethodWithSuper_es6.symbols @@ -0,0 +1,102 @@ +=== tests/cases/conformance/async/es6/asyncMethodWithSuper_es6.ts === +class A { +>A : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) + + x() { +>x : Symbol(x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + } +} + +class B extends A { +>B : Symbol(B, Decl(asyncMethodWithSuper_es6.ts, 3, 1)) +>A : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) + + // async method with only call/get on 'super' does not require a binding + async simple() { +>simple : Symbol(simple, Decl(asyncMethodWithSuper_es6.ts, 5, 19)) + + // call with property access + super.x(); +>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + + // call with element access + super["x"](); +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + + // property access (read) + const a = super.x; +>a : Symbol(a, Decl(asyncMethodWithSuper_es6.ts, 15, 13)) +>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + + // element access (read) + const b = super["x"]; +>b : Symbol(b, Decl(asyncMethodWithSuper_es6.ts, 18, 13)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + } + + // async method with assignment/destructuring on 'super' requires a binding + async advanced() { +>advanced : Symbol(advanced, Decl(asyncMethodWithSuper_es6.ts, 19, 5)) + + const f = () => {}; +>f : Symbol(f, Decl(asyncMethodWithSuper_es6.ts, 23, 13)) + + // call with property access + super.x(); +>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + + // call with element access + super["x"](); +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + + // property access (read) + const a = super.x; +>a : Symbol(a, Decl(asyncMethodWithSuper_es6.ts, 32, 13)) +>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + + // element access (read) + const b = super["x"]; +>b : Symbol(b, Decl(asyncMethodWithSuper_es6.ts, 35, 13)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) + + // property access (assign) + super.x = f; +>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>f : Symbol(f, Decl(asyncMethodWithSuper_es6.ts, 23, 13)) + + // element access (assign) + super["x"] = f; +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>f : Symbol(f, Decl(asyncMethodWithSuper_es6.ts, 23, 13)) + + // destructuring assign with property access + ({ f: super.x } = { f }); +>f : Symbol(f, Decl(asyncMethodWithSuper_es6.ts, 44, 10)) +>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>x : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>f : Symbol(f, Decl(asyncMethodWithSuper_es6.ts, 44, 27)) + + // destructuring assign with element access + ({ f: super["x"] } = { f }); +>f : Symbol(f, Decl(asyncMethodWithSuper_es6.ts, 47, 10)) +>super : Symbol(A, Decl(asyncMethodWithSuper_es6.ts, 0, 0)) +>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es6.ts, 0, 9)) +>f : Symbol(f, Decl(asyncMethodWithSuper_es6.ts, 47, 30)) + } +} diff --git a/tests/baselines/reference/asyncMethodWithSuper_es6.types b/tests/baselines/reference/asyncMethodWithSuper_es6.types new file mode 100644 index 00000000000..04c5b5a9baf --- /dev/null +++ b/tests/baselines/reference/asyncMethodWithSuper_es6.types @@ -0,0 +1,123 @@ +=== tests/cases/conformance/async/es6/asyncMethodWithSuper_es6.ts === +class A { +>A : A + + x() { +>x : () => void + } +} + +class B extends A { +>B : B +>A : A + + // async method with only call/get on 'super' does not require a binding + async simple() { +>simple : () => Promise + + // call with property access + super.x(); +>super.x() : void +>super.x : () => void +>super : A +>x : () => void + + // call with element access + super["x"](); +>super["x"]() : void +>super["x"] : () => void +>super : A +>"x" : string + + // property access (read) + const a = super.x; +>a : () => void +>super.x : () => void +>super : A +>x : () => void + + // element access (read) + const b = super["x"]; +>b : () => void +>super["x"] : () => void +>super : A +>"x" : string + } + + // async method with assignment/destructuring on 'super' requires a binding + async advanced() { +>advanced : () => Promise + + const f = () => {}; +>f : () => void +>() => {} : () => void + + // call with property access + super.x(); +>super.x() : void +>super.x : () => void +>super : A +>x : () => void + + // call with element access + super["x"](); +>super["x"]() : void +>super["x"] : () => void +>super : A +>"x" : string + + // property access (read) + const a = super.x; +>a : () => void +>super.x : () => void +>super : A +>x : () => void + + // element access (read) + const b = super["x"]; +>b : () => void +>super["x"] : () => void +>super : A +>"x" : string + + // property access (assign) + super.x = f; +>super.x = f : () => void +>super.x : () => void +>super : A +>x : () => void +>f : () => void + + // element access (assign) + super["x"] = f; +>super["x"] = f : () => void +>super["x"] : () => void +>super : A +>"x" : string +>f : () => void + + // destructuring assign with property access + ({ f: super.x } = { f }); +>({ f: super.x } = { f }) : { f: () => void; } +>{ f: super.x } = { f } : { f: () => void; } +>{ f: super.x } : { f: () => void; } +>f : () => void +>super.x : () => void +>super : A +>x : () => void +>{ f } : { f: () => void; } +>f : () => void + + // destructuring assign with element access + ({ f: super["x"] } = { f }); +>({ f: super["x"] } = { f }) : { f: () => void; } +>{ f: super["x"] } = { f } : { f: () => void; } +>{ f: super["x"] } : { f: () => void; } +>f : () => void +>super["x"] : () => void +>super : A +>"x" : string +>{ f } : { f: () => void; } +>f : () => void + } +} diff --git a/tests/baselines/reference/asyncMultiFile.js b/tests/baselines/reference/asyncMultiFile.js index e93dc586255..6229c29f02c 100644 --- a/tests/baselines/reference/asyncMultiFile.js +++ b/tests/baselines/reference/asyncMultiFile.js @@ -6,17 +6,12 @@ async function f() {} function g() { } //// [a.js] -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { - return new Promise(function (resolve, reject) { - generator = generator.call(thisArg, _arguments); - function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } - function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } - function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } - function step(verb, value) { - var result = generator[verb](value); - result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); - } - step("next", void 0); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); }); }; function f() { diff --git a/tests/baselines/reference/booleanAssignment.errors.txt b/tests/baselines/reference/booleanAssignment.errors.txt index 454bd7ef707..15b506d3df4 100644 --- a/tests/baselines/reference/booleanAssignment.errors.txt +++ b/tests/baselines/reference/booleanAssignment.errors.txt @@ -1,11 +1,5 @@ tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type 'number' is not assignable to type 'Boolean'. - Types of property 'valueOf' are incompatible. - Type '() => number' is not assignable to type '() => boolean'. - Type 'number' is not assignable to type 'boolean'. tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type 'string' is not assignable to type 'Boolean'. - Types of property 'valueOf' are incompatible. - Type '() => string' is not assignable to type '() => boolean'. - Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => Object' is not assignable to type '() => boolean'. @@ -17,15 +11,9 @@ tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not a b = 1; // Error ~ !!! error TS2322: Type 'number' is not assignable to type 'Boolean'. -!!! error TS2322: Types of property 'valueOf' are incompatible. -!!! error TS2322: Type '() => number' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. b = "a"; // Error ~ !!! error TS2322: Type 'string' is not assignable to type 'Boolean'. -!!! error TS2322: Types of property 'valueOf' are incompatible. -!!! error TS2322: Type '() => string' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. b = {}; // Error ~ !!! error TS2322: Type '{}' is not assignable to type 'Boolean'. diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPattern.baseline new file mode 100644 index 00000000000..923e0cced09 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPattern.baseline @@ -0,0 +1,1005 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (186 to 207) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +8 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (208 to 226) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +9 >} + + ~~ => Pos: (227 to 228) SpanInfo: {"start":227,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +-------------------------------- +10 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (229 to 292) SpanInfo: {"start":229,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 10, col 0) to (line 10, col 62) +-------------------------------- +11 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (293 to 366) SpanInfo: {"start":293,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 11, col 0) to (line 11, col 72) +-------------------------------- +12 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (367 to 393) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +13 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (394 to 417) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +14 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (420 to 486) SpanInfo: undefined +-------------------------------- +16 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (487 to 522) SpanInfo: undefined +-------------------------------- +17 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (523 to 593) SpanInfo: undefined +-------------------------------- +18 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (594 to 696) SpanInfo: undefined +-------------------------------- +19 >let i: number; + + ~~~~~~~~~~~~~~~ => Pos: (697 to 711) SpanInfo: undefined +-------------------------------- +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (712 to 735) SpanInfo: {"start":720,"length":5} + >nameA + >:=> (line 20, col 8) to (line 20, col 13) +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (736 to 742) SpanInfo: {"start":737,"length":5} + >i = 0 + >:=> (line 20, col 25) to (line 20, col 30) +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (743 to 749) SpanInfo: {"start":744,"length":5} + >i < 1 + >:=> (line 20, col 32) to (line 20, col 37) +20 >for ([, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (750 to 757) SpanInfo: {"start":751,"length":3} + >i++ + >:=> (line 20, col 39) to (line 20, col 42) +-------------------------------- +21 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (758 to 781) SpanInfo: {"start":762,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +22 >} + + ~~ => Pos: (782 to 783) SpanInfo: {"start":762,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (784 to 811) SpanInfo: {"start":792,"length":5} + >nameA + >:=> (line 23, col 8) to (line 23, col 13) +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (812 to 818) SpanInfo: {"start":813,"length":5} + >i = 0 + >:=> (line 23, col 29) to (line 23, col 34) +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (819 to 825) SpanInfo: {"start":820,"length":5} + >i < 1 + >:=> (line 23, col 36) to (line 23, col 41) +23 >for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (826 to 833) SpanInfo: {"start":827,"length":3} + >i++ + >:=> (line 23, col 43) to (line 23, col 46) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (834 to 857) SpanInfo: {"start":838,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (858 to 859) SpanInfo: {"start":838,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (860 to 903) SpanInfo: {"start":868,"length":5} + >nameA + >:=> (line 26, col 8) to (line 26, col 13) +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (904 to 910) SpanInfo: {"start":905,"length":5} + >i = 0 + >:=> (line 26, col 45) to (line 26, col 50) +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (911 to 917) SpanInfo: {"start":912,"length":5} + >i < 1 + >:=> (line 26, col 52) to (line 26, col 57) +26 >for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (918 to 925) SpanInfo: {"start":919,"length":3} + >i++ + >:=> (line 26, col 59) to (line 26, col 62) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (926 to 949) SpanInfo: {"start":930,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (950 to 951) SpanInfo: {"start":930,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (952 to 974) SpanInfo: {"start":961,"length":13} + >primarySkillA + >:=> (line 29, col 9) to (line 29, col 22) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (975 to 991) SpanInfo: {"start":976,"length":15} + >secondarySkillA + >:=> (line 29, col 24) to (line 29, col 39) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (992 to 1007) SpanInfo: {"start":960,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 29, col 8) to (line 29, col 40) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1008 to 1014) SpanInfo: {"start":1009,"length":5} + >i = 0 + >:=> (line 29, col 57) to (line 29, col 62) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1015 to 1021) SpanInfo: {"start":1016,"length":5} + >i < 1 + >:=> (line 29, col 64) to (line 29, col 69) +29 >for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1022 to 1029) SpanInfo: {"start":1023,"length":3} + >i++ + >:=> (line 29, col 71) to (line 29, col 74) +-------------------------------- +30 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1030 to 1061) SpanInfo: {"start":1034,"length":26} + >console.log(primarySkillA) + >:=> (line 30, col 4) to (line 30, col 30) +-------------------------------- +31 >} + + ~~ => Pos: (1062 to 1063) SpanInfo: {"start":1034,"length":26} + >console.log(primarySkillA) + >:=> (line 30, col 4) to (line 30, col 30) +-------------------------------- +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1064 to 1086) SpanInfo: {"start":1073,"length":13} + >primarySkillA + >:=> (line 32, col 9) to (line 32, col 22) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1087 to 1103) SpanInfo: {"start":1088,"length":15} + >secondarySkillA + >:=> (line 32, col 24) to (line 32, col 39) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (1104 to 1123) SpanInfo: {"start":1072,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 32, col 8) to (line 32, col 40) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1124 to 1130) SpanInfo: {"start":1125,"length":5} + >i = 0 + >:=> (line 32, col 61) to (line 32, col 66) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1131 to 1137) SpanInfo: {"start":1132,"length":5} + >i < 1 + >:=> (line 32, col 68) to (line 32, col 73) +32 >for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1138 to 1145) SpanInfo: {"start":1139,"length":3} + >i++ + >:=> (line 32, col 75) to (line 32, col 78) +-------------------------------- +33 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1146 to 1177) SpanInfo: {"start":1150,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +34 >} + + ~~ => Pos: (1178 to 1179) SpanInfo: {"start":1150,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1180 to 1202) SpanInfo: {"start":1189,"length":13} + >primarySkillA + >:=> (line 35, col 9) to (line 35, col 22) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1203 to 1219) SpanInfo: {"start":1204,"length":15} + >secondarySkillA + >:=> (line 35, col 24) to (line 35, col 39) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1220 to 1259) SpanInfo: {"start":1188,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 35, col 8) to (line 35, col 40) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1260 to 1266) SpanInfo: {"start":1261,"length":5} + >i = 0 + >:=> (line 35, col 81) to (line 35, col 86) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1267 to 1273) SpanInfo: {"start":1268,"length":5} + >i < 1 + >:=> (line 35, col 88) to (line 35, col 93) +35 >for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1274 to 1281) SpanInfo: {"start":1275,"length":3} + >i++ + >:=> (line 35, col 95) to (line 35, col 98) +-------------------------------- +36 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1282 to 1313) SpanInfo: {"start":1286,"length":26} + >console.log(primarySkillA) + >:=> (line 36, col 4) to (line 36, col 30) +-------------------------------- +37 >} + + ~~ => Pos: (1314 to 1315) SpanInfo: {"start":1286,"length":26} + >console.log(primarySkillA) + >:=> (line 36, col 4) to (line 36, col 30) +-------------------------------- +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1316 to 1339) SpanInfo: {"start":1322,"length":7} + >numberB + >:=> (line 38, col 6) to (line 38, col 13) +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1340 to 1346) SpanInfo: {"start":1341,"length":5} + >i = 0 + >:=> (line 38, col 25) to (line 38, col 30) +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1347 to 1353) SpanInfo: {"start":1348,"length":5} + >i < 1 + >:=> (line 38, col 32) to (line 38, col 37) +38 >for ([numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1354 to 1361) SpanInfo: {"start":1355,"length":3} + >i++ + >:=> (line 38, col 39) to (line 38, col 42) +-------------------------------- +39 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1362 to 1387) SpanInfo: {"start":1366,"length":20} + >console.log(numberB) + >:=> (line 39, col 4) to (line 39, col 24) +-------------------------------- +40 >} + + ~~ => Pos: (1388 to 1389) SpanInfo: {"start":1366,"length":20} + >console.log(numberB) + >:=> (line 39, col 4) to (line 39, col 24) +-------------------------------- +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1390 to 1417) SpanInfo: {"start":1396,"length":7} + >numberB + >:=> (line 41, col 6) to (line 41, col 13) +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1418 to 1424) SpanInfo: {"start":1419,"length":5} + >i = 0 + >:=> (line 41, col 29) to (line 41, col 34) +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1425 to 1431) SpanInfo: {"start":1426,"length":5} + >i < 1 + >:=> (line 41, col 36) to (line 41, col 41) +41 >for ([numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1432 to 1439) SpanInfo: {"start":1433,"length":3} + >i++ + >:=> (line 41, col 43) to (line 41, col 46) +-------------------------------- +42 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1440 to 1465) SpanInfo: {"start":1444,"length":20} + >console.log(numberB) + >:=> (line 42, col 4) to (line 42, col 24) +-------------------------------- +43 >} + + ~~ => Pos: (1466 to 1467) SpanInfo: {"start":1444,"length":20} + >console.log(numberB) + >:=> (line 42, col 4) to (line 42, col 24) +-------------------------------- +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1468 to 1511) SpanInfo: {"start":1474,"length":7} + >numberB + >:=> (line 44, col 6) to (line 44, col 13) +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1512 to 1518) SpanInfo: {"start":1513,"length":5} + >i = 0 + >:=> (line 44, col 45) to (line 44, col 50) +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1519 to 1525) SpanInfo: {"start":1520,"length":5} + >i < 1 + >:=> (line 44, col 52) to (line 44, col 57) +44 >for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1526 to 1533) SpanInfo: {"start":1527,"length":3} + >i++ + >:=> (line 44, col 59) to (line 44, col 62) +-------------------------------- +45 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1534 to 1559) SpanInfo: {"start":1538,"length":20} + >console.log(numberB) + >:=> (line 45, col 4) to (line 45, col 24) +-------------------------------- +46 >} + + ~~ => Pos: (1560 to 1561) SpanInfo: {"start":1538,"length":20} + >console.log(numberB) + >:=> (line 45, col 4) to (line 45, col 24) +-------------------------------- +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1562 to 1588) SpanInfo: {"start":1568,"length":5} + >nameB + >:=> (line 47, col 6) to (line 47, col 11) +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1589 to 1595) SpanInfo: {"start":1590,"length":5} + >i = 0 + >:=> (line 47, col 28) to (line 47, col 33) +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1596 to 1602) SpanInfo: {"start":1597,"length":5} + >i < 1 + >:=> (line 47, col 35) to (line 47, col 40) +47 >for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1603 to 1610) SpanInfo: {"start":1604,"length":3} + >i++ + >:=> (line 47, col 42) to (line 47, col 45) +-------------------------------- +48 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1611 to 1634) SpanInfo: {"start":1615,"length":18} + >console.log(nameB) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +49 >} + + ~~ => Pos: (1635 to 1636) SpanInfo: {"start":1615,"length":18} + >console.log(nameB) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1637 to 1667) SpanInfo: {"start":1643,"length":5} + >nameB + >:=> (line 50, col 6) to (line 50, col 11) +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1668 to 1674) SpanInfo: {"start":1669,"length":5} + >i = 0 + >:=> (line 50, col 32) to (line 50, col 37) +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1675 to 1681) SpanInfo: {"start":1676,"length":5} + >i < 1 + >:=> (line 50, col 39) to (line 50, col 44) +50 >for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1682 to 1689) SpanInfo: {"start":1683,"length":3} + >i++ + >:=> (line 50, col 46) to (line 50, col 49) +-------------------------------- +51 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1690 to 1713) SpanInfo: {"start":1694,"length":18} + >console.log(nameB) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +52 >} + + ~~ => Pos: (1714 to 1715) SpanInfo: {"start":1694,"length":18} + >console.log(nameB) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1716 to 1766) SpanInfo: {"start":1722,"length":5} + >nameB + >:=> (line 53, col 6) to (line 53, col 11) +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1767 to 1773) SpanInfo: {"start":1768,"length":5} + >i = 0 + >:=> (line 53, col 52) to (line 53, col 57) +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1774 to 1780) SpanInfo: {"start":1775,"length":5} + >i < 1 + >:=> (line 53, col 59) to (line 53, col 64) +53 >for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1781 to 1788) SpanInfo: {"start":1782,"length":3} + >i++ + >:=> (line 53, col 66) to (line 53, col 69) +-------------------------------- +54 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1789 to 1812) SpanInfo: {"start":1793,"length":18} + >console.log(nameB) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +55 >} + + ~~ => Pos: (1813 to 1814) SpanInfo: {"start":1793,"length":18} + >console.log(nameB) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (1815 to 1829) SpanInfo: {"start":1821,"length":8} + >numberA2 + >:=> (line 56, col 6) to (line 56, col 14) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1830 to 1837) SpanInfo: {"start":1831,"length":6} + >nameA2 + >:=> (line 56, col 16) to (line 56, col 22) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1838 to 1856) SpanInfo: {"start":1839,"length":7} + >skillA2 + >:=> (line 56, col 24) to (line 56, col 31) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1857 to 1863) SpanInfo: {"start":1858,"length":5} + >i = 0 + >:=> (line 56, col 43) to (line 56, col 48) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1864 to 1870) SpanInfo: {"start":1865,"length":5} + >i < 1 + >:=> (line 56, col 50) to (line 56, col 55) +56 >for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1871 to 1878) SpanInfo: {"start":1872,"length":3} + >i++ + >:=> (line 56, col 57) to (line 56, col 60) +-------------------------------- +57 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1879 to 1903) SpanInfo: {"start":1883,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +58 >} + + ~~ => Pos: (1904 to 1905) SpanInfo: {"start":1883,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (1906 to 1920) SpanInfo: {"start":1912,"length":8} + >numberA2 + >:=> (line 59, col 6) to (line 59, col 14) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1921 to 1928) SpanInfo: {"start":1922,"length":6} + >nameA2 + >:=> (line 59, col 16) to (line 59, col 22) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1929 to 1951) SpanInfo: {"start":1930,"length":7} + >skillA2 + >:=> (line 59, col 24) to (line 59, col 31) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1952 to 1958) SpanInfo: {"start":1953,"length":5} + >i = 0 + >:=> (line 59, col 47) to (line 59, col 52) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1959 to 1965) SpanInfo: {"start":1960,"length":5} + >i < 1 + >:=> (line 59, col 54) to (line 59, col 59) +59 >for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1966 to 1973) SpanInfo: {"start":1967,"length":3} + >i++ + >:=> (line 59, col 61) to (line 59, col 64) +-------------------------------- +60 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1974 to 1998) SpanInfo: {"start":1978,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +61 >} + + ~~ => Pos: (1999 to 2000) SpanInfo: {"start":1978,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2001 to 2015) SpanInfo: {"start":2007,"length":8} + >numberA2 + >:=> (line 62, col 6) to (line 62, col 14) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2016 to 2023) SpanInfo: {"start":2017,"length":6} + >nameA2 + >:=> (line 62, col 16) to (line 62, col 22) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2024 to 2062) SpanInfo: {"start":2025,"length":7} + >skillA2 + >:=> (line 62, col 24) to (line 62, col 31) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2063 to 2069) SpanInfo: {"start":2064,"length":5} + >i = 0 + >:=> (line 62, col 63) to (line 62, col 68) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2070 to 2076) SpanInfo: {"start":2071,"length":5} + >i < 1 + >:=> (line 62, col 70) to (line 62, col 75) +62 >for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2077 to 2084) SpanInfo: {"start":2078,"length":3} + >i++ + >:=> (line 62, col 77) to (line 62, col 80) +-------------------------------- +63 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2085 to 2109) SpanInfo: {"start":2089,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +64 >} + + ~~ => Pos: (2110 to 2111) SpanInfo: {"start":2089,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~ => Pos: (2112 to 2124) SpanInfo: {"start":2118,"length":6} + >nameMA + >:=> (line 65, col 6) to (line 65, col 12) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2125 to 2140) SpanInfo: {"start":2127,"length":13} + >primarySkillA + >:=> (line 65, col 15) to (line 65, col 28) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2141 to 2157) SpanInfo: {"start":2142,"length":15} + >secondarySkillA + >:=> (line 65, col 30) to (line 65, col 45) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (2158 to 2173) SpanInfo: {"start":2126,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 65, col 14) to (line 65, col 46) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2174 to 2180) SpanInfo: {"start":2175,"length":5} + >i = 0 + >:=> (line 65, col 63) to (line 65, col 68) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2181 to 2187) SpanInfo: {"start":2182,"length":5} + >i < 1 + >:=> (line 65, col 70) to (line 65, col 75) +65 >for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2188 to 2195) SpanInfo: {"start":2189,"length":3} + >i++ + >:=> (line 65, col 77) to (line 65, col 80) +-------------------------------- +66 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2196 to 2220) SpanInfo: {"start":2200,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +67 >} + + ~~ => Pos: (2221 to 2222) SpanInfo: {"start":2200,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~ => Pos: (2223 to 2235) SpanInfo: {"start":2229,"length":6} + >nameMA + >:=> (line 68, col 6) to (line 68, col 12) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2236 to 2251) SpanInfo: {"start":2238,"length":13} + >primarySkillA + >:=> (line 68, col 15) to (line 68, col 28) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2252 to 2268) SpanInfo: {"start":2253,"length":15} + >secondarySkillA + >:=> (line 68, col 30) to (line 68, col 45) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (2269 to 2288) SpanInfo: {"start":2237,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 68, col 14) to (line 68, col 46) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2289 to 2295) SpanInfo: {"start":2290,"length":5} + >i = 0 + >:=> (line 68, col 67) to (line 68, col 72) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2296 to 2302) SpanInfo: {"start":2297,"length":5} + >i < 1 + >:=> (line 68, col 74) to (line 68, col 79) +68 >for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2303 to 2310) SpanInfo: {"start":2304,"length":3} + >i++ + >:=> (line 68, col 81) to (line 68, col 84) +-------------------------------- +69 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2311 to 2335) SpanInfo: {"start":2315,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +70 >} + + ~~ => Pos: (2336 to 2337) SpanInfo: {"start":2315,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~ => Pos: (2338 to 2350) SpanInfo: {"start":2344,"length":6} + >nameMA + >:=> (line 71, col 6) to (line 71, col 12) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2351 to 2366) SpanInfo: {"start":2353,"length":13} + >primarySkillA + >:=> (line 71, col 15) to (line 71, col 28) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2367 to 2383) SpanInfo: {"start":2368,"length":15} + >secondarySkillA + >:=> (line 71, col 30) to (line 71, col 45) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2384 to 2423) SpanInfo: {"start":2352,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 71, col 14) to (line 71, col 46) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2424 to 2430) SpanInfo: {"start":2425,"length":5} + >i = 0 + >:=> (line 71, col 87) to (line 71, col 92) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2431 to 2437) SpanInfo: {"start":2432,"length":5} + >i < 1 + >:=> (line 71, col 94) to (line 71, col 99) +71 >for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2438 to 2445) SpanInfo: {"start":2439,"length":3} + >i++ + >:=> (line 71, col 101) to (line 71, col 104) +-------------------------------- +72 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2446 to 2470) SpanInfo: {"start":2450,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +73 >} + + ~~ => Pos: (2471 to 2472) SpanInfo: {"start":2450,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2473 to 2487) SpanInfo: {"start":2479,"length":8} + >numberA3 + >:=> (line 74, col 6) to (line 74, col 14) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2488 to 2512) SpanInfo: {"start":2489,"length":13} + >...robotAInfo + >:=> (line 74, col 16) to (line 74, col 29) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2513 to 2519) SpanInfo: {"start":2514,"length":5} + >i = 0 + >:=> (line 74, col 41) to (line 74, col 46) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2520 to 2526) SpanInfo: {"start":2521,"length":5} + >i < 1 + >:=> (line 74, col 48) to (line 74, col 53) +74 >for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2527 to 2534) SpanInfo: {"start":2528,"length":3} + >i++ + >:=> (line 74, col 55) to (line 74, col 58) +-------------------------------- +75 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2535 to 2561) SpanInfo: {"start":2539,"length":21} + >console.log(numberA3) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +76 >} + + ~~ => Pos: (2562 to 2563) SpanInfo: {"start":2539,"length":21} + >console.log(numberA3) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2564 to 2578) SpanInfo: {"start":2570,"length":8} + >numberA3 + >:=> (line 77, col 6) to (line 77, col 14) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2579 to 2607) SpanInfo: {"start":2580,"length":13} + >...robotAInfo + >:=> (line 77, col 16) to (line 77, col 29) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2608 to 2614) SpanInfo: {"start":2609,"length":5} + >i = 0 + >:=> (line 77, col 45) to (line 77, col 50) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2615 to 2621) SpanInfo: {"start":2616,"length":5} + >i < 1 + >:=> (line 77, col 52) to (line 77, col 57) +77 >for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2622 to 2629) SpanInfo: {"start":2623,"length":3} + >i++ + >:=> (line 77, col 59) to (line 77, col 62) +-------------------------------- +78 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2630 to 2656) SpanInfo: {"start":2634,"length":21} + >console.log(numberA3) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +79 >} + + ~~ => Pos: (2657 to 2658) SpanInfo: {"start":2634,"length":21} + >console.log(numberA3) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2659 to 2673) SpanInfo: {"start":2665,"length":8} + >numberA3 + >:=> (line 80, col 6) to (line 80, col 14) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2674 to 2725) SpanInfo: {"start":2675,"length":13} + >...robotAInfo + >:=> (line 80, col 16) to (line 80, col 29) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2726 to 2732) SpanInfo: {"start":2727,"length":5} + >i = 0 + >:=> (line 80, col 68) to (line 80, col 73) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2733 to 2739) SpanInfo: {"start":2734,"length":5} + >i < 1 + >:=> (line 80, col 75) to (line 80, col 80) +80 >for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2740 to 2747) SpanInfo: {"start":2741,"length":3} + >i++ + >:=> (line 80, col 82) to (line 80, col 85) +-------------------------------- +81 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2748 to 2774) SpanInfo: {"start":2752,"length":21} + >console.log(numberA3) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +82 >} + + ~~ => Pos: (2775 to 2776) SpanInfo: {"start":2752,"length":21} + >console.log(numberA3) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2777 to 2816) SpanInfo: {"start":2783,"length":18} + >...multiRobotAInfo + >:=> (line 83, col 6) to (line 83, col 24) +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2817 to 2823) SpanInfo: {"start":2818,"length":5} + >i = 0 + >:=> (line 83, col 41) to (line 83, col 46) +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2824 to 2830) SpanInfo: {"start":2825,"length":5} + >i < 1 + >:=> (line 83, col 48) to (line 83, col 53) +83 >for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2831 to 2838) SpanInfo: {"start":2832,"length":3} + >i++ + >:=> (line 83, col 55) to (line 83, col 58) +-------------------------------- +84 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2839 to 2872) SpanInfo: {"start":2843,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 84, col 4) to (line 84, col 32) +-------------------------------- +85 >} + + ~~ => Pos: (2873 to 2874) SpanInfo: {"start":2843,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 84, col 4) to (line 84, col 32) +-------------------------------- +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2875 to 2918) SpanInfo: {"start":2881,"length":18} + >...multiRobotAInfo + >:=> (line 86, col 6) to (line 86, col 24) +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2919 to 2925) SpanInfo: {"start":2920,"length":5} + >i = 0 + >:=> (line 86, col 45) to (line 86, col 50) +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2926 to 2932) SpanInfo: {"start":2927,"length":5} + >i < 1 + >:=> (line 86, col 52) to (line 86, col 57) +86 >for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2933 to 2940) SpanInfo: {"start":2934,"length":3} + >i++ + >:=> (line 86, col 59) to (line 86, col 62) +-------------------------------- +87 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2941 to 2974) SpanInfo: {"start":2945,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 87, col 4) to (line 87, col 32) +-------------------------------- +88 >} + + ~~ => Pos: (2975 to 2976) SpanInfo: {"start":2945,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 87, col 4) to (line 87, col 32) +-------------------------------- +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2977 to 3059) SpanInfo: {"start":2983,"length":18} + >...multiRobotAInfo + >:=> (line 89, col 6) to (line 89, col 24) +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3060 to 3066) SpanInfo: {"start":3061,"length":5} + >i = 0 + >:=> (line 89, col 84) to (line 89, col 89) +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3067 to 3073) SpanInfo: {"start":3068,"length":5} + >i < 1 + >:=> (line 89, col 91) to (line 89, col 96) +89 >for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3074 to 3081) SpanInfo: {"start":3075,"length":3} + >i++ + >:=> (line 89, col 98) to (line 89, col 101) +-------------------------------- +90 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3082 to 3115) SpanInfo: {"start":3086,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 90, col 4) to (line 90, col 32) +-------------------------------- +91 >} + ~ => Pos: (3116 to 3116) SpanInfo: {"start":3086,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 90, col 4) to (line 90, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..56894ce9a9a --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,1008 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (186 to 207) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +8 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (208 to 226) SpanInfo: {"start":212,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +9 >} + + ~~ => Pos: (227 to 228) SpanInfo: {"start":227,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +-------------------------------- +10 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (229 to 292) SpanInfo: {"start":229,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 10, col 0) to (line 10, col 62) +-------------------------------- +11 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (293 to 366) SpanInfo: {"start":293,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 11, col 0) to (line 11, col 72) +-------------------------------- +12 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (367 to 393) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +13 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (394 to 417) SpanInfo: {"start":398,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +14 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (420 to 486) SpanInfo: undefined +-------------------------------- +16 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (487 to 522) SpanInfo: undefined +-------------------------------- +17 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (523 to 593) SpanInfo: undefined +-------------------------------- +18 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (594 to 696) SpanInfo: undefined +-------------------------------- +19 >let i: number; + + ~~~~~~~~~~~~~~~ => Pos: (697 to 711) SpanInfo: undefined +-------------------------------- +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (712 to 744) SpanInfo: {"start":720,"length":14} + >nameA = "name" + >:=> (line 20, col 8) to (line 20, col 22) +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (745 to 751) SpanInfo: {"start":746,"length":5} + >i = 0 + >:=> (line 20, col 34) to (line 20, col 39) +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (752 to 758) SpanInfo: {"start":753,"length":5} + >i < 1 + >:=> (line 20, col 41) to (line 20, col 46) +20 >for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (759 to 766) SpanInfo: {"start":760,"length":3} + >i++ + >:=> (line 20, col 48) to (line 20, col 51) +-------------------------------- +21 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (767 to 790) SpanInfo: {"start":771,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +22 >} + + ~~ => Pos: (791 to 792) SpanInfo: {"start":771,"length":18} + >console.log(nameA) + >:=> (line 21, col 4) to (line 21, col 22) +-------------------------------- +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (793 to 829) SpanInfo: {"start":801,"length":14} + >nameA = "name" + >:=> (line 23, col 8) to (line 23, col 22) +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (830 to 836) SpanInfo: {"start":831,"length":5} + >i = 0 + >:=> (line 23, col 38) to (line 23, col 43) +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (837 to 843) SpanInfo: {"start":838,"length":5} + >i < 1 + >:=> (line 23, col 45) to (line 23, col 50) +23 >for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (844 to 851) SpanInfo: {"start":845,"length":3} + >i++ + >:=> (line 23, col 52) to (line 23, col 55) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (852 to 875) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (876 to 877) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (878 to 930) SpanInfo: {"start":886,"length":14} + >nameA = "name" + >:=> (line 26, col 8) to (line 26, col 22) +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (931 to 937) SpanInfo: {"start":932,"length":5} + >i = 0 + >:=> (line 26, col 54) to (line 26, col 59) +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (938 to 944) SpanInfo: {"start":939,"length":5} + >i < 1 + >:=> (line 26, col 61) to (line 26, col 66) +26 >for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (945 to 952) SpanInfo: {"start":946,"length":3} + >i++ + >:=> (line 26, col 68) to (line 26, col 71) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (953 to 976) SpanInfo: {"start":957,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (977 to 978) SpanInfo: {"start":957,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ([, [ + + ~~~~~~~~~~ => Pos: (979 to 988) SpanInfo: {"start":993,"length":25} + >primarySkillA = "primary" + >:=> (line 30, col 4) to (line 30, col 29) +-------------------------------- +30 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (989 to 1019) SpanInfo: {"start":993,"length":25} + >primarySkillA = "primary" + >:=> (line 30, col 4) to (line 30, col 29) +-------------------------------- +31 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1020 to 1053) SpanInfo: {"start":1024,"length":29} + >secondarySkillA = "secondary" + >:=> (line 31, col 4) to (line 31, col 33) +-------------------------------- +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1054 to 1073) SpanInfo: {"start":1024,"length":29} + >secondarySkillA = "secondary" + >:=> (line 31, col 4) to (line 31, col 33) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (1074 to 1089) SpanInfo: {"start":987,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 29, col 8) to (line 32, col 20) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1090 to 1096) SpanInfo: {"start":1091,"length":5} + >i = 0 + >:=> (line 32, col 37) to (line 32, col 42) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1097 to 1103) SpanInfo: {"start":1098,"length":5} + >i < 1 + >:=> (line 32, col 44) to (line 32, col 49) +32 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1104 to 1111) SpanInfo: {"start":1105,"length":3} + >i++ + >:=> (line 32, col 51) to (line 32, col 54) +-------------------------------- +33 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1112 to 1143) SpanInfo: {"start":1116,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +34 >} + + ~~ => Pos: (1144 to 1145) SpanInfo: {"start":1116,"length":26} + >console.log(primarySkillA) + >:=> (line 33, col 4) to (line 33, col 30) +-------------------------------- +35 >for ([, [ + + ~~~~~~~~~~ => Pos: (1146 to 1155) SpanInfo: {"start":1160,"length":25} + >primarySkillA = "primary" + >:=> (line 36, col 4) to (line 36, col 29) +-------------------------------- +36 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1156 to 1186) SpanInfo: {"start":1160,"length":25} + >primarySkillA = "primary" + >:=> (line 36, col 4) to (line 36, col 29) +-------------------------------- +37 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1187 to 1220) SpanInfo: {"start":1191,"length":29} + >secondarySkillA = "secondary" + >:=> (line 37, col 4) to (line 37, col 33) +-------------------------------- +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1221 to 1240) SpanInfo: {"start":1191,"length":29} + >secondarySkillA = "secondary" + >:=> (line 37, col 4) to (line 37, col 33) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1241 to 1260) SpanInfo: {"start":1154,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 35, col 8) to (line 38, col 20) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1261 to 1267) SpanInfo: {"start":1262,"length":5} + >i = 0 + >:=> (line 38, col 41) to (line 38, col 46) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1268 to 1274) SpanInfo: {"start":1269,"length":5} + >i < 1 + >:=> (line 38, col 48) to (line 38, col 53) +38 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1275 to 1282) SpanInfo: {"start":1276,"length":3} + >i++ + >:=> (line 38, col 55) to (line 38, col 58) +-------------------------------- +39 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1283 to 1314) SpanInfo: {"start":1287,"length":26} + >console.log(primarySkillA) + >:=> (line 39, col 4) to (line 39, col 30) +-------------------------------- +40 >} + + ~~ => Pos: (1315 to 1316) SpanInfo: {"start":1287,"length":26} + >console.log(primarySkillA) + >:=> (line 39, col 4) to (line 39, col 30) +-------------------------------- +41 >for ([, [ + + ~~~~~~~~~~ => Pos: (1317 to 1326) SpanInfo: {"start":1331,"length":25} + >primarySkillA = "primary" + >:=> (line 42, col 4) to (line 42, col 29) +-------------------------------- +42 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1327 to 1357) SpanInfo: {"start":1331,"length":25} + >primarySkillA = "primary" + >:=> (line 42, col 4) to (line 42, col 29) +-------------------------------- +43 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1358 to 1391) SpanInfo: {"start":1362,"length":29} + >secondarySkillA = "secondary" + >:=> (line 43, col 4) to (line 43, col 33) +-------------------------------- +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1392 to 1411) SpanInfo: {"start":1362,"length":29} + >secondarySkillA = "secondary" + >:=> (line 43, col 4) to (line 43, col 33) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1412 to 1451) SpanInfo: {"start":1325,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 41, col 8) to (line 44, col 20) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1452 to 1458) SpanInfo: {"start":1453,"length":5} + >i = 0 + >:=> (line 44, col 61) to (line 44, col 66) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1459 to 1465) SpanInfo: {"start":1460,"length":5} + >i < 1 + >:=> (line 44, col 68) to (line 44, col 73) +44 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1466 to 1473) SpanInfo: {"start":1467,"length":3} + >i++ + >:=> (line 44, col 75) to (line 44, col 78) +-------------------------------- +45 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1474 to 1505) SpanInfo: {"start":1478,"length":26} + >console.log(primarySkillA) + >:=> (line 45, col 4) to (line 45, col 30) +-------------------------------- +46 >} + + ~~ => Pos: (1506 to 1507) SpanInfo: {"start":1478,"length":26} + >console.log(primarySkillA) + >:=> (line 45, col 4) to (line 45, col 30) +-------------------------------- +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1508 to 1536) SpanInfo: {"start":1514,"length":12} + >numberB = -1 + >:=> (line 47, col 6) to (line 47, col 18) +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1537 to 1543) SpanInfo: {"start":1538,"length":5} + >i = 0 + >:=> (line 47, col 30) to (line 47, col 35) +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1544 to 1550) SpanInfo: {"start":1545,"length":5} + >i < 1 + >:=> (line 47, col 37) to (line 47, col 42) +47 >for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1551 to 1558) SpanInfo: {"start":1552,"length":3} + >i++ + >:=> (line 47, col 44) to (line 47, col 47) +-------------------------------- +48 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1559 to 1584) SpanInfo: {"start":1563,"length":20} + >console.log(numberB) + >:=> (line 48, col 4) to (line 48, col 24) +-------------------------------- +49 >} + + ~~ => Pos: (1585 to 1586) SpanInfo: {"start":1563,"length":20} + >console.log(numberB) + >:=> (line 48, col 4) to (line 48, col 24) +-------------------------------- +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1587 to 1619) SpanInfo: {"start":1593,"length":12} + >numberB = -1 + >:=> (line 50, col 6) to (line 50, col 18) +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1620 to 1626) SpanInfo: {"start":1621,"length":5} + >i = 0 + >:=> (line 50, col 34) to (line 50, col 39) +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1627 to 1633) SpanInfo: {"start":1628,"length":5} + >i < 1 + >:=> (line 50, col 41) to (line 50, col 46) +50 >for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1634 to 1641) SpanInfo: {"start":1635,"length":3} + >i++ + >:=> (line 50, col 48) to (line 50, col 51) +-------------------------------- +51 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1642 to 1667) SpanInfo: {"start":1646,"length":20} + >console.log(numberB) + >:=> (line 51, col 4) to (line 51, col 24) +-------------------------------- +52 >} + + ~~ => Pos: (1668 to 1669) SpanInfo: {"start":1646,"length":20} + >console.log(numberB) + >:=> (line 51, col 4) to (line 51, col 24) +-------------------------------- +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1670 to 1718) SpanInfo: {"start":1676,"length":12} + >numberB = -1 + >:=> (line 53, col 6) to (line 53, col 18) +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1719 to 1725) SpanInfo: {"start":1720,"length":5} + >i = 0 + >:=> (line 53, col 50) to (line 53, col 55) +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1726 to 1732) SpanInfo: {"start":1727,"length":5} + >i < 1 + >:=> (line 53, col 57) to (line 53, col 62) +53 >for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1733 to 1740) SpanInfo: {"start":1734,"length":3} + >i++ + >:=> (line 53, col 64) to (line 53, col 67) +-------------------------------- +54 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1741 to 1766) SpanInfo: {"start":1745,"length":20} + >console.log(numberB) + >:=> (line 54, col 4) to (line 54, col 24) +-------------------------------- +55 >} + + ~~ => Pos: (1767 to 1768) SpanInfo: {"start":1745,"length":20} + >console.log(numberB) + >:=> (line 54, col 4) to (line 54, col 24) +-------------------------------- +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1769 to 1804) SpanInfo: {"start":1775,"length":14} + >nameB = "name" + >:=> (line 56, col 6) to (line 56, col 20) +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1805 to 1811) SpanInfo: {"start":1806,"length":5} + >i = 0 + >:=> (line 56, col 37) to (line 56, col 42) +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1812 to 1818) SpanInfo: {"start":1813,"length":5} + >i < 1 + >:=> (line 56, col 44) to (line 56, col 49) +56 >for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1819 to 1826) SpanInfo: {"start":1820,"length":3} + >i++ + >:=> (line 56, col 51) to (line 56, col 54) +-------------------------------- +57 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1827 to 1850) SpanInfo: {"start":1831,"length":18} + >console.log(nameB) + >:=> (line 57, col 4) to (line 57, col 22) +-------------------------------- +58 >} + + ~~ => Pos: (1851 to 1852) SpanInfo: {"start":1831,"length":18} + >console.log(nameB) + >:=> (line 57, col 4) to (line 57, col 22) +-------------------------------- +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1853 to 1892) SpanInfo: {"start":1859,"length":14} + >nameB = "name" + >:=> (line 59, col 6) to (line 59, col 20) +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1893 to 1899) SpanInfo: {"start":1894,"length":5} + >i = 0 + >:=> (line 59, col 41) to (line 59, col 46) +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1900 to 1906) SpanInfo: {"start":1901,"length":5} + >i < 1 + >:=> (line 59, col 48) to (line 59, col 53) +59 >for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1907 to 1914) SpanInfo: {"start":1908,"length":3} + >i++ + >:=> (line 59, col 55) to (line 59, col 58) +-------------------------------- +60 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1915 to 1938) SpanInfo: {"start":1919,"length":18} + >console.log(nameB) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +61 >} + + ~~ => Pos: (1939 to 1940) SpanInfo: {"start":1919,"length":18} + >console.log(nameB) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1941 to 2000) SpanInfo: {"start":1947,"length":14} + >nameB = "name" + >:=> (line 62, col 6) to (line 62, col 20) +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2001 to 2007) SpanInfo: {"start":2002,"length":5} + >i = 0 + >:=> (line 62, col 61) to (line 62, col 66) +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2008 to 2014) SpanInfo: {"start":2009,"length":5} + >i < 1 + >:=> (line 62, col 68) to (line 62, col 73) +62 >for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2015 to 2022) SpanInfo: {"start":2016,"length":3} + >i++ + >:=> (line 62, col 75) to (line 62, col 78) +-------------------------------- +63 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2023 to 2046) SpanInfo: {"start":2027,"length":18} + >console.log(nameB) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +64 >} + + ~~ => Pos: (2047 to 2048) SpanInfo: {"start":2027,"length":18} + >console.log(nameB) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2049 to 2068) SpanInfo: {"start":2055,"length":13} + >numberA2 = -1 + >:=> (line 65, col 6) to (line 65, col 19) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2069 to 2085) SpanInfo: {"start":2070,"length":15} + >nameA2 = "name" + >:=> (line 65, col 21) to (line 65, col 36) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2086 to 2114) SpanInfo: {"start":2087,"length":17} + >skillA2 = "skill" + >:=> (line 65, col 38) to (line 65, col 55) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2115 to 2121) SpanInfo: {"start":2116,"length":5} + >i = 0 + >:=> (line 65, col 67) to (line 65, col 72) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2122 to 2128) SpanInfo: {"start":2123,"length":5} + >i < 1 + >:=> (line 65, col 74) to (line 65, col 79) +65 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2129 to 2136) SpanInfo: {"start":2130,"length":3} + >i++ + >:=> (line 65, col 81) to (line 65, col 84) +-------------------------------- +66 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2137 to 2161) SpanInfo: {"start":2141,"length":19} + >console.log(nameA2) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +67 >} + + ~~ => Pos: (2162 to 2163) SpanInfo: {"start":2141,"length":19} + >console.log(nameA2) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2164 to 2183) SpanInfo: {"start":2170,"length":13} + >numberA2 = -1 + >:=> (line 68, col 6) to (line 68, col 19) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2184 to 2200) SpanInfo: {"start":2185,"length":15} + >nameA2 = "name" + >:=> (line 68, col 21) to (line 68, col 36) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2201 to 2233) SpanInfo: {"start":2202,"length":17} + >skillA2 = "skill" + >:=> (line 68, col 38) to (line 68, col 55) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2234 to 2240) SpanInfo: {"start":2235,"length":5} + >i = 0 + >:=> (line 68, col 71) to (line 68, col 76) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2241 to 2247) SpanInfo: {"start":2242,"length":5} + >i < 1 + >:=> (line 68, col 78) to (line 68, col 83) +68 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2248 to 2255) SpanInfo: {"start":2249,"length":3} + >i++ + >:=> (line 68, col 85) to (line 68, col 88) +-------------------------------- +69 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2256 to 2280) SpanInfo: {"start":2260,"length":19} + >console.log(nameA2) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +70 >} + + ~~ => Pos: (2281 to 2282) SpanInfo: {"start":2260,"length":19} + >console.log(nameA2) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2283 to 2302) SpanInfo: {"start":2289,"length":13} + >numberA2 = -1 + >:=> (line 71, col 6) to (line 71, col 19) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2303 to 2319) SpanInfo: {"start":2304,"length":15} + >nameA2 = "name" + >:=> (line 71, col 21) to (line 71, col 36) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2320 to 2368) SpanInfo: {"start":2321,"length":17} + >skillA2 = "skill" + >:=> (line 71, col 38) to (line 71, col 55) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2369 to 2375) SpanInfo: {"start":2370,"length":5} + >i = 0 + >:=> (line 71, col 87) to (line 71, col 92) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2376 to 2382) SpanInfo: {"start":2377,"length":5} + >i < 1 + >:=> (line 71, col 94) to (line 71, col 99) +71 >for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2383 to 2390) SpanInfo: {"start":2384,"length":3} + >i++ + >:=> (line 71, col 101) to (line 71, col 104) +-------------------------------- +72 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2391 to 2415) SpanInfo: {"start":2395,"length":19} + >console.log(nameA2) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +73 >} + + ~~ => Pos: (2416 to 2417) SpanInfo: {"start":2395,"length":19} + >console.log(nameA2) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +74 >for ([nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2418 to 2442) SpanInfo: {"start":2424,"length":17} + >nameMA = "noName" + >:=> (line 74, col 6) to (line 74, col 23) +-------------------------------- +75 > [ + + ~~~~~~~~~~ => Pos: (2443 to 2452) SpanInfo: {"start":2465,"length":25} + >primarySkillA = "primary" + >:=> (line 76, col 12) to (line 76, col 37) +-------------------------------- +76 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2453 to 2491) SpanInfo: {"start":2465,"length":25} + >primarySkillA = "primary" + >:=> (line 76, col 12) to (line 76, col 37) +-------------------------------- +77 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2492 to 2533) SpanInfo: {"start":2504,"length":29} + >secondarySkillA = "secondary" + >:=> (line 77, col 12) to (line 77, col 41) +-------------------------------- +78 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2534 to 2562) SpanInfo: {"start":2504,"length":29} + >secondarySkillA = "secondary" + >:=> (line 77, col 12) to (line 77, col 41) +-------------------------------- +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2563 to 2582) SpanInfo: {"start":2451,"length":111} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 75, col 8) to (line 78, col 28) +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2583 to 2589) SpanInfo: {"start":2584,"length":5} + >i = 0 + >:=> (line 79, col 21) to (line 79, col 26) +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2590 to 2596) SpanInfo: {"start":2591,"length":5} + >i < 1 + >:=> (line 79, col 28) to (line 79, col 33) +79 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2597 to 2604) SpanInfo: {"start":2598,"length":3} + >i++ + >:=> (line 79, col 35) to (line 79, col 38) +-------------------------------- +80 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2605 to 2629) SpanInfo: {"start":2609,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +81 >} + + ~~ => Pos: (2630 to 2631) SpanInfo: {"start":2609,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +82 >for ([nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2632 to 2656) SpanInfo: {"start":2638,"length":17} + >nameMA = "noName" + >:=> (line 82, col 6) to (line 82, col 23) +-------------------------------- +83 > [ + + ~~~~~~ => Pos: (2657 to 2662) SpanInfo: {"start":2671,"length":25} + >primarySkillA = "primary" + >:=> (line 84, col 8) to (line 84, col 33) +-------------------------------- +84 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2663 to 2697) SpanInfo: {"start":2671,"length":25} + >primarySkillA = "primary" + >:=> (line 84, col 8) to (line 84, col 33) +-------------------------------- +85 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2698 to 2735) SpanInfo: {"start":2706,"length":29} + >secondarySkillA = "secondary" + >:=> (line 85, col 8) to (line 85, col 37) +-------------------------------- +86 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2736 to 2760) SpanInfo: {"start":2706,"length":29} + >secondarySkillA = "secondary" + >:=> (line 85, col 8) to (line 85, col 37) +-------------------------------- +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2761 to 2780) SpanInfo: {"start":2661,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 83, col 4) to (line 86, col 24) +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2781 to 2787) SpanInfo: {"start":2782,"length":5} + >i = 0 + >:=> (line 87, col 21) to (line 87, col 26) +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2788 to 2794) SpanInfo: {"start":2789,"length":5} + >i < 1 + >:=> (line 87, col 28) to (line 87, col 33) +87 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2795 to 2802) SpanInfo: {"start":2796,"length":3} + >i++ + >:=> (line 87, col 35) to (line 87, col 38) +-------------------------------- +88 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2803 to 2827) SpanInfo: {"start":2807,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +89 >} + + ~~ => Pos: (2828 to 2829) SpanInfo: {"start":2807,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +90 >for ([nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2830 to 2854) SpanInfo: {"start":2836,"length":17} + >nameMA = "noName" + >:=> (line 90, col 6) to (line 90, col 23) +-------------------------------- +91 > [ + + ~~~~~~ => Pos: (2855 to 2860) SpanInfo: {"start":2869,"length":25} + >primarySkillA = "primary" + >:=> (line 92, col 8) to (line 92, col 33) +-------------------------------- +92 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2861 to 2895) SpanInfo: {"start":2869,"length":25} + >primarySkillA = "primary" + >:=> (line 92, col 8) to (line 92, col 33) +-------------------------------- +93 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2896 to 2933) SpanInfo: {"start":2904,"length":29} + >secondarySkillA = "secondary" + >:=> (line 93, col 8) to (line 93, col 37) +-------------------------------- +94 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2934 to 2958) SpanInfo: {"start":2904,"length":29} + >secondarySkillA = "secondary" + >:=> (line 93, col 8) to (line 93, col 37) +-------------------------------- +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2959 to 2998) SpanInfo: {"start":2859,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 91, col 4) to (line 94, col 24) +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2999 to 3005) SpanInfo: {"start":3000,"length":5} + >i = 0 + >:=> (line 95, col 41) to (line 95, col 46) +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3006 to 3012) SpanInfo: {"start":3007,"length":5} + >i < 1 + >:=> (line 95, col 48) to (line 95, col 53) +95 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3013 to 3020) SpanInfo: {"start":3014,"length":3} + >i++ + >:=> (line 95, col 55) to (line 95, col 58) +-------------------------------- +96 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3021 to 3045) SpanInfo: {"start":3025,"length":19} + >console.log(nameMA) + >:=> (line 96, col 4) to (line 96, col 23) +-------------------------------- +97 >} + + ~~ => Pos: (3046 to 3047) SpanInfo: {"start":3025,"length":19} + >console.log(nameMA) + >:=> (line 96, col 4) to (line 96, col 23) +-------------------------------- +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3048 to 3067) SpanInfo: {"start":3054,"length":13} + >numberA3 = -1 + >:=> (line 98, col 6) to (line 98, col 19) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3068 to 3092) SpanInfo: {"start":3069,"length":13} + >...robotAInfo + >:=> (line 98, col 21) to (line 98, col 34) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3093 to 3099) SpanInfo: {"start":3094,"length":5} + >i = 0 + >:=> (line 98, col 46) to (line 98, col 51) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3100 to 3106) SpanInfo: {"start":3101,"length":5} + >i < 1 + >:=> (line 98, col 53) to (line 98, col 58) +98 >for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3107 to 3114) SpanInfo: {"start":3108,"length":3} + >i++ + >:=> (line 98, col 60) to (line 98, col 63) +-------------------------------- +99 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3115 to 3141) SpanInfo: {"start":3119,"length":21} + >console.log(numberA3) + >:=> (line 99, col 4) to (line 99, col 25) +-------------------------------- +100>} + + ~~ => Pos: (3142 to 3143) SpanInfo: {"start":3119,"length":21} + >console.log(numberA3) + >:=> (line 99, col 4) to (line 99, col 25) +-------------------------------- +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3144 to 3163) SpanInfo: {"start":3150,"length":13} + >numberA3 = -1 + >:=> (line 101, col 6) to (line 101, col 19) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3164 to 3192) SpanInfo: {"start":3165,"length":13} + >...robotAInfo + >:=> (line 101, col 21) to (line 101, col 34) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3193 to 3199) SpanInfo: {"start":3194,"length":5} + >i = 0 + >:=> (line 101, col 50) to (line 101, col 55) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3200 to 3206) SpanInfo: {"start":3201,"length":5} + >i < 1 + >:=> (line 101, col 57) to (line 101, col 62) +101>for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3207 to 3214) SpanInfo: {"start":3208,"length":3} + >i++ + >:=> (line 101, col 64) to (line 101, col 67) +-------------------------------- +102> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3215 to 3241) SpanInfo: {"start":3219,"length":21} + >console.log(numberA3) + >:=> (line 102, col 4) to (line 102, col 25) +-------------------------------- +103>} + + ~~ => Pos: (3242 to 3243) SpanInfo: {"start":3219,"length":21} + >console.log(numberA3) + >:=> (line 102, col 4) to (line 102, col 25) +-------------------------------- +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3244 to 3263) SpanInfo: {"start":3250,"length":13} + >numberA3 = -1 + >:=> (line 104, col 6) to (line 104, col 19) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3264 to 3315) SpanInfo: {"start":3265,"length":13} + >...robotAInfo + >:=> (line 104, col 21) to (line 104, col 34) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3316 to 3322) SpanInfo: {"start":3317,"length":5} + >i = 0 + >:=> (line 104, col 73) to (line 104, col 78) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3323 to 3329) SpanInfo: {"start":3324,"length":5} + >i < 1 + >:=> (line 104, col 80) to (line 104, col 85) +104>for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3330 to 3337) SpanInfo: {"start":3331,"length":3} + >i++ + >:=> (line 104, col 87) to (line 104, col 90) +-------------------------------- +105> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3338 to 3364) SpanInfo: {"start":3342,"length":21} + >console.log(numberA3) + >:=> (line 105, col 4) to (line 105, col 25) +-------------------------------- +106>} + ~ => Pos: (3365 to 3365) SpanInfo: {"start":3342,"length":21} + >console.log(numberA3) + >:=> (line 105, col 4) to (line 105, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPattern.baseline new file mode 100644 index 00000000000..c318d875ddf --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPattern.baseline @@ -0,0 +1,1171 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 277) SpanInfo: {"start":223,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (278 to 375) SpanInfo: {"start":278,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (376 to 397) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (398 to 415) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (416 to 417) SpanInfo: {"start":416,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (418 to 444) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (445 to 467) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (468 to 469) SpanInfo: {"start":468,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (470 to 553) SpanInfo: undefined +-------------------------------- +24 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (554 to 622) SpanInfo: undefined +-------------------------------- +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (623 to 651) SpanInfo: {"start":630,"length":11} + >name: nameA + >:=> (line 25, col 7) to (line 25, col 18) +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (652 to 658) SpanInfo: {"start":653,"length":5} + >i = 0 + >:=> (line 25, col 30) to (line 25, col 35) +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (659 to 665) SpanInfo: {"start":660,"length":5} + >i < 1 + >:=> (line 25, col 37) to (line 25, col 42) +25 >for ({ name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (666 to 673) SpanInfo: {"start":667,"length":3} + >i++ + >:=> (line 25, col 44) to (line 25, col 47) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (674 to 697) SpanInfo: {"start":678,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (698 to 699) SpanInfo: {"start":678,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (700 to 733) SpanInfo: {"start":707,"length":11} + >name: nameA + >:=> (line 28, col 7) to (line 28, col 18) +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (734 to 740) SpanInfo: {"start":735,"length":5} + >i = 0 + >:=> (line 28, col 35) to (line 28, col 40) +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (741 to 747) SpanInfo: {"start":742,"length":5} + >i < 1 + >:=> (line 28, col 42) to (line 28, col 47) +28 >for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (748 to 755) SpanInfo: {"start":749,"length":3} + >i++ + >:=> (line 28, col 49) to (line 28, col 52) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (756 to 779) SpanInfo: {"start":760,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (780 to 781) SpanInfo: {"start":760,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (782 to 850) SpanInfo: {"start":789,"length":11} + >name: nameA + >:=> (line 31, col 7) to (line 31, col 18) +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (851 to 857) SpanInfo: {"start":852,"length":5} + >i = 0 + >:=> (line 31, col 70) to (line 31, col 75) +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (858 to 864) SpanInfo: {"start":859,"length":5} + >i < 1 + >:=> (line 31, col 77) to (line 31, col 82) +31 >for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (865 to 872) SpanInfo: {"start":866,"length":3} + >i++ + >:=> (line 31, col 84) to (line 31, col 87) +-------------------------------- +32 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (873 to 896) SpanInfo: {"start":877,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +33 >} + + ~~ => Pos: (897 to 898) SpanInfo: {"start":877,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (899 to 912) SpanInfo: {"start":906,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 34, col 7) to (line 34, col 59) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (913 to 933) SpanInfo: {"start":916,"length":17} + >primary: primaryA + >:=> (line 34, col 17) to (line 34, col 34) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (934 to 957) SpanInfo: {"start":935,"length":21} + >secondary: secondaryA + >:=> (line 34, col 36) to (line 34, col 57) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (958 to 973) SpanInfo: {"start":906,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 34, col 7) to (line 34, col 59) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (974 to 980) SpanInfo: {"start":975,"length":5} + >i = 0 + >:=> (line 34, col 76) to (line 34, col 81) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (981 to 987) SpanInfo: {"start":982,"length":5} + >i < 1 + >:=> (line 34, col 83) to (line 34, col 88) +34 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (988 to 995) SpanInfo: {"start":989,"length":3} + >i++ + >:=> (line 34, col 90) to (line 34, col 93) +-------------------------------- +35 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (996 to 1022) SpanInfo: {"start":1000,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +36 >} + + ~~ => Pos: (1023 to 1024) SpanInfo: {"start":1000,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (1025 to 1038) SpanInfo: {"start":1032,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 37, col 7) to (line 37, col 59) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1039 to 1059) SpanInfo: {"start":1042,"length":17} + >primary: primaryA + >:=> (line 37, col 17) to (line 37, col 34) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1060 to 1083) SpanInfo: {"start":1061,"length":21} + >secondary: secondaryA + >:=> (line 37, col 36) to (line 37, col 57) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1084 to 1104) SpanInfo: {"start":1032,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 37, col 7) to (line 37, col 59) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1105 to 1111) SpanInfo: {"start":1106,"length":5} + >i = 0 + >:=> (line 37, col 81) to (line 37, col 86) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1112 to 1118) SpanInfo: {"start":1113,"length":5} + >i < 1 + >:=> (line 37, col 88) to (line 37, col 93) +37 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1119 to 1126) SpanInfo: {"start":1120,"length":3} + >i++ + >:=> (line 37, col 95) to (line 37, col 98) +-------------------------------- +38 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1127 to 1153) SpanInfo: {"start":1131,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +39 >} + + ~~ => Pos: (1154 to 1155) SpanInfo: {"start":1131,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~ => Pos: (1156 to 1169) SpanInfo: {"start":1163,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 40, col 7) to (line 40, col 59) +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1170 to 1190) SpanInfo: {"start":1173,"length":17} + >primary: primaryA + >:=> (line 40, col 17) to (line 40, col 34) +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1191 to 1214) SpanInfo: {"start":1192,"length":21} + >secondary: secondaryA + >:=> (line 40, col 36) to (line 40, col 57) +40 >for ({ skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (1215 to 1219) SpanInfo: {"start":1163,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 40, col 7) to (line 40, col 59) +-------------------------------- +41 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1220 to 1310) SpanInfo: {"start":1163,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 40, col 7) to (line 40, col 59) +-------------------------------- +42 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1311 to 1320) SpanInfo: {"start":1315,"length":5} + >i = 0 + >:=> (line 42, col 4) to (line 42, col 9) +42 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1321 to 1327) SpanInfo: {"start":1322,"length":5} + >i < 1 + >:=> (line 42, col 11) to (line 42, col 16) +42 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1328 to 1335) SpanInfo: {"start":1329,"length":3} + >i++ + >:=> (line 42, col 18) to (line 42, col 21) +-------------------------------- +43 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1336 to 1362) SpanInfo: {"start":1340,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +44 >} + + ~~ => Pos: (1363 to 1364) SpanInfo: {"start":1340,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1365 to 1386) SpanInfo: {"start":1372,"length":4} + >name + >:=> (line 45, col 7) to (line 45, col 11) +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1387 to 1393) SpanInfo: {"start":1388,"length":5} + >i = 0 + >:=> (line 45, col 23) to (line 45, col 28) +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1394 to 1400) SpanInfo: {"start":1395,"length":5} + >i < 1 + >:=> (line 45, col 30) to (line 45, col 35) +45 >for ({ name } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1401 to 1408) SpanInfo: {"start":1402,"length":3} + >i++ + >:=> (line 45, col 37) to (line 45, col 40) +-------------------------------- +46 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1409 to 1432) SpanInfo: {"start":1413,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +47 >} + + ~~ => Pos: (1433 to 1434) SpanInfo: {"start":1413,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1435 to 1461) SpanInfo: {"start":1442,"length":4} + >name + >:=> (line 48, col 7) to (line 48, col 11) +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1462 to 1468) SpanInfo: {"start":1463,"length":5} + >i = 0 + >:=> (line 48, col 28) to (line 48, col 33) +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1469 to 1475) SpanInfo: {"start":1470,"length":5} + >i < 1 + >:=> (line 48, col 35) to (line 48, col 40) +48 >for ({ name } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1476 to 1483) SpanInfo: {"start":1477,"length":3} + >i++ + >:=> (line 48, col 42) to (line 48, col 45) +-------------------------------- +49 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1484 to 1507) SpanInfo: {"start":1488,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + + ~~ => Pos: (1508 to 1509) SpanInfo: {"start":1488,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1510 to 1571) SpanInfo: {"start":1517,"length":4} + >name + >:=> (line 51, col 7) to (line 51, col 11) +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1572 to 1578) SpanInfo: {"start":1573,"length":5} + >i = 0 + >:=> (line 51, col 63) to (line 51, col 68) +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1579 to 1585) SpanInfo: {"start":1580,"length":5} + >i < 1 + >:=> (line 51, col 70) to (line 51, col 75) +51 >for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1586 to 1593) SpanInfo: {"start":1587,"length":3} + >i++ + >:=> (line 51, col 77) to (line 51, col 80) +-------------------------------- +52 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1594 to 1617) SpanInfo: {"start":1598,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1618 to 1619) SpanInfo: {"start":1598,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (1620 to 1633) SpanInfo: {"start":1627,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (1634 to 1644) SpanInfo: {"start":1637,"length":7} + >primary + >:=> (line 54, col 17) to (line 54, col 24) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (1645 to 1656) SpanInfo: {"start":1646,"length":9} + >secondary + >:=> (line 54, col 26) to (line 54, col 35) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (1657 to 1672) SpanInfo: {"start":1627,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1673 to 1679) SpanInfo: {"start":1674,"length":5} + >i = 0 + >:=> (line 54, col 54) to (line 54, col 59) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1680 to 1686) SpanInfo: {"start":1681,"length":5} + >i < 1 + >:=> (line 54, col 61) to (line 54, col 66) +54 >for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1687 to 1694) SpanInfo: {"start":1688,"length":3} + >i++ + >:=> (line 54, col 68) to (line 54, col 71) +-------------------------------- +55 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1695 to 1721) SpanInfo: {"start":1699,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +56 >} + + ~~ => Pos: (1722 to 1723) SpanInfo: {"start":1699,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~ => Pos: (1724 to 1737) SpanInfo: {"start":1731,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (1738 to 1748) SpanInfo: {"start":1741,"length":7} + >primary + >:=> (line 57, col 17) to (line 57, col 24) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (1749 to 1760) SpanInfo: {"start":1750,"length":9} + >secondary + >:=> (line 57, col 26) to (line 57, col 35) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1761 to 1781) SpanInfo: {"start":1731,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1782 to 1788) SpanInfo: {"start":1783,"length":5} + >i = 0 + >:=> (line 57, col 59) to (line 57, col 64) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1789 to 1795) SpanInfo: {"start":1790,"length":5} + >i < 1 + >:=> (line 57, col 66) to (line 57, col 71) +57 >for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1796 to 1803) SpanInfo: {"start":1797,"length":3} + >i++ + >:=> (line 57, col 73) to (line 57, col 76) +-------------------------------- +58 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1804 to 1830) SpanInfo: {"start":1808,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +59 >} + + ~~ => Pos: (1831 to 1832) SpanInfo: {"start":1808,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +60 >for ({ skills: { primary, secondary } } = + + ~~~~~~~~~~~~~~ => Pos: (1833 to 1846) SpanInfo: {"start":1840,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +60 >for ({ skills: { primary, secondary } } = + + ~~~~~~~~~~~ => Pos: (1847 to 1857) SpanInfo: {"start":1850,"length":7} + >primary + >:=> (line 60, col 17) to (line 60, col 24) +60 >for ({ skills: { primary, secondary } } = + + ~~~~~~~~~~~~ => Pos: (1858 to 1869) SpanInfo: {"start":1859,"length":9} + >secondary + >:=> (line 60, col 26) to (line 60, col 35) +60 >for ({ skills: { primary, secondary } } = + + ~~~~~ => Pos: (1870 to 1874) SpanInfo: {"start":1840,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +-------------------------------- +61 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1875 to 1965) SpanInfo: {"start":1840,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +-------------------------------- +62 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1966 to 1975) SpanInfo: {"start":1970,"length":5} + >i = 0 + >:=> (line 62, col 4) to (line 62, col 9) +62 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1976 to 1982) SpanInfo: {"start":1977,"length":5} + >i < 1 + >:=> (line 62, col 11) to (line 62, col 16) +62 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1983 to 1990) SpanInfo: {"start":1984,"length":3} + >i++ + >:=> (line 62, col 18) to (line 62, col 21) +-------------------------------- +63 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1991 to 2017) SpanInfo: {"start":1995,"length":21} + >console.log(primaryA) + >:=> (line 63, col 4) to (line 63, col 25) +-------------------------------- +64 >} + + ~~ => Pos: (2018 to 2019) SpanInfo: {"start":1995,"length":21} + >console.log(primaryA) + >:=> (line 63, col 4) to (line 63, col 25) +-------------------------------- +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2020 to 2038) SpanInfo: {"start":2027,"length":11} + >name: nameA + >:=> (line 65, col 7) to (line 65, col 18) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2039 to 2063) SpanInfo: {"start":2040,"length":13} + >skill: skillA + >:=> (line 65, col 20) to (line 65, col 33) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2064 to 2070) SpanInfo: {"start":2065,"length":5} + >i = 0 + >:=> (line 65, col 45) to (line 65, col 50) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2071 to 2077) SpanInfo: {"start":2072,"length":5} + >i < 1 + >:=> (line 65, col 52) to (line 65, col 57) +65 >for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2078 to 2085) SpanInfo: {"start":2079,"length":3} + >i++ + >:=> (line 65, col 59) to (line 65, col 62) +-------------------------------- +66 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2086 to 2109) SpanInfo: {"start":2090,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +67 >} + + ~~ => Pos: (2110 to 2111) SpanInfo: {"start":2090,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2112 to 2130) SpanInfo: {"start":2119,"length":11} + >name: nameA + >:=> (line 68, col 7) to (line 68, col 18) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2131 to 2160) SpanInfo: {"start":2132,"length":13} + >skill: skillA + >:=> (line 68, col 20) to (line 68, col 33) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2161 to 2167) SpanInfo: {"start":2162,"length":5} + >i = 0 + >:=> (line 68, col 50) to (line 68, col 55) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2168 to 2174) SpanInfo: {"start":2169,"length":5} + >i < 1 + >:=> (line 68, col 57) to (line 68, col 62) +68 >for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2175 to 2182) SpanInfo: {"start":2176,"length":3} + >i++ + >:=> (line 68, col 64) to (line 68, col 67) +-------------------------------- +69 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2183 to 2206) SpanInfo: {"start":2187,"length":18} + >console.log(nameA) + >:=> (line 69, col 4) to (line 69, col 22) +-------------------------------- +70 >} + + ~~ => Pos: (2207 to 2208) SpanInfo: {"start":2187,"length":18} + >console.log(nameA) + >:=> (line 69, col 4) to (line 69, col 22) +-------------------------------- +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2209 to 2227) SpanInfo: {"start":2216,"length":11} + >name: nameA + >:=> (line 71, col 7) to (line 71, col 18) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2228 to 2292) SpanInfo: {"start":2229,"length":13} + >skill: skillA + >:=> (line 71, col 20) to (line 71, col 33) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2293 to 2299) SpanInfo: {"start":2294,"length":5} + >i = 0 + >:=> (line 71, col 85) to (line 71, col 90) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2300 to 2306) SpanInfo: {"start":2301,"length":5} + >i < 1 + >:=> (line 71, col 92) to (line 71, col 97) +71 >for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2307 to 2314) SpanInfo: {"start":2308,"length":3} + >i++ + >:=> (line 71, col 99) to (line 71, col 102) +-------------------------------- +72 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2315 to 2338) SpanInfo: {"start":2319,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +73 >} + + ~~ => Pos: (2339 to 2340) SpanInfo: {"start":2319,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2341 to 2359) SpanInfo: {"start":2348,"length":11} + >name: nameA + >:=> (line 74, col 7) to (line 74, col 18) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2360 to 2367) SpanInfo: {"start":2361,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 74, col 20) to (line 74, col 72) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2368 to 2388) SpanInfo: {"start":2371,"length":17} + >primary: primaryA + >:=> (line 74, col 30) to (line 74, col 47) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2389 to 2412) SpanInfo: {"start":2390,"length":21} + >secondary: secondaryA + >:=> (line 74, col 49) to (line 74, col 70) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (2413 to 2428) SpanInfo: {"start":2361,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 74, col 20) to (line 74, col 72) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2429 to 2435) SpanInfo: {"start":2430,"length":5} + >i = 0 + >:=> (line 74, col 89) to (line 74, col 94) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2436 to 2442) SpanInfo: {"start":2437,"length":5} + >i < 1 + >:=> (line 74, col 96) to (line 74, col 101) +74 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2443 to 2450) SpanInfo: {"start":2444,"length":3} + >i++ + >:=> (line 74, col 103) to (line 74, col 106) +-------------------------------- +75 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2451 to 2477) SpanInfo: {"start":2455,"length":21} + >console.log(primaryA) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +76 >} + + ~~ => Pos: (2478 to 2479) SpanInfo: {"start":2455,"length":21} + >console.log(primaryA) + >:=> (line 75, col 4) to (line 75, col 25) +-------------------------------- +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2480 to 2498) SpanInfo: {"start":2487,"length":11} + >name: nameA + >:=> (line 77, col 7) to (line 77, col 18) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2499 to 2506) SpanInfo: {"start":2500,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 77, col 20) to (line 77, col 72) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2507 to 2527) SpanInfo: {"start":2510,"length":17} + >primary: primaryA + >:=> (line 77, col 30) to (line 77, col 47) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2528 to 2551) SpanInfo: {"start":2529,"length":21} + >secondary: secondaryA + >:=> (line 77, col 49) to (line 77, col 70) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2552 to 2572) SpanInfo: {"start":2500,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 77, col 20) to (line 77, col 72) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2573 to 2579) SpanInfo: {"start":2574,"length":5} + >i = 0 + >:=> (line 77, col 94) to (line 77, col 99) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2580 to 2586) SpanInfo: {"start":2581,"length":5} + >i < 1 + >:=> (line 77, col 101) to (line 77, col 106) +77 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2587 to 2594) SpanInfo: {"start":2588,"length":3} + >i++ + >:=> (line 77, col 108) to (line 77, col 111) +-------------------------------- +78 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2595 to 2621) SpanInfo: {"start":2599,"length":21} + >console.log(primaryA) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +79 >} + + ~~ => Pos: (2622 to 2623) SpanInfo: {"start":2599,"length":21} + >console.log(primaryA) + >:=> (line 78, col 4) to (line 78, col 25) +-------------------------------- +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2624 to 2642) SpanInfo: {"start":2631,"length":11} + >name: nameA + >:=> (line 80, col 7) to (line 80, col 18) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~ => Pos: (2643 to 2650) SpanInfo: {"start":2644,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 80, col 20) to (line 80, col 72) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2651 to 2671) SpanInfo: {"start":2654,"length":17} + >primary: primaryA + >:=> (line 80, col 30) to (line 80, col 47) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2672 to 2695) SpanInfo: {"start":2673,"length":21} + >secondary: secondaryA + >:=> (line 80, col 49) to (line 80, col 70) +80 >for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (2696 to 2700) SpanInfo: {"start":2644,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 80, col 20) to (line 80, col 72) +-------------------------------- +81 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2701 to 2791) SpanInfo: {"start":2644,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 80, col 20) to (line 80, col 72) +-------------------------------- +82 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2792 to 2801) SpanInfo: {"start":2796,"length":5} + >i = 0 + >:=> (line 82, col 4) to (line 82, col 9) +82 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2802 to 2808) SpanInfo: {"start":2803,"length":5} + >i < 1 + >:=> (line 82, col 11) to (line 82, col 16) +82 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2809 to 2816) SpanInfo: {"start":2810,"length":3} + >i++ + >:=> (line 82, col 18) to (line 82, col 21) +-------------------------------- +83 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2817 to 2843) SpanInfo: {"start":2821,"length":21} + >console.log(primaryA) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +84 >} + + ~~ => Pos: (2844 to 2845) SpanInfo: {"start":2821,"length":21} + >console.log(primaryA) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (2846 to 2857) SpanInfo: {"start":2853,"length":4} + >name + >:=> (line 85, col 7) to (line 85, col 11) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2858 to 2874) SpanInfo: {"start":2859,"length":5} + >skill + >:=> (line 85, col 13) to (line 85, col 18) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2875 to 2881) SpanInfo: {"start":2876,"length":5} + >i = 0 + >:=> (line 85, col 30) to (line 85, col 35) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2882 to 2888) SpanInfo: {"start":2883,"length":5} + >i < 1 + >:=> (line 85, col 37) to (line 85, col 42) +85 >for ({ name, skill } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2889 to 2896) SpanInfo: {"start":2890,"length":3} + >i++ + >:=> (line 85, col 44) to (line 85, col 47) +-------------------------------- +86 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2897 to 2920) SpanInfo: {"start":2901,"length":18} + >console.log(nameA) + >:=> (line 86, col 4) to (line 86, col 22) +-------------------------------- +87 >} + + ~~ => Pos: (2921 to 2922) SpanInfo: {"start":2901,"length":18} + >console.log(nameA) + >:=> (line 86, col 4) to (line 86, col 22) +-------------------------------- +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (2923 to 2934) SpanInfo: {"start":2930,"length":4} + >name + >:=> (line 88, col 7) to (line 88, col 11) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2935 to 2956) SpanInfo: {"start":2936,"length":5} + >skill + >:=> (line 88, col 13) to (line 88, col 18) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2957 to 2963) SpanInfo: {"start":2958,"length":5} + >i = 0 + >:=> (line 88, col 35) to (line 88, col 40) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2964 to 2970) SpanInfo: {"start":2965,"length":5} + >i < 1 + >:=> (line 88, col 42) to (line 88, col 47) +88 >for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2971 to 2978) SpanInfo: {"start":2972,"length":3} + >i++ + >:=> (line 88, col 49) to (line 88, col 52) +-------------------------------- +89 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2979 to 3002) SpanInfo: {"start":2983,"length":18} + >console.log(nameA) + >:=> (line 89, col 4) to (line 89, col 22) +-------------------------------- +90 >} + + ~~ => Pos: (3003 to 3004) SpanInfo: {"start":2983,"length":18} + >console.log(nameA) + >:=> (line 89, col 4) to (line 89, col 22) +-------------------------------- +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3005 to 3016) SpanInfo: {"start":3012,"length":4} + >name + >:=> (line 91, col 7) to (line 91, col 11) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3017 to 3073) SpanInfo: {"start":3018,"length":5} + >skill + >:=> (line 91, col 13) to (line 91, col 18) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3074 to 3080) SpanInfo: {"start":3075,"length":5} + >i = 0 + >:=> (line 91, col 70) to (line 91, col 75) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3081 to 3087) SpanInfo: {"start":3082,"length":5} + >i < 1 + >:=> (line 91, col 77) to (line 91, col 82) +91 >for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3088 to 3095) SpanInfo: {"start":3089,"length":3} + >i++ + >:=> (line 91, col 84) to (line 91, col 87) +-------------------------------- +92 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3096 to 3119) SpanInfo: {"start":3100,"length":18} + >console.log(nameA) + >:=> (line 92, col 4) to (line 92, col 22) +-------------------------------- +93 >} + + ~~ => Pos: (3120 to 3121) SpanInfo: {"start":3100,"length":18} + >console.log(nameA) + >:=> (line 92, col 4) to (line 92, col 22) +-------------------------------- +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3122 to 3133) SpanInfo: {"start":3129,"length":4} + >name + >:=> (line 94, col 7) to (line 94, col 11) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3134 to 3141) SpanInfo: {"start":3135,"length":30} + >skills: { primary, secondary } + >:=> (line 94, col 13) to (line 94, col 43) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (3142 to 3152) SpanInfo: {"start":3145,"length":7} + >primary + >:=> (line 94, col 23) to (line 94, col 30) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3153 to 3164) SpanInfo: {"start":3154,"length":9} + >secondary + >:=> (line 94, col 32) to (line 94, col 41) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (3165 to 3180) SpanInfo: {"start":3135,"length":30} + >skills: { primary, secondary } + >:=> (line 94, col 13) to (line 94, col 43) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3181 to 3187) SpanInfo: {"start":3182,"length":5} + >i = 0 + >:=> (line 94, col 60) to (line 94, col 65) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3188 to 3194) SpanInfo: {"start":3189,"length":5} + >i < 1 + >:=> (line 94, col 67) to (line 94, col 72) +94 >for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3195 to 3202) SpanInfo: {"start":3196,"length":3} + >i++ + >:=> (line 94, col 74) to (line 94, col 77) +-------------------------------- +95 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3203 to 3229) SpanInfo: {"start":3207,"length":21} + >console.log(primaryA) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +96 >} + + ~~ => Pos: (3230 to 3231) SpanInfo: {"start":3207,"length":21} + >console.log(primaryA) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3232 to 3243) SpanInfo: {"start":3239,"length":4} + >name + >:=> (line 97, col 7) to (line 97, col 11) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3244 to 3251) SpanInfo: {"start":3245,"length":30} + >skills: { primary, secondary } + >:=> (line 97, col 13) to (line 97, col 43) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (3252 to 3262) SpanInfo: {"start":3255,"length":7} + >primary + >:=> (line 97, col 23) to (line 97, col 30) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~ => Pos: (3263 to 3274) SpanInfo: {"start":3264,"length":9} + >secondary + >:=> (line 97, col 32) to (line 97, col 41) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (3275 to 3295) SpanInfo: {"start":3245,"length":30} + >skills: { primary, secondary } + >:=> (line 97, col 13) to (line 97, col 43) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3296 to 3302) SpanInfo: {"start":3297,"length":5} + >i = 0 + >:=> (line 97, col 65) to (line 97, col 70) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3303 to 3309) SpanInfo: {"start":3304,"length":5} + >i < 1 + >:=> (line 97, col 72) to (line 97, col 77) +97 >for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3310 to 3317) SpanInfo: {"start":3311,"length":3} + >i++ + >:=> (line 97, col 79) to (line 97, col 82) +-------------------------------- +98 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3318 to 3344) SpanInfo: {"start":3322,"length":21} + >console.log(primaryA) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +99 >} + + ~~ => Pos: (3345 to 3346) SpanInfo: {"start":3322,"length":21} + >console.log(primaryA) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~~~~~ => Pos: (3347 to 3358) SpanInfo: {"start":3354,"length":4} + >name + >:=> (line 100, col 7) to (line 100, col 11) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~ => Pos: (3359 to 3366) SpanInfo: {"start":3360,"length":30} + >skills: { primary, secondary } + >:=> (line 100, col 13) to (line 100, col 43) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~~~~ => Pos: (3367 to 3377) SpanInfo: {"start":3370,"length":7} + >primary + >:=> (line 100, col 23) to (line 100, col 30) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~~~~~~~~ => Pos: (3378 to 3389) SpanInfo: {"start":3379,"length":9} + >secondary + >:=> (line 100, col 32) to (line 100, col 41) +100>for ({ name, skills: { primary, secondary } } = + + ~~~~~=> Pos: (3390 to 3394) SpanInfo: {"start":3360,"length":30} + >skills: { primary, secondary } + >:=> (line 100, col 13) to (line 100, col 43) +-------------------------------- +101> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3395 to 3485) SpanInfo: {"start":3360,"length":30} + >skills: { primary, secondary } + >:=> (line 100, col 13) to (line 100, col 43) +-------------------------------- +102> i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (3486 to 3495) SpanInfo: {"start":3490,"length":5} + >i = 0 + >:=> (line 102, col 4) to (line 102, col 9) +102> i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3496 to 3502) SpanInfo: {"start":3497,"length":5} + >i < 1 + >:=> (line 102, col 11) to (line 102, col 16) +102> i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3503 to 3510) SpanInfo: {"start":3504,"length":3} + >i++ + >:=> (line 102, col 18) to (line 102, col 21) +-------------------------------- +103> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3511 to 3537) SpanInfo: {"start":3515,"length":21} + >console.log(primaryA) + >:=> (line 103, col 4) to (line 103, col 25) +-------------------------------- +104>} + ~ => Pos: (3538 to 3538) SpanInfo: {"start":3515,"length":21} + >console.log(primaryA) + >:=> (line 103, col 4) to (line 103, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..daf4f8a0d84 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,1483 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 187) SpanInfo: undefined +-------------------------------- +12 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (188 to 215) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (216 to 222) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (223 to 224) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (225 to 279) SpanInfo: {"start":225,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (280 to 377) SpanInfo: {"start":280,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 399) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (400 to 417) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (420 to 446) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (447 to 469) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (470 to 471) SpanInfo: {"start":470,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (472 to 555) SpanInfo: undefined +-------------------------------- +24 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (556 to 624) SpanInfo: undefined +-------------------------------- +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (625 to 663) SpanInfo: {"start":631,"length":22} + >name: nameA = "noName" + >:=> (line 25, col 6) to (line 25, col 28) +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (664 to 670) SpanInfo: {"start":665,"length":5} + >i = 0 + >:=> (line 25, col 40) to (line 25, col 45) +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (671 to 677) SpanInfo: {"start":672,"length":5} + >i < 1 + >:=> (line 25, col 47) to (line 25, col 52) +25 >for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (678 to 685) SpanInfo: {"start":679,"length":3} + >i++ + >:=> (line 25, col 54) to (line 25, col 57) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (686 to 709) SpanInfo: {"start":690,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (710 to 711) SpanInfo: {"start":690,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (712 to 755) SpanInfo: {"start":718,"length":22} + >name: nameA = "noName" + >:=> (line 28, col 6) to (line 28, col 28) +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (756 to 762) SpanInfo: {"start":757,"length":5} + >i = 0 + >:=> (line 28, col 45) to (line 28, col 50) +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (763 to 769) SpanInfo: {"start":764,"length":5} + >i < 1 + >:=> (line 28, col 52) to (line 28, col 57) +28 >for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (770 to 777) SpanInfo: {"start":771,"length":3} + >i++ + >:=> (line 28, col 59) to (line 28, col 62) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (778 to 801) SpanInfo: {"start":782,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (802 to 803) SpanInfo: {"start":782,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (804 to 882) SpanInfo: {"start":810,"length":22} + >name: nameA = "noName" + >:=> (line 31, col 6) to (line 31, col 28) +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (883 to 889) SpanInfo: {"start":884,"length":5} + >i = 0 + >:=> (line 31, col 80) to (line 31, col 85) +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (890 to 896) SpanInfo: {"start":891,"length":5} + >i < 1 + >:=> (line 31, col 87) to (line 31, col 92) +31 >for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (897 to 904) SpanInfo: {"start":898,"length":3} + >i++ + >:=> (line 31, col 94) to (line 31, col 97) +-------------------------------- +32 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (905 to 928) SpanInfo: {"start":909,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +33 >} + + ~~ => Pos: (929 to 930) SpanInfo: {"start":909,"length":18} + >console.log(nameA) + >:=> (line 32, col 4) to (line 32, col 22) +-------------------------------- +34 >for ({ + + ~~~~~~~ => Pos: (931 to 937) SpanInfo: {"start":942,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 35, col 4) to (line 38, col 46) +-------------------------------- +35 > skills: { + + ~~~~~~~~~~~ => Pos: (938 to 948) SpanInfo: {"start":942,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 35, col 4) to (line 38, col 46) +35 > skills: { + + ~~~ => Pos: (949 to 951) SpanInfo: {"start":960,"length":29} + >primary: primaryA = "primary" + >:=> (line 36, col 8) to (line 36, col 37) +-------------------------------- +36 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (952 to 990) SpanInfo: {"start":960,"length":29} + >primary: primaryA = "primary" + >:=> (line 36, col 8) to (line 36, col 37) +-------------------------------- +37 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (991 to 1034) SpanInfo: {"start":999,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 37, col 8) to (line 37, col 43) +-------------------------------- +38 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1035 to 1081) SpanInfo: {"start":999,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 37, col 8) to (line 37, col 43) +-------------------------------- +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (1082 to 1096) SpanInfo: {"start":942,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 35, col 4) to (line 38, col 46) +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1097 to 1103) SpanInfo: {"start":1098,"length":5} + >i = 0 + >:=> (line 39, col 16) to (line 39, col 21) +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1104 to 1110) SpanInfo: {"start":1105,"length":5} + >i < 1 + >:=> (line 39, col 23) to (line 39, col 28) +39 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1111 to 1118) SpanInfo: {"start":1112,"length":3} + >i++ + >:=> (line 39, col 30) to (line 39, col 33) +-------------------------------- +40 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1119 to 1145) SpanInfo: {"start":1123,"length":21} + >console.log(primaryA) + >:=> (line 40, col 4) to (line 40, col 25) +-------------------------------- +41 >} + + ~~ => Pos: (1146 to 1147) SpanInfo: {"start":1123,"length":21} + >console.log(primaryA) + >:=> (line 40, col 4) to (line 40, col 25) +-------------------------------- +42 >for ({ + + ~~~~~~~ => Pos: (1148 to 1154) SpanInfo: {"start":1159,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 43, col 4) to (line 46, col 46) +-------------------------------- +43 > skills: { + + ~~~~~~~~~~~ => Pos: (1155 to 1165) SpanInfo: {"start":1159,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 43, col 4) to (line 46, col 46) +43 > skills: { + + ~~~ => Pos: (1166 to 1168) SpanInfo: {"start":1177,"length":29} + >primary: primaryA = "primary" + >:=> (line 44, col 8) to (line 44, col 37) +-------------------------------- +44 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1169 to 1207) SpanInfo: {"start":1177,"length":29} + >primary: primaryA = "primary" + >:=> (line 44, col 8) to (line 44, col 37) +-------------------------------- +45 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1208 to 1251) SpanInfo: {"start":1216,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 45, col 8) to (line 45, col 43) +-------------------------------- +46 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1252 to 1298) SpanInfo: {"start":1216,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 45, col 8) to (line 45, col 43) +-------------------------------- +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1299 to 1318) SpanInfo: {"start":1159,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 43, col 4) to (line 46, col 46) +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1319 to 1325) SpanInfo: {"start":1320,"length":5} + >i = 0 + >:=> (line 47, col 21) to (line 47, col 26) +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1326 to 1332) SpanInfo: {"start":1327,"length":5} + >i < 1 + >:=> (line 47, col 28) to (line 47, col 33) +47 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1333 to 1340) SpanInfo: {"start":1334,"length":3} + >i++ + >:=> (line 47, col 35) to (line 47, col 38) +-------------------------------- +48 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1341 to 1367) SpanInfo: {"start":1345,"length":21} + >console.log(primaryA) + >:=> (line 48, col 4) to (line 48, col 25) +-------------------------------- +49 >} + + ~~ => Pos: (1368 to 1369) SpanInfo: {"start":1345,"length":21} + >console.log(primaryA) + >:=> (line 48, col 4) to (line 48, col 25) +-------------------------------- +50 >for ({ + + ~~~~~~~ => Pos: (1370 to 1376) SpanInfo: {"start":1381,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 51, col 4) to (line 54, col 46) +-------------------------------- +51 > skills: { + + ~~~~~~~~~~~ => Pos: (1377 to 1387) SpanInfo: {"start":1381,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 51, col 4) to (line 54, col 46) +51 > skills: { + + ~~~ => Pos: (1388 to 1390) SpanInfo: {"start":1399,"length":29} + >primary: primaryA = "primary" + >:=> (line 52, col 8) to (line 52, col 37) +-------------------------------- +52 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1391 to 1429) SpanInfo: {"start":1399,"length":29} + >primary: primaryA = "primary" + >:=> (line 52, col 8) to (line 52, col 37) +-------------------------------- +53 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1430 to 1473) SpanInfo: {"start":1438,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 53, col 8) to (line 53, col 43) +-------------------------------- +54 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1474 to 1520) SpanInfo: {"start":1438,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 53, col 8) to (line 53, col 43) +-------------------------------- +55 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1521 to 1611) SpanInfo: {"start":1381,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 51, col 4) to (line 54, col 46) +-------------------------------- +56 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1612 to 1621) SpanInfo: {"start":1616,"length":5} + >i = 0 + >:=> (line 56, col 4) to (line 56, col 9) +56 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1622 to 1628) SpanInfo: {"start":1623,"length":5} + >i < 1 + >:=> (line 56, col 11) to (line 56, col 16) +56 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1629 to 1636) SpanInfo: {"start":1630,"length":3} + >i++ + >:=> (line 56, col 18) to (line 56, col 21) +-------------------------------- +57 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1637 to 1663) SpanInfo: {"start":1641,"length":21} + >console.log(primaryA) + >:=> (line 57, col 4) to (line 57, col 25) +-------------------------------- +58 >} + + ~~ => Pos: (1664 to 1665) SpanInfo: {"start":1641,"length":21} + >console.log(primaryA) + >:=> (line 57, col 4) to (line 57, col 25) +-------------------------------- +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1666 to 1698) SpanInfo: {"start":1673,"length":15} + >name = "noName" + >:=> (line 59, col 7) to (line 59, col 22) +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1699 to 1705) SpanInfo: {"start":1700,"length":5} + >i = 0 + >:=> (line 59, col 34) to (line 59, col 39) +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1706 to 1712) SpanInfo: {"start":1707,"length":5} + >i < 1 + >:=> (line 59, col 41) to (line 59, col 46) +59 >for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1713 to 1720) SpanInfo: {"start":1714,"length":3} + >i++ + >:=> (line 59, col 48) to (line 59, col 51) +-------------------------------- +60 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1721 to 1744) SpanInfo: {"start":1725,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +61 >} + + ~~ => Pos: (1745 to 1746) SpanInfo: {"start":1725,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1747 to 1784) SpanInfo: {"start":1754,"length":15} + >name = "noName" + >:=> (line 62, col 7) to (line 62, col 22) +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1785 to 1791) SpanInfo: {"start":1786,"length":5} + >i = 0 + >:=> (line 62, col 39) to (line 62, col 44) +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1792 to 1798) SpanInfo: {"start":1793,"length":5} + >i < 1 + >:=> (line 62, col 46) to (line 62, col 51) +62 >for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1799 to 1806) SpanInfo: {"start":1800,"length":3} + >i++ + >:=> (line 62, col 53) to (line 62, col 56) +-------------------------------- +63 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1807 to 1830) SpanInfo: {"start":1811,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +64 >} + + ~~ => Pos: (1831 to 1832) SpanInfo: {"start":1811,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1833 to 1905) SpanInfo: {"start":1840,"length":15} + >name = "noName" + >:=> (line 65, col 7) to (line 65, col 22) +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1906 to 1912) SpanInfo: {"start":1907,"length":5} + >i = 0 + >:=> (line 65, col 74) to (line 65, col 79) +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1913 to 1919) SpanInfo: {"start":1914,"length":5} + >i < 1 + >:=> (line 65, col 81) to (line 65, col 86) +65 >for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1920 to 1927) SpanInfo: {"start":1921,"length":3} + >i++ + >:=> (line 65, col 88) to (line 65, col 91) +-------------------------------- +66 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1928 to 1951) SpanInfo: {"start":1932,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +67 >} + + ~~ => Pos: (1952 to 1953) SpanInfo: {"start":1932,"length":18} + >console.log(nameA) + >:=> (line 66, col 4) to (line 66, col 22) +-------------------------------- +68 >for ({ + + ~~~~~~~ => Pos: (1954 to 1960) SpanInfo: {"start":1965,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 69, col 4) to (line 72, col 46) +-------------------------------- +69 > skills: { + + ~~~~~~~~~~~ => Pos: (1961 to 1971) SpanInfo: {"start":1965,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 69, col 4) to (line 72, col 46) +69 > skills: { + + ~~~ => Pos: (1972 to 1974) SpanInfo: {"start":1983,"length":19} + >primary = "primary" + >:=> (line 70, col 8) to (line 70, col 27) +-------------------------------- +70 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1975 to 2003) SpanInfo: {"start":1983,"length":19} + >primary = "primary" + >:=> (line 70, col 8) to (line 70, col 27) +-------------------------------- +71 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2004 to 2035) SpanInfo: {"start":2012,"length":23} + >secondary = "secondary" + >:=> (line 71, col 8) to (line 71, col 31) +-------------------------------- +72 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2036 to 2082) SpanInfo: {"start":2012,"length":23} + >secondary = "secondary" + >:=> (line 71, col 8) to (line 71, col 31) +-------------------------------- +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2083 to 2097) SpanInfo: {"start":1965,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 69, col 4) to (line 72, col 46) +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2098 to 2104) SpanInfo: {"start":2099,"length":5} + >i = 0 + >:=> (line 73, col 16) to (line 73, col 21) +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2105 to 2111) SpanInfo: {"start":2106,"length":5} + >i < 1 + >:=> (line 73, col 23) to (line 73, col 28) +73 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2112 to 2119) SpanInfo: {"start":2113,"length":3} + >i++ + >:=> (line 73, col 30) to (line 73, col 33) +-------------------------------- +74 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2120 to 2146) SpanInfo: {"start":2124,"length":21} + >console.log(primaryA) + >:=> (line 74, col 4) to (line 74, col 25) +-------------------------------- +75 >} + + ~~ => Pos: (2147 to 2148) SpanInfo: {"start":2124,"length":21} + >console.log(primaryA) + >:=> (line 74, col 4) to (line 74, col 25) +-------------------------------- +76 >for ({ + + ~~~~~~~ => Pos: (2149 to 2155) SpanInfo: {"start":2160,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +-------------------------------- +77 > skills: { + + ~~~~~~~~~~~ => Pos: (2156 to 2166) SpanInfo: {"start":2160,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +77 > skills: { + + ~~~ => Pos: (2167 to 2169) SpanInfo: {"start":2178,"length":19} + >primary = "primary" + >:=> (line 78, col 8) to (line 78, col 27) +-------------------------------- +78 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2170 to 2198) SpanInfo: {"start":2178,"length":19} + >primary = "primary" + >:=> (line 78, col 8) to (line 78, col 27) +-------------------------------- +79 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2199 to 2230) SpanInfo: {"start":2207,"length":23} + >secondary = "secondary" + >:=> (line 79, col 8) to (line 79, col 31) +-------------------------------- +80 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2231 to 2277) SpanInfo: {"start":2207,"length":23} + >secondary = "secondary" + >:=> (line 79, col 8) to (line 79, col 31) +-------------------------------- +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2278 to 2297) SpanInfo: {"start":2160,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2298 to 2304) SpanInfo: {"start":2299,"length":5} + >i = 0 + >:=> (line 81, col 21) to (line 81, col 26) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2305 to 2311) SpanInfo: {"start":2306,"length":5} + >i < 1 + >:=> (line 81, col 28) to (line 81, col 33) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2312 to 2319) SpanInfo: {"start":2313,"length":3} + >i++ + >:=> (line 81, col 35) to (line 81, col 38) +-------------------------------- +82 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2320 to 2346) SpanInfo: {"start":2324,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +83 >} + + ~~ => Pos: (2347 to 2348) SpanInfo: {"start":2324,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +84 >for ({ + + ~~~~~~~ => Pos: (2349 to 2355) SpanInfo: {"start":2360,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 85, col 4) to (line 88, col 46) +-------------------------------- +85 > skills: { + + ~~~~~~~~~~~ => Pos: (2356 to 2366) SpanInfo: {"start":2360,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 85, col 4) to (line 88, col 46) +85 > skills: { + + ~~~ => Pos: (2367 to 2369) SpanInfo: {"start":2378,"length":19} + >primary = "primary" + >:=> (line 86, col 8) to (line 86, col 27) +-------------------------------- +86 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2370 to 2398) SpanInfo: {"start":2378,"length":19} + >primary = "primary" + >:=> (line 86, col 8) to (line 86, col 27) +-------------------------------- +87 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2399 to 2430) SpanInfo: {"start":2407,"length":23} + >secondary = "secondary" + >:=> (line 87, col 8) to (line 87, col 31) +-------------------------------- +88 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2431 to 2477) SpanInfo: {"start":2407,"length":23} + >secondary = "secondary" + >:=> (line 87, col 8) to (line 87, col 31) +-------------------------------- +89 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2478 to 2568) SpanInfo: {"start":2360,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 85, col 4) to (line 88, col 46) +-------------------------------- +90 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2569 to 2578) SpanInfo: {"start":2573,"length":5} + >i = 0 + >:=> (line 90, col 4) to (line 90, col 9) +90 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2579 to 2585) SpanInfo: {"start":2580,"length":5} + >i < 1 + >:=> (line 90, col 11) to (line 90, col 16) +90 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2586 to 2593) SpanInfo: {"start":2587,"length":3} + >i++ + >:=> (line 90, col 18) to (line 90, col 21) +-------------------------------- +91 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2594 to 2620) SpanInfo: {"start":2598,"length":21} + >console.log(primaryA) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +92 >} + + ~~ => Pos: (2621 to 2622) SpanInfo: {"start":2598,"length":21} + >console.log(primaryA) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2623 to 2651) SpanInfo: {"start":2629,"length":22} + >name: nameA = "noName" + >:=> (line 93, col 6) to (line 93, col 28) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2652 to 2686) SpanInfo: {"start":2653,"length":23} + >skill: skillA = "skill" + >:=> (line 93, col 30) to (line 93, col 53) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2687 to 2693) SpanInfo: {"start":2688,"length":5} + >i = 0 + >:=> (line 93, col 65) to (line 93, col 70) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2694 to 2700) SpanInfo: {"start":2695,"length":5} + >i < 1 + >:=> (line 93, col 72) to (line 93, col 77) +93 >for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2701 to 2708) SpanInfo: {"start":2702,"length":3} + >i++ + >:=> (line 93, col 79) to (line 93, col 82) +-------------------------------- +94 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2709 to 2732) SpanInfo: {"start":2713,"length":18} + >console.log(nameA) + >:=> (line 94, col 4) to (line 94, col 22) +-------------------------------- +95 >} + + ~~ => Pos: (2733 to 2734) SpanInfo: {"start":2713,"length":18} + >console.log(nameA) + >:=> (line 94, col 4) to (line 94, col 22) +-------------------------------- +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2735 to 2763) SpanInfo: {"start":2741,"length":22} + >name: nameA = "noName" + >:=> (line 96, col 6) to (line 96, col 28) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2764 to 2803) SpanInfo: {"start":2765,"length":23} + >skill: skillA = "skill" + >:=> (line 96, col 30) to (line 96, col 53) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2804 to 2810) SpanInfo: {"start":2805,"length":5} + >i = 0 + >:=> (line 96, col 70) to (line 96, col 75) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2811 to 2817) SpanInfo: {"start":2812,"length":5} + >i < 1 + >:=> (line 96, col 77) to (line 96, col 82) +96 >for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2818 to 2825) SpanInfo: {"start":2819,"length":3} + >i++ + >:=> (line 96, col 84) to (line 96, col 87) +-------------------------------- +97 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2826 to 2849) SpanInfo: {"start":2830,"length":18} + >console.log(nameA) + >:=> (line 97, col 4) to (line 97, col 22) +-------------------------------- +98 >} + + ~~ => Pos: (2850 to 2851) SpanInfo: {"start":2830,"length":18} + >console.log(nameA) + >:=> (line 97, col 4) to (line 97, col 22) +-------------------------------- +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2852 to 2880) SpanInfo: {"start":2858,"length":22} + >name: nameA = "noName" + >:=> (line 99, col 6) to (line 99, col 28) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2881 to 2955) SpanInfo: {"start":2882,"length":23} + >skill: skillA = "skill" + >:=> (line 99, col 30) to (line 99, col 53) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2956 to 2962) SpanInfo: {"start":2957,"length":5} + >i = 0 + >:=> (line 99, col 105) to (line 99, col 110) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2963 to 2969) SpanInfo: {"start":2964,"length":5} + >i < 1 + >:=> (line 99, col 112) to (line 99, col 117) +99 >for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2970 to 2977) SpanInfo: {"start":2971,"length":3} + >i++ + >:=> (line 99, col 119) to (line 99, col 122) +-------------------------------- +100> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2978 to 3001) SpanInfo: {"start":2982,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) +-------------------------------- +101>} + + ~~ => Pos: (3002 to 3003) SpanInfo: {"start":2982,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) +-------------------------------- +102>for ({ + + ~~~~~~~ => Pos: (3004 to 3010) SpanInfo: {"start":3015,"length":22} + >name: nameA = "noName" + >:=> (line 103, col 4) to (line 103, col 26) +-------------------------------- +103> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3011 to 3038) SpanInfo: {"start":3015,"length":22} + >name: nameA = "noName" + >:=> (line 103, col 4) to (line 103, col 26) +-------------------------------- +104> skills: { + + ~~~~~~~~~~~ => Pos: (3039 to 3049) SpanInfo: {"start":3043,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 104, col 4) to (line 107, col 46) +104> skills: { + + ~~~ => Pos: (3050 to 3052) SpanInfo: {"start":3061,"length":29} + >primary: primaryA = "primary" + >:=> (line 105, col 8) to (line 105, col 37) +-------------------------------- +105> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3053 to 3091) SpanInfo: {"start":3061,"length":29} + >primary: primaryA = "primary" + >:=> (line 105, col 8) to (line 105, col 37) +-------------------------------- +106> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3092 to 3135) SpanInfo: {"start":3100,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 106, col 8) to (line 106, col 43) +-------------------------------- +107> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3136 to 3182) SpanInfo: {"start":3100,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 106, col 8) to (line 106, col 43) +-------------------------------- +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (3183 to 3197) SpanInfo: {"start":3043,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 104, col 4) to (line 107, col 46) +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3198 to 3204) SpanInfo: {"start":3199,"length":5} + >i = 0 + >:=> (line 108, col 16) to (line 108, col 21) +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3205 to 3211) SpanInfo: {"start":3206,"length":5} + >i < 1 + >:=> (line 108, col 23) to (line 108, col 28) +108>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3212 to 3219) SpanInfo: {"start":3213,"length":3} + >i++ + >:=> (line 108, col 30) to (line 108, col 33) +-------------------------------- +109> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3220 to 3246) SpanInfo: {"start":3224,"length":21} + >console.log(primaryA) + >:=> (line 109, col 4) to (line 109, col 25) +-------------------------------- +110>} + + ~~ => Pos: (3247 to 3248) SpanInfo: {"start":3224,"length":21} + >console.log(primaryA) + >:=> (line 109, col 4) to (line 109, col 25) +-------------------------------- +111>for ({ + + ~~~~~~~ => Pos: (3249 to 3255) SpanInfo: {"start":3260,"length":22} + >name: nameA = "noName" + >:=> (line 112, col 4) to (line 112, col 26) +-------------------------------- +112> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3256 to 3283) SpanInfo: {"start":3260,"length":22} + >name: nameA = "noName" + >:=> (line 112, col 4) to (line 112, col 26) +-------------------------------- +113> skills: { + + ~~~~~~~~~~~ => Pos: (3284 to 3294) SpanInfo: {"start":3288,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 113, col 4) to (line 116, col 46) +113> skills: { + + ~~~ => Pos: (3295 to 3297) SpanInfo: {"start":3306,"length":29} + >primary: primaryA = "primary" + >:=> (line 114, col 8) to (line 114, col 37) +-------------------------------- +114> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3298 to 3336) SpanInfo: {"start":3306,"length":29} + >primary: primaryA = "primary" + >:=> (line 114, col 8) to (line 114, col 37) +-------------------------------- +115> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3337 to 3380) SpanInfo: {"start":3345,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 115, col 8) to (line 115, col 43) +-------------------------------- +116> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3381 to 3427) SpanInfo: {"start":3345,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 115, col 8) to (line 115, col 43) +-------------------------------- +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (3428 to 3447) SpanInfo: {"start":3288,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 113, col 4) to (line 116, col 46) +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3448 to 3454) SpanInfo: {"start":3449,"length":5} + >i = 0 + >:=> (line 117, col 21) to (line 117, col 26) +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3455 to 3461) SpanInfo: {"start":3456,"length":5} + >i < 1 + >:=> (line 117, col 28) to (line 117, col 33) +117>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3462 to 3469) SpanInfo: {"start":3463,"length":3} + >i++ + >:=> (line 117, col 35) to (line 117, col 38) +-------------------------------- +118> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3470 to 3496) SpanInfo: {"start":3474,"length":21} + >console.log(primaryA) + >:=> (line 118, col 4) to (line 118, col 25) +-------------------------------- +119>} + + ~~ => Pos: (3497 to 3498) SpanInfo: {"start":3474,"length":21} + >console.log(primaryA) + >:=> (line 118, col 4) to (line 118, col 25) +-------------------------------- +120>for ({ + + ~~~~~~~ => Pos: (3499 to 3505) SpanInfo: {"start":3510,"length":22} + >name: nameA = "noName" + >:=> (line 121, col 4) to (line 121, col 26) +-------------------------------- +121> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3506 to 3533) SpanInfo: {"start":3510,"length":22} + >name: nameA = "noName" + >:=> (line 121, col 4) to (line 121, col 26) +-------------------------------- +122> skills: { + + ~~~~~~~~~~~ => Pos: (3534 to 3544) SpanInfo: {"start":3538,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 122, col 4) to (line 125, col 46) +122> skills: { + + ~~~ => Pos: (3545 to 3547) SpanInfo: {"start":3556,"length":29} + >primary: primaryA = "primary" + >:=> (line 123, col 8) to (line 123, col 37) +-------------------------------- +123> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3548 to 3586) SpanInfo: {"start":3556,"length":29} + >primary: primaryA = "primary" + >:=> (line 123, col 8) to (line 123, col 37) +-------------------------------- +124> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3587 to 3630) SpanInfo: {"start":3595,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 124, col 8) to (line 124, col 43) +-------------------------------- +125> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3631 to 3677) SpanInfo: {"start":3595,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 124, col 8) to (line 124, col 43) +-------------------------------- +126>} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3678 to 3768) SpanInfo: {"start":3538,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 122, col 4) to (line 125, col 46) +-------------------------------- +127> i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (3769 to 3778) SpanInfo: {"start":3773,"length":5} + >i = 0 + >:=> (line 127, col 4) to (line 127, col 9) +127> i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (3779 to 3785) SpanInfo: {"start":3780,"length":5} + >i < 1 + >:=> (line 127, col 11) to (line 127, col 16) +127> i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (3786 to 3793) SpanInfo: {"start":3787,"length":3} + >i++ + >:=> (line 127, col 18) to (line 127, col 21) +-------------------------------- +128> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3794 to 3820) SpanInfo: {"start":3798,"length":21} + >console.log(primaryA) + >:=> (line 128, col 4) to (line 128, col 25) +-------------------------------- +129>} + + ~~ => Pos: (3821 to 3822) SpanInfo: {"start":3798,"length":21} + >console.log(primaryA) + >:=> (line 128, col 4) to (line 128, col 25) +-------------------------------- +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3823 to 3845) SpanInfo: {"start":3830,"length":15} + >name = "noName" + >:=> (line 130, col 7) to (line 130, col 22) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3846 to 3872) SpanInfo: {"start":3847,"length":15} + >skill = "skill" + >:=> (line 130, col 24) to (line 130, col 39) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3873 to 3879) SpanInfo: {"start":3874,"length":5} + >i = 0 + >:=> (line 130, col 51) to (line 130, col 56) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3880 to 3886) SpanInfo: {"start":3881,"length":5} + >i < 1 + >:=> (line 130, col 58) to (line 130, col 63) +130>for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3887 to 3894) SpanInfo: {"start":3888,"length":3} + >i++ + >:=> (line 130, col 65) to (line 130, col 68) +-------------------------------- +131> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3895 to 3918) SpanInfo: {"start":3899,"length":18} + >console.log(nameA) + >:=> (line 131, col 4) to (line 131, col 22) +-------------------------------- +132>} + + ~~ => Pos: (3919 to 3920) SpanInfo: {"start":3899,"length":18} + >console.log(nameA) + >:=> (line 131, col 4) to (line 131, col 22) +-------------------------------- +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3921 to 3943) SpanInfo: {"start":3928,"length":15} + >name = "noName" + >:=> (line 133, col 7) to (line 133, col 22) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3944 to 3975) SpanInfo: {"start":3945,"length":15} + >skill = "skill" + >:=> (line 133, col 24) to (line 133, col 39) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3976 to 3982) SpanInfo: {"start":3977,"length":5} + >i = 0 + >:=> (line 133, col 56) to (line 133, col 61) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3983 to 3989) SpanInfo: {"start":3984,"length":5} + >i < 1 + >:=> (line 133, col 63) to (line 133, col 68) +133>for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3990 to 3997) SpanInfo: {"start":3991,"length":3} + >i++ + >:=> (line 133, col 70) to (line 133, col 73) +-------------------------------- +134> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3998 to 4021) SpanInfo: {"start":4002,"length":18} + >console.log(nameA) + >:=> (line 134, col 4) to (line 134, col 22) +-------------------------------- +135>} + + ~~ => Pos: (4022 to 4023) SpanInfo: {"start":4002,"length":18} + >console.log(nameA) + >:=> (line 134, col 4) to (line 134, col 22) +-------------------------------- +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4024 to 4046) SpanInfo: {"start":4031,"length":15} + >name = "noName" + >:=> (line 136, col 7) to (line 136, col 22) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4047 to 4113) SpanInfo: {"start":4048,"length":15} + >skill = "skill" + >:=> (line 136, col 24) to (line 136, col 39) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (4114 to 4120) SpanInfo: {"start":4115,"length":5} + >i = 0 + >:=> (line 136, col 91) to (line 136, col 96) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (4121 to 4127) SpanInfo: {"start":4122,"length":5} + >i < 1 + >:=> (line 136, col 98) to (line 136, col 103) +136>for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (4128 to 4135) SpanInfo: {"start":4129,"length":3} + >i++ + >:=> (line 136, col 105) to (line 136, col 108) +-------------------------------- +137> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4136 to 4159) SpanInfo: {"start":4140,"length":18} + >console.log(nameA) + >:=> (line 137, col 4) to (line 137, col 22) +-------------------------------- +138>} + + ~~ => Pos: (4160 to 4161) SpanInfo: {"start":4140,"length":18} + >console.log(nameA) + >:=> (line 137, col 4) to (line 137, col 22) +-------------------------------- +139>for ({ + + ~~~~~~~ => Pos: (4162 to 4168) SpanInfo: {"start":4173,"length":15} + >name = "noName" + >:=> (line 140, col 4) to (line 140, col 19) +-------------------------------- +140> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4169 to 4189) SpanInfo: {"start":4173,"length":15} + >name = "noName" + >:=> (line 140, col 4) to (line 140, col 19) +-------------------------------- +141> skills: { + + ~~~~~~~~~~~ => Pos: (4190 to 4200) SpanInfo: {"start":4194,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 141, col 4) to (line 144, col 46) +141> skills: { + + ~~~ => Pos: (4201 to 4203) SpanInfo: {"start":4212,"length":19} + >primary = "primary" + >:=> (line 142, col 8) to (line 142, col 27) +-------------------------------- +142> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4204 to 4232) SpanInfo: {"start":4212,"length":19} + >primary = "primary" + >:=> (line 142, col 8) to (line 142, col 27) +-------------------------------- +143> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4233 to 4264) SpanInfo: {"start":4241,"length":23} + >secondary = "secondary" + >:=> (line 143, col 8) to (line 143, col 31) +-------------------------------- +144> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4265 to 4311) SpanInfo: {"start":4241,"length":23} + >secondary = "secondary" + >:=> (line 143, col 8) to (line 143, col 31) +-------------------------------- +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (4312 to 4326) SpanInfo: {"start":4194,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 141, col 4) to (line 144, col 46) +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4327 to 4333) SpanInfo: {"start":4328,"length":5} + >i = 0 + >:=> (line 145, col 16) to (line 145, col 21) +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4334 to 4340) SpanInfo: {"start":4335,"length":5} + >i < 1 + >:=> (line 145, col 23) to (line 145, col 28) +145>} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (4341 to 4348) SpanInfo: {"start":4342,"length":3} + >i++ + >:=> (line 145, col 30) to (line 145, col 33) +-------------------------------- +146> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4349 to 4375) SpanInfo: {"start":4353,"length":21} + >console.log(primaryA) + >:=> (line 146, col 4) to (line 146, col 25) +-------------------------------- +147>} + + ~~ => Pos: (4376 to 4377) SpanInfo: {"start":4353,"length":21} + >console.log(primaryA) + >:=> (line 146, col 4) to (line 146, col 25) +-------------------------------- +148>for ({ + + ~~~~~~~ => Pos: (4378 to 4384) SpanInfo: {"start":4389,"length":15} + >name = "noName" + >:=> (line 149, col 4) to (line 149, col 19) +-------------------------------- +149> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4385 to 4405) SpanInfo: {"start":4389,"length":15} + >name = "noName" + >:=> (line 149, col 4) to (line 149, col 19) +-------------------------------- +150> skills: { + + ~~~~~~~~~~~ => Pos: (4406 to 4416) SpanInfo: {"start":4410,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 150, col 4) to (line 153, col 46) +150> skills: { + + ~~~ => Pos: (4417 to 4419) SpanInfo: {"start":4428,"length":19} + >primary = "primary" + >:=> (line 151, col 8) to (line 151, col 27) +-------------------------------- +151> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4420 to 4448) SpanInfo: {"start":4428,"length":19} + >primary = "primary" + >:=> (line 151, col 8) to (line 151, col 27) +-------------------------------- +152> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4449 to 4480) SpanInfo: {"start":4457,"length":23} + >secondary = "secondary" + >:=> (line 152, col 8) to (line 152, col 31) +-------------------------------- +153> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4481 to 4527) SpanInfo: {"start":4457,"length":23} + >secondary = "secondary" + >:=> (line 152, col 8) to (line 152, col 31) +-------------------------------- +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (4528 to 4547) SpanInfo: {"start":4410,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 150, col 4) to (line 153, col 46) +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4548 to 4554) SpanInfo: {"start":4549,"length":5} + >i = 0 + >:=> (line 154, col 21) to (line 154, col 26) +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4555 to 4561) SpanInfo: {"start":4556,"length":5} + >i < 1 + >:=> (line 154, col 28) to (line 154, col 33) +154>} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (4562 to 4569) SpanInfo: {"start":4563,"length":3} + >i++ + >:=> (line 154, col 35) to (line 154, col 38) +-------------------------------- +155> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4570 to 4596) SpanInfo: {"start":4574,"length":21} + >console.log(primaryA) + >:=> (line 155, col 4) to (line 155, col 25) +-------------------------------- +156>} + + ~~ => Pos: (4597 to 4598) SpanInfo: {"start":4574,"length":21} + >console.log(primaryA) + >:=> (line 155, col 4) to (line 155, col 25) +-------------------------------- +157>for ({ + + ~~~~~~~ => Pos: (4599 to 4605) SpanInfo: {"start":4610,"length":15} + >name = "noName" + >:=> (line 158, col 4) to (line 158, col 19) +-------------------------------- +158> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4606 to 4626) SpanInfo: {"start":4610,"length":15} + >name = "noName" + >:=> (line 158, col 4) to (line 158, col 19) +-------------------------------- +159> skills: { + + ~~~~~~~~~~~ => Pos: (4627 to 4637) SpanInfo: {"start":4631,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 159, col 4) to (line 162, col 46) +159> skills: { + + ~~~ => Pos: (4638 to 4640) SpanInfo: {"start":4649,"length":19} + >primary = "primary" + >:=> (line 160, col 8) to (line 160, col 27) +-------------------------------- +160> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4641 to 4669) SpanInfo: {"start":4649,"length":19} + >primary = "primary" + >:=> (line 160, col 8) to (line 160, col 27) +-------------------------------- +161> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4670 to 4701) SpanInfo: {"start":4678,"length":23} + >secondary = "secondary" + >:=> (line 161, col 8) to (line 161, col 31) +-------------------------------- +162> } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4702 to 4748) SpanInfo: {"start":4678,"length":23} + >secondary = "secondary" + >:=> (line 161, col 8) to (line 161, col 31) +-------------------------------- +163>} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4749 to 4839) SpanInfo: {"start":4631,"length":117} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 159, col 4) to (line 162, col 46) +-------------------------------- +164> i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (4840 to 4849) SpanInfo: {"start":4844,"length":5} + >i = 0 + >:=> (line 164, col 4) to (line 164, col 9) +164> i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (4850 to 4856) SpanInfo: {"start":4851,"length":5} + >i < 1 + >:=> (line 164, col 11) to (line 164, col 16) +164> i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (4857 to 4864) SpanInfo: {"start":4858,"length":3} + >i++ + >:=> (line 164, col 18) to (line 164, col 21) +-------------------------------- +165> console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4865 to 4891) SpanInfo: {"start":4869,"length":21} + >console.log(primaryA) + >:=> (line 165, col 4) to (line 165, col 25) +-------------------------------- +166>} + ~ => Pos: (4892 to 4892) SpanInfo: {"start":4869,"length":21} + >console.log(primaryA) + >:=> (line 165, col 4) to (line 165, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPattern.baseline new file mode 100644 index 00000000000..16f6039031e --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPattern.baseline @@ -0,0 +1,779 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (547 to 613) SpanInfo: undefined +-------------------------------- +19 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (614 to 649) SpanInfo: undefined +-------------------------------- +20 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (650 to 720) SpanInfo: undefined +-------------------------------- +21 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (721 to 823) SpanInfo: undefined +-------------------------------- +22 >for ([, nameA] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (824 to 837) SpanInfo: {"start":832,"length":5} + >nameA + >:=> (line 22, col 8) to (line 22, col 13) +22 >for ([, nameA] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (838 to 851) SpanInfo: {"start":842,"length":6} + >robots + >:=> (line 22, col 18) to (line 22, col 24) +-------------------------------- +23 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (852 to 875) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +24 >} + + ~~ => Pos: (876 to 877) SpanInfo: {"start":856,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +25 >for ([, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (878 to 891) SpanInfo: {"start":886,"length":5} + >nameA + >:=> (line 25, col 8) to (line 25, col 13) +25 >for ([, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (892 to 910) SpanInfo: {"start":896,"length":11} + >getRobots() + >:=> (line 25, col 18) to (line 25, col 29) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (911 to 934) SpanInfo: {"start":915,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (935 to 936) SpanInfo: {"start":915,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ([, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~ => Pos: (937 to 950) SpanInfo: {"start":945,"length":5} + >nameA + >:=> (line 28, col 8) to (line 28, col 13) +28 >for ([, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (951 to 974) SpanInfo: {"start":955,"length":16} + >[robotA, robotB] + >:=> (line 28, col 18) to (line 28, col 34) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (975 to 998) SpanInfo: {"start":979,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (999 to 1000) SpanInfo: {"start":979,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1001 to 1023) SpanInfo: {"start":1010,"length":13} + >primarySkillA + >:=> (line 31, col 9) to (line 31, col 22) +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1024 to 1040) SpanInfo: {"start":1025,"length":15} + >secondarySkillA + >:=> (line 31, col 24) to (line 31, col 39) +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~ => Pos: (1041 to 1041) SpanInfo: {"start":1009,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 31, col 8) to (line 31, col 40) +31 >for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1042 to 1060) SpanInfo: {"start":1046,"length":11} + >multiRobots + >:=> (line 31, col 45) to (line 31, col 56) +-------------------------------- +32 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1061 to 1092) SpanInfo: {"start":1065,"length":26} + >console.log(primarySkillA) + >:=> (line 32, col 4) to (line 32, col 30) +-------------------------------- +33 >} + + ~~ => Pos: (1093 to 1094) SpanInfo: {"start":1065,"length":26} + >console.log(primarySkillA) + >:=> (line 32, col 4) to (line 32, col 30) +-------------------------------- +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1095 to 1117) SpanInfo: {"start":1104,"length":13} + >primarySkillA + >:=> (line 34, col 9) to (line 34, col 22) +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1118 to 1134) SpanInfo: {"start":1119,"length":15} + >secondarySkillA + >:=> (line 34, col 24) to (line 34, col 39) +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~ => Pos: (1135 to 1135) SpanInfo: {"start":1103,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 34, col 8) to (line 34, col 40) +34 >for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1136 to 1159) SpanInfo: {"start":1140,"length":16} + >getMultiRobots() + >:=> (line 34, col 45) to (line 34, col 61) +-------------------------------- +35 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1160 to 1191) SpanInfo: {"start":1164,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +36 >} + + ~~ => Pos: (1192 to 1193) SpanInfo: {"start":1164,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1194 to 1216) SpanInfo: {"start":1203,"length":13} + >primarySkillA + >:=> (line 37, col 9) to (line 37, col 22) +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1217 to 1233) SpanInfo: {"start":1218,"length":15} + >secondarySkillA + >:=> (line 37, col 24) to (line 37, col 39) +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (1234 to 1234) SpanInfo: {"start":1202,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 37, col 8) to (line 37, col 40) +37 >for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1235 to 1268) SpanInfo: {"start":1239,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 37, col 45) to (line 37, col 71) +-------------------------------- +38 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1269 to 1300) SpanInfo: {"start":1273,"length":26} + >console.log(primarySkillA) + >:=> (line 38, col 4) to (line 38, col 30) +-------------------------------- +39 >} + + ~~ => Pos: (1301 to 1302) SpanInfo: {"start":1273,"length":26} + >console.log(primarySkillA) + >:=> (line 38, col 4) to (line 38, col 30) +-------------------------------- +40 >for ([numberB] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1303 to 1316) SpanInfo: {"start":1309,"length":7} + >numberB + >:=> (line 40, col 6) to (line 40, col 13) +40 >for ([numberB] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1317 to 1330) SpanInfo: {"start":1321,"length":6} + >robots + >:=> (line 40, col 18) to (line 40, col 24) +-------------------------------- +41 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1331 to 1356) SpanInfo: {"start":1335,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +42 >} + + ~~ => Pos: (1357 to 1358) SpanInfo: {"start":1335,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +43 >for ([numberB] of getRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (1359 to 1372) SpanInfo: {"start":1365,"length":7} + >numberB + >:=> (line 43, col 6) to (line 43, col 13) +43 >for ([numberB] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1373 to 1391) SpanInfo: {"start":1377,"length":11} + >getRobots() + >:=> (line 43, col 18) to (line 43, col 29) +-------------------------------- +44 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1392 to 1417) SpanInfo: {"start":1396,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +45 >} + + ~~ => Pos: (1418 to 1419) SpanInfo: {"start":1396,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +46 >for ([numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~ => Pos: (1420 to 1433) SpanInfo: {"start":1426,"length":7} + >numberB + >:=> (line 46, col 6) to (line 46, col 13) +46 >for ([numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1434 to 1457) SpanInfo: {"start":1438,"length":16} + >[robotA, robotB] + >:=> (line 46, col 18) to (line 46, col 34) +-------------------------------- +47 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1458 to 1483) SpanInfo: {"start":1462,"length":20} + >console.log(numberB) + >:=> (line 47, col 4) to (line 47, col 24) +-------------------------------- +48 >} + + ~~ => Pos: (1484 to 1485) SpanInfo: {"start":1462,"length":20} + >console.log(numberB) + >:=> (line 47, col 4) to (line 47, col 24) +-------------------------------- +49 >for ([nameB] of multiRobots) { + + ~~~~~~~~~~~~ => Pos: (1486 to 1497) SpanInfo: {"start":1492,"length":5} + >nameB + >:=> (line 49, col 6) to (line 49, col 11) +49 >for ([nameB] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1498 to 1516) SpanInfo: {"start":1502,"length":11} + >multiRobots + >:=> (line 49, col 16) to (line 49, col 27) +-------------------------------- +50 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1517 to 1540) SpanInfo: {"start":1521,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1541 to 1542) SpanInfo: {"start":1521,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for ([nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~ => Pos: (1543 to 1554) SpanInfo: {"start":1549,"length":5} + >nameB + >:=> (line 52, col 6) to (line 52, col 11) +52 >for ([nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1555 to 1578) SpanInfo: {"start":1559,"length":16} + >getMultiRobots() + >:=> (line 52, col 16) to (line 52, col 32) +-------------------------------- +53 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1579 to 1602) SpanInfo: {"start":1583,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1603 to 1604) SpanInfo: {"start":1583,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 >for ([nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~ => Pos: (1605 to 1616) SpanInfo: {"start":1611,"length":5} + >nameB + >:=> (line 55, col 6) to (line 55, col 11) +55 >for ([nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1617 to 1650) SpanInfo: {"start":1621,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 55, col 16) to (line 55, col 42) +-------------------------------- +56 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1651 to 1674) SpanInfo: {"start":1655,"length":18} + >console.log(nameB) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +57 >} + + ~~ => Pos: (1675 to 1676) SpanInfo: {"start":1655,"length":18} + >console.log(nameB) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (1677 to 1691) SpanInfo: {"start":1683,"length":8} + >numberA2 + >:=> (line 58, col 6) to (line 58, col 14) +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~ => Pos: (1692 to 1699) SpanInfo: {"start":1693,"length":6} + >nameA2 + >:=> (line 58, col 16) to (line 58, col 22) +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~ => Pos: (1700 to 1708) SpanInfo: {"start":1701,"length":7} + >skillA2 + >:=> (line 58, col 24) to (line 58, col 31) +58 >for ([numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1709 to 1722) SpanInfo: {"start":1713,"length":6} + >robots + >:=> (line 58, col 36) to (line 58, col 42) +-------------------------------- +59 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1723 to 1747) SpanInfo: {"start":1727,"length":19} + >console.log(nameA2) + >:=> (line 59, col 4) to (line 59, col 23) +-------------------------------- +60 >} + + ~~ => Pos: (1748 to 1749) SpanInfo: {"start":1727,"length":19} + >console.log(nameA2) + >:=> (line 59, col 4) to (line 59, col 23) +-------------------------------- +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (1750 to 1764) SpanInfo: {"start":1756,"length":8} + >numberA2 + >:=> (line 61, col 6) to (line 61, col 14) +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~ => Pos: (1765 to 1772) SpanInfo: {"start":1766,"length":6} + >nameA2 + >:=> (line 61, col 16) to (line 61, col 22) +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~ => Pos: (1773 to 1781) SpanInfo: {"start":1774,"length":7} + >skillA2 + >:=> (line 61, col 24) to (line 61, col 31) +61 >for ([numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1782 to 1800) SpanInfo: {"start":1786,"length":11} + >getRobots() + >:=> (line 61, col 36) to (line 61, col 47) +-------------------------------- +62 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1801 to 1825) SpanInfo: {"start":1805,"length":19} + >console.log(nameA2) + >:=> (line 62, col 4) to (line 62, col 23) +-------------------------------- +63 >} + + ~~ => Pos: (1826 to 1827) SpanInfo: {"start":1805,"length":19} + >console.log(nameA2) + >:=> (line 62, col 4) to (line 62, col 23) +-------------------------------- +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (1828 to 1842) SpanInfo: {"start":1834,"length":8} + >numberA2 + >:=> (line 64, col 6) to (line 64, col 14) +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~ => Pos: (1843 to 1850) SpanInfo: {"start":1844,"length":6} + >nameA2 + >:=> (line 64, col 16) to (line 64, col 22) +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~ => Pos: (1851 to 1859) SpanInfo: {"start":1852,"length":7} + >skillA2 + >:=> (line 64, col 24) to (line 64, col 31) +64 >for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1860 to 1883) SpanInfo: {"start":1864,"length":16} + >[robotA, robotB] + >:=> (line 64, col 36) to (line 64, col 52) +-------------------------------- +65 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1884 to 1908) SpanInfo: {"start":1888,"length":19} + >console.log(nameA2) + >:=> (line 65, col 4) to (line 65, col 23) +-------------------------------- +66 >} + + ~~ => Pos: (1909 to 1910) SpanInfo: {"start":1888,"length":19} + >console.log(nameA2) + >:=> (line 65, col 4) to (line 65, col 23) +-------------------------------- +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~ => Pos: (1911 to 1923) SpanInfo: {"start":1917,"length":6} + >nameMA + >:=> (line 67, col 6) to (line 67, col 12) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1924 to 1939) SpanInfo: {"start":1926,"length":13} + >primarySkillA + >:=> (line 67, col 15) to (line 67, col 28) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1940 to 1956) SpanInfo: {"start":1941,"length":15} + >secondarySkillA + >:=> (line 67, col 30) to (line 67, col 45) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~=> Pos: (1957 to 1957) SpanInfo: {"start":1925,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 67, col 14) to (line 67, col 46) +67 >for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1958 to 1976) SpanInfo: {"start":1962,"length":11} + >multiRobots + >:=> (line 67, col 51) to (line 67, col 62) +-------------------------------- +68 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1977 to 2001) SpanInfo: {"start":1981,"length":19} + >console.log(nameMA) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +69 >} + + ~~ => Pos: (2002 to 2003) SpanInfo: {"start":1981,"length":19} + >console.log(nameMA) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~ => Pos: (2004 to 2016) SpanInfo: {"start":2010,"length":6} + >nameMA + >:=> (line 70, col 6) to (line 70, col 12) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (2017 to 2032) SpanInfo: {"start":2019,"length":13} + >primarySkillA + >:=> (line 70, col 15) to (line 70, col 28) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2033 to 2049) SpanInfo: {"start":2034,"length":15} + >secondarySkillA + >:=> (line 70, col 30) to (line 70, col 45) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~=> Pos: (2050 to 2050) SpanInfo: {"start":2018,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 70, col 14) to (line 70, col 46) +70 >for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2051 to 2074) SpanInfo: {"start":2055,"length":16} + >getMultiRobots() + >:=> (line 70, col 51) to (line 70, col 67) +-------------------------------- +71 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2075 to 2099) SpanInfo: {"start":2079,"length":19} + >console.log(nameMA) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +72 >} + + ~~ => Pos: (2100 to 2101) SpanInfo: {"start":2079,"length":19} + >console.log(nameMA) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~ => Pos: (2102 to 2114) SpanInfo: {"start":2108,"length":6} + >nameMA + >:=> (line 73, col 6) to (line 73, col 12) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (2115 to 2130) SpanInfo: {"start":2117,"length":13} + >primarySkillA + >:=> (line 73, col 15) to (line 73, col 28) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2131 to 2147) SpanInfo: {"start":2132,"length":15} + >secondarySkillA + >:=> (line 73, col 30) to (line 73, col 45) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~=> Pos: (2148 to 2148) SpanInfo: {"start":2116,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 73, col 14) to (line 73, col 46) +73 >for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2149 to 2182) SpanInfo: {"start":2153,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 73, col 51) to (line 73, col 77) +-------------------------------- +74 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2183 to 2207) SpanInfo: {"start":2187,"length":19} + >console.log(nameMA) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +75 >} + + ~~ => Pos: (2208 to 2209) SpanInfo: {"start":2187,"length":19} + >console.log(nameMA) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +76 >for ([numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2210 to 2224) SpanInfo: {"start":2216,"length":8} + >numberA3 + >:=> (line 76, col 6) to (line 76, col 14) +76 >for ([numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2225 to 2239) SpanInfo: {"start":2226,"length":13} + >...robotAInfo + >:=> (line 76, col 16) to (line 76, col 29) +76 >for ([numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (2240 to 2253) SpanInfo: {"start":2244,"length":6} + >robots + >:=> (line 76, col 34) to (line 76, col 40) +-------------------------------- +77 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2254 to 2280) SpanInfo: {"start":2258,"length":21} + >console.log(numberA3) + >:=> (line 77, col 4) to (line 77, col 25) +-------------------------------- +78 >} + + ~~ => Pos: (2281 to 2282) SpanInfo: {"start":2258,"length":21} + >console.log(numberA3) + >:=> (line 77, col 4) to (line 77, col 25) +-------------------------------- +79 >for ([numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2283 to 2297) SpanInfo: {"start":2289,"length":8} + >numberA3 + >:=> (line 79, col 6) to (line 79, col 14) +79 >for ([numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2298 to 2312) SpanInfo: {"start":2299,"length":13} + >...robotAInfo + >:=> (line 79, col 16) to (line 79, col 29) +79 >for ([numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2313 to 2331) SpanInfo: {"start":2317,"length":11} + >getRobots() + >:=> (line 79, col 34) to (line 79, col 45) +-------------------------------- +80 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2332 to 2358) SpanInfo: {"start":2336,"length":21} + >console.log(numberA3) + >:=> (line 80, col 4) to (line 80, col 25) +-------------------------------- +81 >} + + ~~ => Pos: (2359 to 2360) SpanInfo: {"start":2336,"length":21} + >console.log(numberA3) + >:=> (line 80, col 4) to (line 80, col 25) +-------------------------------- +82 >for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2361 to 2375) SpanInfo: {"start":2367,"length":8} + >numberA3 + >:=> (line 82, col 6) to (line 82, col 14) +82 >for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2376 to 2390) SpanInfo: {"start":2377,"length":13} + >...robotAInfo + >:=> (line 82, col 16) to (line 82, col 29) +82 >for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2391 to 2414) SpanInfo: {"start":2395,"length":16} + >[robotA, robotB] + >:=> (line 82, col 34) to (line 82, col 50) +-------------------------------- +83 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2415 to 2441) SpanInfo: {"start":2419,"length":21} + >console.log(numberA3) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +84 >} + + ~~ => Pos: (2442 to 2443) SpanInfo: {"start":2419,"length":21} + >console.log(numberA3) + >:=> (line 83, col 4) to (line 83, col 25) +-------------------------------- +85 >for ([...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2444 to 2468) SpanInfo: {"start":2450,"length":18} + >...multiRobotAInfo + >:=> (line 85, col 6) to (line 85, col 24) +85 >for ([...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2469 to 2487) SpanInfo: {"start":2473,"length":11} + >multiRobots + >:=> (line 85, col 29) to (line 85, col 40) +-------------------------------- +86 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2488 to 2521) SpanInfo: {"start":2492,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 86, col 4) to (line 86, col 32) +-------------------------------- +87 >} + + ~~ => Pos: (2522 to 2523) SpanInfo: {"start":2492,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 86, col 4) to (line 86, col 32) +-------------------------------- +88 >for ([...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2524 to 2548) SpanInfo: {"start":2530,"length":18} + >...multiRobotAInfo + >:=> (line 88, col 6) to (line 88, col 24) +88 >for ([...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2549 to 2572) SpanInfo: {"start":2553,"length":16} + >getMultiRobots() + >:=> (line 88, col 29) to (line 88, col 45) +-------------------------------- +89 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2573 to 2606) SpanInfo: {"start":2577,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 89, col 4) to (line 89, col 32) +-------------------------------- +90 >} + + ~~ => Pos: (2607 to 2608) SpanInfo: {"start":2577,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 89, col 4) to (line 89, col 32) +-------------------------------- +91 >for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2609 to 2633) SpanInfo: {"start":2615,"length":18} + >...multiRobotAInfo + >:=> (line 91, col 6) to (line 91, col 24) +91 >for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2634 to 2667) SpanInfo: {"start":2638,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 91, col 29) to (line 91, col 55) +-------------------------------- +92 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2668 to 2701) SpanInfo: {"start":2672,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 92, col 4) to (line 92, col 32) +-------------------------------- +93 >} + ~ => Pos: (2702 to 2702) SpanInfo: {"start":2672,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 92, col 4) to (line 92, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..c7e2f005833 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,806 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >let nameA: string, primarySkillA: string, secondarySkillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (547 to 613) SpanInfo: undefined +-------------------------------- +19 >let numberB: number, nameB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (614 to 649) SpanInfo: undefined +-------------------------------- +20 >let numberA2: number, nameA2: string, skillA2: string, nameMA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (650 to 720) SpanInfo: undefined +-------------------------------- +21 >let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (721 to 823) SpanInfo: undefined +-------------------------------- +22 >for ([, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (824 to 848) SpanInfo: {"start":832,"length":16} + >nameA = "noName" + >:=> (line 22, col 8) to (line 22, col 24) +22 >for ([, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (849 to 862) SpanInfo: {"start":853,"length":6} + >robots + >:=> (line 22, col 29) to (line 22, col 35) +-------------------------------- +23 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (863 to 886) SpanInfo: {"start":867,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +24 >} + + ~~ => Pos: (887 to 888) SpanInfo: {"start":867,"length":18} + >console.log(nameA) + >:=> (line 23, col 4) to (line 23, col 22) +-------------------------------- +25 >for ([, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (889 to 913) SpanInfo: {"start":897,"length":16} + >nameA = "noName" + >:=> (line 25, col 8) to (line 25, col 24) +25 >for ([, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (914 to 932) SpanInfo: {"start":918,"length":11} + >getRobots() + >:=> (line 25, col 29) to (line 25, col 40) +-------------------------------- +26 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (933 to 956) SpanInfo: {"start":937,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + + ~~ => Pos: (957 to 958) SpanInfo: {"start":937,"length":18} + >console.log(nameA) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +28 >for ([, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (959 to 983) SpanInfo: {"start":967,"length":16} + >nameA = "noName" + >:=> (line 28, col 8) to (line 28, col 24) +28 >for ([, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (984 to 1007) SpanInfo: {"start":988,"length":16} + >[robotA, robotB] + >:=> (line 28, col 29) to (line 28, col 45) +-------------------------------- +29 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1008 to 1031) SpanInfo: {"start":1012,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +30 >} + + ~~ => Pos: (1032 to 1033) SpanInfo: {"start":1012,"length":18} + >console.log(nameA) + >:=> (line 29, col 4) to (line 29, col 22) +-------------------------------- +31 >for ([, [ + + ~~~~~~~~~~ => Pos: (1034 to 1043) SpanInfo: {"start":1048,"length":25} + >primarySkillA = "primary" + >:=> (line 32, col 4) to (line 32, col 29) +-------------------------------- +32 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1044 to 1074) SpanInfo: {"start":1048,"length":25} + >primarySkillA = "primary" + >:=> (line 32, col 4) to (line 32, col 29) +-------------------------------- +33 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1075 to 1108) SpanInfo: {"start":1079,"length":29} + >secondarySkillA = "secondary" + >:=> (line 33, col 4) to (line 33, col 33) +-------------------------------- +34 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1109 to 1132) SpanInfo: {"start":1079,"length":29} + >secondarySkillA = "secondary" + >:=> (line 33, col 4) to (line 33, col 33) +34 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (1133 to 1133) SpanInfo: {"start":1042,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 31, col 8) to (line 34, col 24) +34 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1134 to 1152) SpanInfo: {"start":1138,"length":11} + >multiRobots + >:=> (line 34, col 29) to (line 34, col 40) +-------------------------------- +35 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1153 to 1184) SpanInfo: {"start":1157,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +36 >} + + ~~ => Pos: (1185 to 1186) SpanInfo: {"start":1157,"length":26} + >console.log(primarySkillA) + >:=> (line 35, col 4) to (line 35, col 30) +-------------------------------- +37 >for ([, [ + + ~~~~~~~~~~ => Pos: (1187 to 1196) SpanInfo: {"start":1201,"length":25} + >primarySkillA = "primary" + >:=> (line 38, col 4) to (line 38, col 29) +-------------------------------- +38 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1197 to 1227) SpanInfo: {"start":1201,"length":25} + >primarySkillA = "primary" + >:=> (line 38, col 4) to (line 38, col 29) +-------------------------------- +39 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1228 to 1261) SpanInfo: {"start":1232,"length":29} + >secondarySkillA = "secondary" + >:=> (line 39, col 4) to (line 39, col 33) +-------------------------------- +40 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1262 to 1285) SpanInfo: {"start":1232,"length":29} + >secondarySkillA = "secondary" + >:=> (line 39, col 4) to (line 39, col 33) +40 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (1286 to 1286) SpanInfo: {"start":1195,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 37, col 8) to (line 40, col 24) +40 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1287 to 1310) SpanInfo: {"start":1291,"length":16} + >getMultiRobots() + >:=> (line 40, col 29) to (line 40, col 45) +-------------------------------- +41 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1311 to 1342) SpanInfo: {"start":1315,"length":26} + >console.log(primarySkillA) + >:=> (line 41, col 4) to (line 41, col 30) +-------------------------------- +42 >} + + ~~ => Pos: (1343 to 1344) SpanInfo: {"start":1315,"length":26} + >console.log(primarySkillA) + >:=> (line 41, col 4) to (line 41, col 30) +-------------------------------- +43 >for ([, [ + + ~~~~~~~~~~ => Pos: (1345 to 1354) SpanInfo: {"start":1359,"length":25} + >primarySkillA = "primary" + >:=> (line 44, col 4) to (line 44, col 29) +-------------------------------- +44 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1355 to 1385) SpanInfo: {"start":1359,"length":25} + >primarySkillA = "primary" + >:=> (line 44, col 4) to (line 44, col 29) +-------------------------------- +45 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1386 to 1419) SpanInfo: {"start":1390,"length":29} + >secondarySkillA = "secondary" + >:=> (line 45, col 4) to (line 45, col 33) +-------------------------------- +46 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1420 to 1443) SpanInfo: {"start":1390,"length":29} + >secondarySkillA = "secondary" + >:=> (line 45, col 4) to (line 45, col 33) +46 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (1444 to 1444) SpanInfo: {"start":1353,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 43, col 8) to (line 46, col 24) +46 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1445 to 1478) SpanInfo: {"start":1449,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 46, col 29) to (line 46, col 55) +-------------------------------- +47 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1479 to 1510) SpanInfo: {"start":1483,"length":26} + >console.log(primarySkillA) + >:=> (line 47, col 4) to (line 47, col 30) +-------------------------------- +48 >} + + ~~ => Pos: (1511 to 1512) SpanInfo: {"start":1483,"length":26} + >console.log(primarySkillA) + >:=> (line 47, col 4) to (line 47, col 30) +-------------------------------- +49 >for ([numberB = -1] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1513 to 1531) SpanInfo: {"start":1519,"length":12} + >numberB = -1 + >:=> (line 49, col 6) to (line 49, col 18) +49 >for ([numberB = -1] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1532 to 1545) SpanInfo: {"start":1536,"length":6} + >robots + >:=> (line 49, col 23) to (line 49, col 29) +-------------------------------- +50 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1546 to 1571) SpanInfo: {"start":1550,"length":20} + >console.log(numberB) + >:=> (line 50, col 4) to (line 50, col 24) +-------------------------------- +51 >} + + ~~ => Pos: (1572 to 1573) SpanInfo: {"start":1550,"length":20} + >console.log(numberB) + >:=> (line 50, col 4) to (line 50, col 24) +-------------------------------- +52 >for ([numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1574 to 1592) SpanInfo: {"start":1580,"length":12} + >numberB = -1 + >:=> (line 52, col 6) to (line 52, col 18) +52 >for ([numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1593 to 1611) SpanInfo: {"start":1597,"length":11} + >getRobots() + >:=> (line 52, col 23) to (line 52, col 34) +-------------------------------- +53 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1612 to 1637) SpanInfo: {"start":1616,"length":20} + >console.log(numberB) + >:=> (line 53, col 4) to (line 53, col 24) +-------------------------------- +54 >} + + ~~ => Pos: (1638 to 1639) SpanInfo: {"start":1616,"length":20} + >console.log(numberB) + >:=> (line 53, col 4) to (line 53, col 24) +-------------------------------- +55 >for ([numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1640 to 1658) SpanInfo: {"start":1646,"length":12} + >numberB = -1 + >:=> (line 55, col 6) to (line 55, col 18) +55 >for ([numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1659 to 1682) SpanInfo: {"start":1663,"length":16} + >[robotA, robotB] + >:=> (line 55, col 23) to (line 55, col 39) +-------------------------------- +56 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1683 to 1708) SpanInfo: {"start":1687,"length":20} + >console.log(numberB) + >:=> (line 56, col 4) to (line 56, col 24) +-------------------------------- +57 >} + + ~~ => Pos: (1709 to 1710) SpanInfo: {"start":1687,"length":20} + >console.log(numberB) + >:=> (line 56, col 4) to (line 56, col 24) +-------------------------------- +58 >for ([nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1711 to 1733) SpanInfo: {"start":1717,"length":16} + >nameB = "noName" + >:=> (line 58, col 6) to (line 58, col 22) +58 >for ([nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1734 to 1752) SpanInfo: {"start":1738,"length":11} + >multiRobots + >:=> (line 58, col 27) to (line 58, col 38) +-------------------------------- +59 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1753 to 1776) SpanInfo: {"start":1757,"length":18} + >console.log(nameB) + >:=> (line 59, col 4) to (line 59, col 22) +-------------------------------- +60 >} + + ~~ => Pos: (1777 to 1778) SpanInfo: {"start":1757,"length":18} + >console.log(nameB) + >:=> (line 59, col 4) to (line 59, col 22) +-------------------------------- +61 >for ([nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1779 to 1801) SpanInfo: {"start":1785,"length":16} + >nameB = "noName" + >:=> (line 61, col 6) to (line 61, col 22) +61 >for ([nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1802 to 1825) SpanInfo: {"start":1806,"length":16} + >getMultiRobots() + >:=> (line 61, col 27) to (line 61, col 43) +-------------------------------- +62 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1826 to 1849) SpanInfo: {"start":1830,"length":18} + >console.log(nameB) + >:=> (line 62, col 4) to (line 62, col 22) +-------------------------------- +63 >} + + ~~ => Pos: (1850 to 1851) SpanInfo: {"start":1830,"length":18} + >console.log(nameB) + >:=> (line 62, col 4) to (line 62, col 22) +-------------------------------- +64 >for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1852 to 1874) SpanInfo: {"start":1858,"length":16} + >nameB = "noName" + >:=> (line 64, col 6) to (line 64, col 22) +64 >for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1875 to 1908) SpanInfo: {"start":1879,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 64, col 27) to (line 64, col 53) +-------------------------------- +65 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1909 to 1932) SpanInfo: {"start":1913,"length":18} + >console.log(nameB) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +66 >} + + ~~ => Pos: (1933 to 1934) SpanInfo: {"start":1913,"length":18} + >console.log(nameB) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1935 to 1954) SpanInfo: {"start":1941,"length":13} + >numberA2 = -1 + >:=> (line 67, col 6) to (line 67, col 19) +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1955 to 1973) SpanInfo: {"start":1956,"length":17} + >nameA2 = "noName" + >:=> (line 67, col 21) to (line 67, col 38) +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1974 to 1992) SpanInfo: {"start":1975,"length":17} + >skillA2 = "skill" + >:=> (line 67, col 40) to (line 67, col 57) +67 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1993 to 2006) SpanInfo: {"start":1997,"length":6} + >robots + >:=> (line 67, col 62) to (line 67, col 68) +-------------------------------- +68 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2007 to 2031) SpanInfo: {"start":2011,"length":19} + >console.log(nameA2) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +69 >} + + ~~ => Pos: (2032 to 2033) SpanInfo: {"start":2011,"length":19} + >console.log(nameA2) + >:=> (line 68, col 4) to (line 68, col 23) +-------------------------------- +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2034 to 2053) SpanInfo: {"start":2040,"length":13} + >numberA2 = -1 + >:=> (line 70, col 6) to (line 70, col 19) +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2054 to 2072) SpanInfo: {"start":2055,"length":17} + >nameA2 = "noName" + >:=> (line 70, col 21) to (line 70, col 38) +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2073 to 2091) SpanInfo: {"start":2074,"length":17} + >skillA2 = "skill" + >:=> (line 70, col 40) to (line 70, col 57) +70 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2092 to 2110) SpanInfo: {"start":2096,"length":11} + >getRobots() + >:=> (line 70, col 62) to (line 70, col 73) +-------------------------------- +71 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2111 to 2135) SpanInfo: {"start":2115,"length":19} + >console.log(nameA2) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +72 >} + + ~~ => Pos: (2136 to 2137) SpanInfo: {"start":2115,"length":19} + >console.log(nameA2) + >:=> (line 71, col 4) to (line 71, col 23) +-------------------------------- +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2138 to 2157) SpanInfo: {"start":2144,"length":13} + >numberA2 = -1 + >:=> (line 73, col 6) to (line 73, col 19) +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2158 to 2176) SpanInfo: {"start":2159,"length":17} + >nameA2 = "noName" + >:=> (line 73, col 21) to (line 73, col 38) +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2177 to 2195) SpanInfo: {"start":2178,"length":17} + >skillA2 = "skill" + >:=> (line 73, col 40) to (line 73, col 57) +73 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2196 to 2219) SpanInfo: {"start":2200,"length":16} + >[robotA, robotB] + >:=> (line 73, col 62) to (line 73, col 78) +-------------------------------- +74 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2220 to 2244) SpanInfo: {"start":2224,"length":19} + >console.log(nameA2) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +75 >} + + ~~ => Pos: (2245 to 2246) SpanInfo: {"start":2224,"length":19} + >console.log(nameA2) + >:=> (line 74, col 4) to (line 74, col 23) +-------------------------------- +76 >for ([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2247 to 2270) SpanInfo: {"start":2253,"length":17} + >nameMA = "noName" + >:=> (line 76, col 6) to (line 76, col 23) +76 >for ([nameMA = "noName", [ + + ~~~ => Pos: (2271 to 2273) SpanInfo: {"start":2278,"length":25} + >primarySkillA = "primary" + >:=> (line 77, col 4) to (line 77, col 29) +-------------------------------- +77 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2274 to 2304) SpanInfo: {"start":2278,"length":25} + >primarySkillA = "primary" + >:=> (line 77, col 4) to (line 77, col 29) +-------------------------------- +78 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2305 to 2338) SpanInfo: {"start":2309,"length":29} + >secondarySkillA = "secondary" + >:=> (line 78, col 4) to (line 78, col 33) +-------------------------------- +79 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2339 to 2362) SpanInfo: {"start":2309,"length":29} + >secondarySkillA = "secondary" + >:=> (line 78, col 4) to (line 78, col 33) +79 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (2363 to 2363) SpanInfo: {"start":2272,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 76, col 25) to (line 79, col 24) +79 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2364 to 2382) SpanInfo: {"start":2368,"length":11} + >multiRobots + >:=> (line 79, col 29) to (line 79, col 40) +-------------------------------- +80 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2383 to 2407) SpanInfo: {"start":2387,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +81 >} + + ~~ => Pos: (2408 to 2409) SpanInfo: {"start":2387,"length":19} + >console.log(nameMA) + >:=> (line 80, col 4) to (line 80, col 23) +-------------------------------- +82 >for ([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2410 to 2433) SpanInfo: {"start":2416,"length":17} + >nameMA = "noName" + >:=> (line 82, col 6) to (line 82, col 23) +82 >for ([nameMA = "noName", [ + + ~~~ => Pos: (2434 to 2436) SpanInfo: {"start":2441,"length":25} + >primarySkillA = "primary" + >:=> (line 83, col 4) to (line 83, col 29) +-------------------------------- +83 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2437 to 2467) SpanInfo: {"start":2441,"length":25} + >primarySkillA = "primary" + >:=> (line 83, col 4) to (line 83, col 29) +-------------------------------- +84 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2468 to 2501) SpanInfo: {"start":2472,"length":29} + >secondarySkillA = "secondary" + >:=> (line 84, col 4) to (line 84, col 33) +-------------------------------- +85 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2502 to 2525) SpanInfo: {"start":2472,"length":29} + >secondarySkillA = "secondary" + >:=> (line 84, col 4) to (line 84, col 33) +85 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (2526 to 2526) SpanInfo: {"start":2435,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 82, col 25) to (line 85, col 24) +85 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2527 to 2550) SpanInfo: {"start":2531,"length":16} + >getMultiRobots() + >:=> (line 85, col 29) to (line 85, col 45) +-------------------------------- +86 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2551 to 2575) SpanInfo: {"start":2555,"length":19} + >console.log(nameMA) + >:=> (line 86, col 4) to (line 86, col 23) +-------------------------------- +87 >} + + ~~ => Pos: (2576 to 2577) SpanInfo: {"start":2555,"length":19} + >console.log(nameMA) + >:=> (line 86, col 4) to (line 86, col 23) +-------------------------------- +88 >for ([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2578 to 2601) SpanInfo: {"start":2584,"length":17} + >nameMA = "noName" + >:=> (line 88, col 6) to (line 88, col 23) +88 >for ([nameMA = "noName", [ + + ~~~ => Pos: (2602 to 2604) SpanInfo: {"start":2609,"length":25} + >primarySkillA = "primary" + >:=> (line 89, col 4) to (line 89, col 29) +-------------------------------- +89 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2605 to 2635) SpanInfo: {"start":2609,"length":25} + >primarySkillA = "primary" + >:=> (line 89, col 4) to (line 89, col 29) +-------------------------------- +90 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2636 to 2669) SpanInfo: {"start":2640,"length":29} + >secondarySkillA = "secondary" + >:=> (line 90, col 4) to (line 90, col 33) +-------------------------------- +91 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2670 to 2693) SpanInfo: {"start":2640,"length":29} + >secondarySkillA = "secondary" + >:=> (line 90, col 4) to (line 90, col 33) +91 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (2694 to 2694) SpanInfo: {"start":2603,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 88, col 25) to (line 91, col 24) +91 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2695 to 2728) SpanInfo: {"start":2699,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 91, col 29) to (line 91, col 55) +-------------------------------- +92 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2729 to 2753) SpanInfo: {"start":2733,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +93 >} + + ~~ => Pos: (2754 to 2755) SpanInfo: {"start":2733,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +94 >for ([numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2756 to 2775) SpanInfo: {"start":2762,"length":13} + >numberA3 = -1 + >:=> (line 94, col 6) to (line 94, col 19) +94 >for ([numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2776 to 2790) SpanInfo: {"start":2777,"length":13} + >...robotAInfo + >:=> (line 94, col 21) to (line 94, col 34) +94 >for ([numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2791 to 2804) SpanInfo: {"start":2795,"length":6} + >robots + >:=> (line 94, col 39) to (line 94, col 45) +-------------------------------- +95 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2805 to 2831) SpanInfo: {"start":2809,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +96 >} + + ~~ => Pos: (2832 to 2833) SpanInfo: {"start":2809,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +97 >for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2834 to 2853) SpanInfo: {"start":2840,"length":13} + >numberA3 = -1 + >:=> (line 97, col 6) to (line 97, col 19) +97 >for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2854 to 2868) SpanInfo: {"start":2855,"length":13} + >...robotAInfo + >:=> (line 97, col 21) to (line 97, col 34) +97 >for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2869 to 2887) SpanInfo: {"start":2873,"length":11} + >getRobots() + >:=> (line 97, col 39) to (line 97, col 50) +-------------------------------- +98 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2888 to 2914) SpanInfo: {"start":2892,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +99 >} + + ~~ => Pos: (2915 to 2916) SpanInfo: {"start":2892,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +100>for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2917 to 2936) SpanInfo: {"start":2923,"length":13} + >numberA3 = -1 + >:=> (line 100, col 6) to (line 100, col 19) +100>for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2937 to 2951) SpanInfo: {"start":2938,"length":13} + >...robotAInfo + >:=> (line 100, col 21) to (line 100, col 34) +100>for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2952 to 2975) SpanInfo: {"start":2956,"length":16} + >[robotA, robotB] + >:=> (line 100, col 39) to (line 100, col 55) +-------------------------------- +101> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2976 to 3002) SpanInfo: {"start":2980,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) +-------------------------------- +102>} + ~ => Pos: (3003 to 3003) SpanInfo: {"start":2980,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPattern.baseline new file mode 100644 index 00000000000..b303f33026a --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPattern.baseline @@ -0,0 +1,943 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 322) SpanInfo: {"start":223,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (323 to 424) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (425 to 504) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (505 to 527) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (528 to 546) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (547 to 548) SpanInfo: {"start":547,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 576) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (577 to 600) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (601 to 602) SpanInfo: {"start":601,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (603 to 686) SpanInfo: undefined +-------------------------------- +25 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (687 to 755) SpanInfo: undefined +-------------------------------- +26 >for ({name: nameA } of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (756 to 774) SpanInfo: {"start":762,"length":11} + >name: nameA + >:=> (line 26, col 6) to (line 26, col 17) +26 >for ({name: nameA } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (775 to 788) SpanInfo: {"start":779,"length":6} + >robots + >:=> (line 26, col 23) to (line 26, col 29) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (789 to 812) SpanInfo: {"start":793,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (813 to 814) SpanInfo: {"start":793,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ({name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (815 to 833) SpanInfo: {"start":821,"length":11} + >name: nameA + >:=> (line 29, col 6) to (line 29, col 17) +29 >for ({name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (834 to 852) SpanInfo: {"start":838,"length":11} + >getRobots() + >:=> (line 29, col 23) to (line 29, col 34) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (853 to 876) SpanInfo: {"start":857,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (877 to 878) SpanInfo: {"start":857,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (879 to 897) SpanInfo: {"start":885,"length":11} + >name: nameA + >:=> (line 32, col 6) to (line 32, col 17) +32 >for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (898 to 981) SpanInfo: {"start":902,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 32, col 23) to (line 32, col 99) +-------------------------------- +33 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (982 to 1005) SpanInfo: {"start":986,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +34 >} + + ~~ => Pos: (1006 to 1007) SpanInfo: {"start":986,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~ => Pos: (1008 to 1021) SpanInfo: {"start":1015,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 7) to (line 35, col 59) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1022 to 1042) SpanInfo: {"start":1025,"length":17} + >primary: primaryA + >:=> (line 35, col 17) to (line 35, col 34) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1043 to 1066) SpanInfo: {"start":1044,"length":21} + >secondary: secondaryA + >:=> (line 35, col 36) to (line 35, col 57) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (1067 to 1068) SpanInfo: {"start":1015,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 7) to (line 35, col 59) +35 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1069 to 1087) SpanInfo: {"start":1073,"length":11} + >multiRobots + >:=> (line 35, col 65) to (line 35, col 76) +-------------------------------- +36 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1088 to 1114) SpanInfo: {"start":1092,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +37 >} + + ~~ => Pos: (1115 to 1116) SpanInfo: {"start":1092,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (1117 to 1130) SpanInfo: {"start":1124,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 7) to (line 38, col 59) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1131 to 1151) SpanInfo: {"start":1134,"length":17} + >primary: primaryA + >:=> (line 38, col 17) to (line 38, col 34) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1152 to 1175) SpanInfo: {"start":1153,"length":21} + >secondary: secondaryA + >:=> (line 38, col 36) to (line 38, col 57) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (1176 to 1177) SpanInfo: {"start":1124,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 7) to (line 38, col 59) +38 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1178 to 1201) SpanInfo: {"start":1182,"length":16} + >getMultiRobots() + >:=> (line 38, col 65) to (line 38, col 81) +-------------------------------- +39 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1202 to 1228) SpanInfo: {"start":1206,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +40 >} + + ~~ => Pos: (1229 to 1230) SpanInfo: {"start":1206,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~ => Pos: (1231 to 1244) SpanInfo: {"start":1238,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 41, col 7) to (line 41, col 59) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1245 to 1265) SpanInfo: {"start":1248,"length":17} + >primary: primaryA + >:=> (line 41, col 17) to (line 41, col 34) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1266 to 1289) SpanInfo: {"start":1267,"length":21} + >secondary: secondaryA + >:=> (line 41, col 36) to (line 41, col 57) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (1290 to 1291) SpanInfo: {"start":1238,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 41, col 7) to (line 41, col 59) +41 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1292 to 1365) SpanInfo: {"start":1296,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 41, col 65) to (line 42, col 78) +-------------------------------- +42 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1366 to 1447) SpanInfo: {"start":1296,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 41, col 65) to (line 42, col 78) +-------------------------------- +43 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1448 to 1474) SpanInfo: {"start":1452,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +44 >} + + ~~ => Pos: (1475 to 1476) SpanInfo: {"start":1452,"length":21} + >console.log(primaryA) + >:=> (line 43, col 4) to (line 43, col 25) +-------------------------------- +45 >for ({name } of robots) { + + ~~~~~~~~~~~~ => Pos: (1477 to 1488) SpanInfo: {"start":1483,"length":4} + >name + >:=> (line 45, col 6) to (line 45, col 10) +45 >for ({name } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1489 to 1502) SpanInfo: {"start":1493,"length":6} + >robots + >:=> (line 45, col 16) to (line 45, col 22) +-------------------------------- +46 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1503 to 1526) SpanInfo: {"start":1507,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +47 >} + + ~~ => Pos: (1527 to 1528) SpanInfo: {"start":1507,"length":18} + >console.log(nameA) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +48 >for ({name } of getRobots()) { + + ~~~~~~~~~~~~ => Pos: (1529 to 1540) SpanInfo: {"start":1535,"length":4} + >name + >:=> (line 48, col 6) to (line 48, col 10) +48 >for ({name } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1541 to 1559) SpanInfo: {"start":1545,"length":11} + >getRobots() + >:=> (line 48, col 16) to (line 48, col 27) +-------------------------------- +49 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1560 to 1583) SpanInfo: {"start":1564,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + + ~~ => Pos: (1584 to 1585) SpanInfo: {"start":1564,"length":18} + >console.log(nameA) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +51 >for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~ => Pos: (1586 to 1597) SpanInfo: {"start":1592,"length":4} + >name + >:=> (line 51, col 6) to (line 51, col 10) +51 >for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1598 to 1681) SpanInfo: {"start":1602,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 51, col 16) to (line 51, col 92) +-------------------------------- +52 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1682 to 1705) SpanInfo: {"start":1686,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1706 to 1707) SpanInfo: {"start":1686,"length":18} + >console.log(nameA) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~~~ => Pos: (1708 to 1721) SpanInfo: {"start":1715,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~ => Pos: (1722 to 1732) SpanInfo: {"start":1725,"length":7} + >primary + >:=> (line 54, col 17) to (line 54, col 24) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~ => Pos: (1733 to 1744) SpanInfo: {"start":1734,"length":9} + >secondary + >:=> (line 54, col 26) to (line 54, col 35) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~ => Pos: (1745 to 1746) SpanInfo: {"start":1715,"length":30} + >skills: { primary, secondary } + >:=> (line 54, col 7) to (line 54, col 37) +54 >for ({ skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1747 to 1765) SpanInfo: {"start":1751,"length":11} + >multiRobots + >:=> (line 54, col 43) to (line 54, col 54) +-------------------------------- +55 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1766 to 1792) SpanInfo: {"start":1770,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +56 >} + + ~~ => Pos: (1793 to 1794) SpanInfo: {"start":1770,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~ => Pos: (1795 to 1808) SpanInfo: {"start":1802,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (1809 to 1819) SpanInfo: {"start":1812,"length":7} + >primary + >:=> (line 57, col 17) to (line 57, col 24) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~ => Pos: (1820 to 1831) SpanInfo: {"start":1821,"length":9} + >secondary + >:=> (line 57, col 26) to (line 57, col 35) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~ => Pos: (1832 to 1833) SpanInfo: {"start":1802,"length":30} + >skills: { primary, secondary } + >:=> (line 57, col 7) to (line 57, col 37) +57 >for ({ skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1834 to 1857) SpanInfo: {"start":1838,"length":16} + >getMultiRobots() + >:=> (line 57, col 43) to (line 57, col 59) +-------------------------------- +58 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1858 to 1884) SpanInfo: {"start":1862,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +59 >} + + ~~ => Pos: (1885 to 1886) SpanInfo: {"start":1862,"length":21} + >console.log(primaryA) + >:=> (line 58, col 4) to (line 58, col 25) +-------------------------------- +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~ => Pos: (1887 to 1900) SpanInfo: {"start":1894,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~ => Pos: (1901 to 1911) SpanInfo: {"start":1904,"length":7} + >primary + >:=> (line 60, col 17) to (line 60, col 24) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~ => Pos: (1912 to 1923) SpanInfo: {"start":1913,"length":9} + >secondary + >:=> (line 60, col 26) to (line 60, col 35) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~ => Pos: (1924 to 1925) SpanInfo: {"start":1894,"length":30} + >skills: { primary, secondary } + >:=> (line 60, col 7) to (line 60, col 37) +60 >for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1926 to 1999) SpanInfo: {"start":1930,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 60, col 43) to (line 61, col 78) +-------------------------------- +61 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2000 to 2081) SpanInfo: {"start":1930,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 60, col 43) to (line 61, col 78) +-------------------------------- +62 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2082 to 2108) SpanInfo: {"start":2086,"length":21} + >console.log(primaryA) + >:=> (line 62, col 4) to (line 62, col 25) +-------------------------------- +63 >} + + ~~ => Pos: (2109 to 2110) SpanInfo: {"start":2086,"length":21} + >console.log(primaryA) + >:=> (line 62, col 4) to (line 62, col 25) +-------------------------------- +64 >for ({name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2111 to 2128) SpanInfo: {"start":2117,"length":11} + >name: nameA + >:=> (line 64, col 6) to (line 64, col 17) +64 >for ({name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~ => Pos: (2129 to 2144) SpanInfo: {"start":2130,"length":13} + >skill: skillA + >:=> (line 64, col 19) to (line 64, col 32) +64 >for ({name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2145 to 2158) SpanInfo: {"start":2149,"length":6} + >robots + >:=> (line 64, col 38) to (line 64, col 44) +-------------------------------- +65 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2159 to 2182) SpanInfo: {"start":2163,"length":18} + >console.log(nameA) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +66 >} + + ~~ => Pos: (2183 to 2184) SpanInfo: {"start":2163,"length":18} + >console.log(nameA) + >:=> (line 65, col 4) to (line 65, col 22) +-------------------------------- +67 >for ({name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2185 to 2202) SpanInfo: {"start":2191,"length":11} + >name: nameA + >:=> (line 67, col 6) to (line 67, col 17) +67 >for ({name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (2203 to 2218) SpanInfo: {"start":2204,"length":13} + >skill: skillA + >:=> (line 67, col 19) to (line 67, col 32) +67 >for ({name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2219 to 2237) SpanInfo: {"start":2223,"length":11} + >getRobots() + >:=> (line 67, col 38) to (line 67, col 49) +-------------------------------- +68 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2238 to 2261) SpanInfo: {"start":2242,"length":18} + >console.log(nameA) + >:=> (line 68, col 4) to (line 68, col 22) +-------------------------------- +69 >} + + ~~ => Pos: (2262 to 2263) SpanInfo: {"start":2242,"length":18} + >console.log(nameA) + >:=> (line 68, col 4) to (line 68, col 22) +-------------------------------- +70 >for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2264 to 2281) SpanInfo: {"start":2270,"length":11} + >name: nameA + >:=> (line 70, col 6) to (line 70, col 17) +70 >for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~ => Pos: (2282 to 2297) SpanInfo: {"start":2283,"length":13} + >skill: skillA + >:=> (line 70, col 19) to (line 70, col 32) +70 >for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2298 to 2381) SpanInfo: {"start":2302,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 70, col 38) to (line 70, col 114) +-------------------------------- +71 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2382 to 2405) SpanInfo: {"start":2386,"length":18} + >console.log(nameA) + >:=> (line 71, col 4) to (line 71, col 22) +-------------------------------- +72 >} + + ~~ => Pos: (2406 to 2407) SpanInfo: {"start":2386,"length":18} + >console.log(nameA) + >:=> (line 71, col 4) to (line 71, col 22) +-------------------------------- +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2408 to 2425) SpanInfo: {"start":2414,"length":11} + >name: nameA + >:=> (line 73, col 6) to (line 73, col 17) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~ => Pos: (2426 to 2433) SpanInfo: {"start":2427,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 73, col 19) to (line 73, col 71) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2434 to 2454) SpanInfo: {"start":2437,"length":17} + >primary: primaryA + >:=> (line 73, col 29) to (line 73, col 46) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2455 to 2478) SpanInfo: {"start":2456,"length":21} + >secondary: secondaryA + >:=> (line 73, col 48) to (line 73, col 69) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (2479 to 2480) SpanInfo: {"start":2427,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 73, col 19) to (line 73, col 71) +73 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2481 to 2499) SpanInfo: {"start":2485,"length":11} + >multiRobots + >:=> (line 73, col 77) to (line 73, col 88) +-------------------------------- +74 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2500 to 2523) SpanInfo: {"start":2504,"length":18} + >console.log(nameA) + >:=> (line 74, col 4) to (line 74, col 22) +-------------------------------- +75 >} + + ~~ => Pos: (2524 to 2525) SpanInfo: {"start":2504,"length":18} + >console.log(nameA) + >:=> (line 74, col 4) to (line 74, col 22) +-------------------------------- +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (2526 to 2543) SpanInfo: {"start":2532,"length":11} + >name: nameA + >:=> (line 76, col 6) to (line 76, col 17) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~ => Pos: (2544 to 2551) SpanInfo: {"start":2545,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 76, col 19) to (line 76, col 71) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2552 to 2572) SpanInfo: {"start":2555,"length":17} + >primary: primaryA + >:=> (line 76, col 29) to (line 76, col 46) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2573 to 2596) SpanInfo: {"start":2574,"length":21} + >secondary: secondaryA + >:=> (line 76, col 48) to (line 76, col 69) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (2597 to 2598) SpanInfo: {"start":2545,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 76, col 19) to (line 76, col 71) +76 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2599 to 2622) SpanInfo: {"start":2603,"length":16} + >getMultiRobots() + >:=> (line 76, col 77) to (line 76, col 93) +-------------------------------- +77 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2623 to 2646) SpanInfo: {"start":2627,"length":18} + >console.log(nameA) + >:=> (line 77, col 4) to (line 77, col 22) +-------------------------------- +78 >} + + ~~ => Pos: (2647 to 2648) SpanInfo: {"start":2627,"length":18} + >console.log(nameA) + >:=> (line 77, col 4) to (line 77, col 22) +-------------------------------- +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~ => Pos: (2649 to 2666) SpanInfo: {"start":2655,"length":11} + >name: nameA + >:=> (line 79, col 6) to (line 79, col 17) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~ => Pos: (2667 to 2674) SpanInfo: {"start":2668,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 79, col 19) to (line 79, col 71) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (2675 to 2695) SpanInfo: {"start":2678,"length":17} + >primary: primaryA + >:=> (line 79, col 29) to (line 79, col 46) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2696 to 2719) SpanInfo: {"start":2697,"length":21} + >secondary: secondaryA + >:=> (line 79, col 48) to (line 79, col 69) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (2720 to 2721) SpanInfo: {"start":2668,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 79, col 19) to (line 79, col 71) +79 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2722 to 2795) SpanInfo: {"start":2726,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 77) to (line 80, col 78) +-------------------------------- +80 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2796 to 2877) SpanInfo: {"start":2726,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 77) to (line 80, col 78) +-------------------------------- +81 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2878 to 2901) SpanInfo: {"start":2882,"length":18} + >console.log(nameA) + >:=> (line 81, col 4) to (line 81, col 22) +-------------------------------- +82 >} + + ~~ => Pos: (2902 to 2903) SpanInfo: {"start":2882,"length":18} + >console.log(nameA) + >:=> (line 81, col 4) to (line 81, col 22) +-------------------------------- +83 >for ({name, skill } of robots) { + + ~~~~~~~~~~~ => Pos: (2904 to 2914) SpanInfo: {"start":2910,"length":4} + >name + >:=> (line 83, col 6) to (line 83, col 10) +83 >for ({name, skill } of robots) { + + ~~~~~~~~ => Pos: (2915 to 2922) SpanInfo: {"start":2916,"length":5} + >skill + >:=> (line 83, col 12) to (line 83, col 17) +83 >for ({name, skill } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (2923 to 2936) SpanInfo: {"start":2927,"length":6} + >robots + >:=> (line 83, col 23) to (line 83, col 29) +-------------------------------- +84 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2937 to 2960) SpanInfo: {"start":2941,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +85 >} + + ~~ => Pos: (2961 to 2962) SpanInfo: {"start":2941,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +86 >for ({name, skill } of getRobots()) { + + ~~~~~~~~~~~ => Pos: (2963 to 2973) SpanInfo: {"start":2969,"length":4} + >name + >:=> (line 86, col 6) to (line 86, col 10) +86 >for ({name, skill } of getRobots()) { + + ~~~~~~~~ => Pos: (2974 to 2981) SpanInfo: {"start":2975,"length":5} + >skill + >:=> (line 86, col 12) to (line 86, col 17) +86 >for ({name, skill } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2982 to 3000) SpanInfo: {"start":2986,"length":11} + >getRobots() + >:=> (line 86, col 23) to (line 86, col 34) +-------------------------------- +87 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3001 to 3024) SpanInfo: {"start":3005,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +88 >} + + ~~ => Pos: (3025 to 3026) SpanInfo: {"start":3005,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +89 >for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~ => Pos: (3027 to 3037) SpanInfo: {"start":3033,"length":4} + >name + >:=> (line 89, col 6) to (line 89, col 10) +89 >for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~ => Pos: (3038 to 3045) SpanInfo: {"start":3039,"length":5} + >skill + >:=> (line 89, col 12) to (line 89, col 17) +89 >for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3046 to 3129) SpanInfo: {"start":3050,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 89, col 23) to (line 89, col 99) +-------------------------------- +90 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3130 to 3153) SpanInfo: {"start":3134,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +91 >} + + ~~ => Pos: (3154 to 3155) SpanInfo: {"start":3134,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~ => Pos: (3156 to 3166) SpanInfo: {"start":3162,"length":4} + >name + >:=> (line 92, col 6) to (line 92, col 10) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~ => Pos: (3167 to 3174) SpanInfo: {"start":3168,"length":30} + >skills: { primary, secondary } + >:=> (line 92, col 12) to (line 92, col 42) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~ => Pos: (3175 to 3185) SpanInfo: {"start":3178,"length":7} + >primary + >:=> (line 92, col 22) to (line 92, col 29) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~ => Pos: (3186 to 3197) SpanInfo: {"start":3187,"length":9} + >secondary + >:=> (line 92, col 31) to (line 92, col 40) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~ => Pos: (3198 to 3199) SpanInfo: {"start":3168,"length":30} + >skills: { primary, secondary } + >:=> (line 92, col 12) to (line 92, col 42) +92 >for ({name, skills: { primary, secondary } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (3200 to 3218) SpanInfo: {"start":3204,"length":11} + >multiRobots + >:=> (line 92, col 48) to (line 92, col 59) +-------------------------------- +93 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3219 to 3242) SpanInfo: {"start":3223,"length":18} + >console.log(nameA) + >:=> (line 93, col 4) to (line 93, col 22) +-------------------------------- +94 >} + + ~~ => Pos: (3243 to 3244) SpanInfo: {"start":3223,"length":18} + >console.log(nameA) + >:=> (line 93, col 4) to (line 93, col 22) +-------------------------------- +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (3245 to 3255) SpanInfo: {"start":3251,"length":4} + >name + >:=> (line 95, col 6) to (line 95, col 10) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~ => Pos: (3256 to 3263) SpanInfo: {"start":3257,"length":30} + >skills: { primary, secondary } + >:=> (line 95, col 12) to (line 95, col 42) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (3264 to 3274) SpanInfo: {"start":3267,"length":7} + >primary + >:=> (line 95, col 22) to (line 95, col 29) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~ => Pos: (3275 to 3286) SpanInfo: {"start":3276,"length":9} + >secondary + >:=> (line 95, col 31) to (line 95, col 40) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~ => Pos: (3287 to 3288) SpanInfo: {"start":3257,"length":30} + >skills: { primary, secondary } + >:=> (line 95, col 12) to (line 95, col 42) +95 >for ({name, skills: { primary, secondary } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3289 to 3312) SpanInfo: {"start":3293,"length":16} + >getMultiRobots() + >:=> (line 95, col 48) to (line 95, col 64) +-------------------------------- +96 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3313 to 3336) SpanInfo: {"start":3317,"length":18} + >console.log(nameA) + >:=> (line 96, col 4) to (line 96, col 22) +-------------------------------- +97 >} + + ~~ => Pos: (3337 to 3338) SpanInfo: {"start":3317,"length":18} + >console.log(nameA) + >:=> (line 96, col 4) to (line 96, col 22) +-------------------------------- +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~ => Pos: (3339 to 3349) SpanInfo: {"start":3345,"length":4} + >name + >:=> (line 98, col 6) to (line 98, col 10) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~ => Pos: (3350 to 3357) SpanInfo: {"start":3351,"length":30} + >skills: { primary, secondary } + >:=> (line 98, col 12) to (line 98, col 42) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~ => Pos: (3358 to 3368) SpanInfo: {"start":3361,"length":7} + >primary + >:=> (line 98, col 22) to (line 98, col 29) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~ => Pos: (3369 to 3380) SpanInfo: {"start":3370,"length":9} + >secondary + >:=> (line 98, col 31) to (line 98, col 40) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~ => Pos: (3381 to 3382) SpanInfo: {"start":3351,"length":30} + >skills: { primary, secondary } + >:=> (line 98, col 12) to (line 98, col 42) +98 >for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3383 to 3456) SpanInfo: {"start":3387,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 98, col 48) to (line 99, col 78) +-------------------------------- +99 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3457 to 3538) SpanInfo: {"start":3387,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 98, col 48) to (line 99, col 78) +-------------------------------- +100> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3539 to 3562) SpanInfo: {"start":3543,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) +-------------------------------- +101>} + ~ => Pos: (3563 to 3563) SpanInfo: {"start":3543,"length":18} + >console.log(nameA) + >:=> (line 100, col 4) to (line 100, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..18a0ebdca34 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentForOfObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,1223 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 322) SpanInfo: {"start":223,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (323 to 424) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (425 to 504) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (505 to 527) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (528 to 546) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (547 to 548) SpanInfo: {"start":547,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 576) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (577 to 600) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (601 to 602) SpanInfo: {"start":601,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (603 to 686) SpanInfo: undefined +-------------------------------- +25 >let name: string, primary: string, secondary: string, skill: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (687 to 755) SpanInfo: undefined +-------------------------------- +26 >for ({name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (756 to 785) SpanInfo: {"start":762,"length":22} + >name: nameA = "noName" + >:=> (line 26, col 6) to (line 26, col 28) +26 >for ({name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (786 to 799) SpanInfo: {"start":790,"length":6} + >robots + >:=> (line 26, col 34) to (line 26, col 40) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (800 to 823) SpanInfo: {"start":804,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (824 to 825) SpanInfo: {"start":804,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for ({name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (826 to 855) SpanInfo: {"start":832,"length":22} + >name: nameA = "noName" + >:=> (line 29, col 6) to (line 29, col 28) +29 >for ({name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (856 to 874) SpanInfo: {"start":860,"length":11} + >getRobots() + >:=> (line 29, col 34) to (line 29, col 45) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (875 to 898) SpanInfo: {"start":879,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (899 to 900) SpanInfo: {"start":879,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (901 to 930) SpanInfo: {"start":907,"length":22} + >name: nameA = "noName" + >:=> (line 32, col 6) to (line 32, col 28) +32 >for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (931 to 1014) SpanInfo: {"start":935,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 32, col 34) to (line 32, col 110) +-------------------------------- +33 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1015 to 1038) SpanInfo: {"start":1019,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +34 >} + + ~~ => Pos: (1039 to 1040) SpanInfo: {"start":1019,"length":18} + >console.log(nameA) + >:=> (line 33, col 4) to (line 33, col 22) +-------------------------------- +35 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~ => Pos: (1041 to 1054) SpanInfo: {"start":1048,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 35, col 7) to (line 36, col 48) +35 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1055 to 1087) SpanInfo: {"start":1058,"length":29} + >primary: primaryA = "primary" + >:=> (line 35, col 17) to (line 35, col 46) +35 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1088 to 1128) SpanInfo: {"start":1089,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 48) to (line 35, col 83) +-------------------------------- +36 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1129 to 1176) SpanInfo: {"start":1089,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 48) to (line 35, col 83) +36 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~=> Pos: (1177 to 1178) SpanInfo: {"start":1048,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 35, col 7) to (line 36, col 48) +36 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1179 to 1197) SpanInfo: {"start":1183,"length":11} + >multiRobots + >:=> (line 36, col 54) to (line 36, col 65) +-------------------------------- +37 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1198 to 1224) SpanInfo: {"start":1202,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +38 >} + + ~~ => Pos: (1225 to 1226) SpanInfo: {"start":1202,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +39 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~ => Pos: (1227 to 1240) SpanInfo: {"start":1234,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 39, col 7) to (line 40, col 48) +39 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1241 to 1273) SpanInfo: {"start":1244,"length":29} + >primary: primaryA = "primary" + >:=> (line 39, col 17) to (line 39, col 46) +39 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1274 to 1314) SpanInfo: {"start":1275,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 39, col 48) to (line 39, col 83) +-------------------------------- +40 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1315 to 1362) SpanInfo: {"start":1275,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 39, col 48) to (line 39, col 83) +40 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~=> Pos: (1363 to 1364) SpanInfo: {"start":1234,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 39, col 7) to (line 40, col 48) +40 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1365 to 1388) SpanInfo: {"start":1369,"length":16} + >getMultiRobots() + >:=> (line 40, col 54) to (line 40, col 70) +-------------------------------- +41 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1389 to 1415) SpanInfo: {"start":1393,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +42 >} + + ~~ => Pos: (1416 to 1417) SpanInfo: {"start":1393,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +43 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~ => Pos: (1418 to 1431) SpanInfo: {"start":1425,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 43, col 7) to (line 44, col 48) +43 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1432 to 1464) SpanInfo: {"start":1435,"length":29} + >primary: primaryA = "primary" + >:=> (line 43, col 17) to (line 43, col 46) +43 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1465 to 1505) SpanInfo: {"start":1466,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 48) to (line 43, col 83) +-------------------------------- +44 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1506 to 1553) SpanInfo: {"start":1466,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 48) to (line 43, col 83) +44 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~=> Pos: (1554 to 1555) SpanInfo: {"start":1425,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 43, col 7) to (line 44, col 48) +44 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~=> Pos: (1556 to 1559) SpanInfo: {"start":1564,"length":166} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 45, col 4) to (line 46, col 82) +-------------------------------- +45 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1560 to 1647) SpanInfo: {"start":1564,"length":166} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 45, col 4) to (line 46, col 82) +-------------------------------- +46 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1648 to 1733) SpanInfo: {"start":1564,"length":166} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 45, col 4) to (line 46, col 82) +-------------------------------- +47 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1734 to 1760) SpanInfo: {"start":1738,"length":21} + >console.log(primaryA) + >:=> (line 47, col 4) to (line 47, col 25) +-------------------------------- +48 >} + + ~~ => Pos: (1761 to 1762) SpanInfo: {"start":1738,"length":21} + >console.log(primaryA) + >:=> (line 47, col 4) to (line 47, col 25) +-------------------------------- +49 >for ({ name = "noName" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1763 to 1786) SpanInfo: {"start":1770,"length":15} + >name = "noName" + >:=> (line 49, col 7) to (line 49, col 22) +49 >for ({ name = "noName" } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1787 to 1800) SpanInfo: {"start":1791,"length":6} + >robots + >:=> (line 49, col 28) to (line 49, col 34) +-------------------------------- +50 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1801 to 1824) SpanInfo: {"start":1805,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1825 to 1826) SpanInfo: {"start":1805,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for ({ name = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1827 to 1850) SpanInfo: {"start":1834,"length":15} + >name = "noName" + >:=> (line 52, col 7) to (line 52, col 22) +52 >for ({ name = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1851 to 1869) SpanInfo: {"start":1855,"length":11} + >getRobots() + >:=> (line 52, col 28) to (line 52, col 39) +-------------------------------- +53 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1870 to 1893) SpanInfo: {"start":1874,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1894 to 1895) SpanInfo: {"start":1874,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 >for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1896 to 1919) SpanInfo: {"start":1903,"length":15} + >name = "noName" + >:=> (line 55, col 7) to (line 55, col 22) +55 >for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1920 to 2003) SpanInfo: {"start":1924,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 55, col 28) to (line 55, col 104) +-------------------------------- +56 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2004 to 2027) SpanInfo: {"start":2008,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +57 >} + + ~~ => Pos: (2028 to 2029) SpanInfo: {"start":2008,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +58 >for ({ + + ~~~~~~~ => Pos: (2030 to 2036) SpanInfo: {"start":2041,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 59, col 4) to (line 62, col 52) +-------------------------------- +59 > skills: { + + ~~~~~~~~~~~ => Pos: (2037 to 2047) SpanInfo: {"start":2041,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 59, col 4) to (line 62, col 52) +59 > skills: { + + ~~~ => Pos: (2048 to 2050) SpanInfo: {"start":2059,"length":19} + >primary = "primary" + >:=> (line 60, col 8) to (line 60, col 27) +-------------------------------- +60 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2051 to 2079) SpanInfo: {"start":2059,"length":19} + >primary = "primary" + >:=> (line 60, col 8) to (line 60, col 27) +-------------------------------- +61 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2080 to 2111) SpanInfo: {"start":2088,"length":23} + >secondary = "secondary" + >:=> (line 61, col 8) to (line 61, col 31) +-------------------------------- +62 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2112 to 2164) SpanInfo: {"start":2088,"length":23} + >secondary = "secondary" + >:=> (line 61, col 8) to (line 61, col 31) +-------------------------------- +63 >} of multiRobots) { + + ~ => Pos: (2165 to 2165) SpanInfo: {"start":2041,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 59, col 4) to (line 62, col 52) +63 >} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2166 to 2184) SpanInfo: {"start":2170,"length":11} + >multiRobots + >:=> (line 63, col 5) to (line 63, col 16) +-------------------------------- +64 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2185 to 2211) SpanInfo: {"start":2189,"length":21} + >console.log(primaryA) + >:=> (line 64, col 4) to (line 64, col 25) +-------------------------------- +65 >} + + ~~ => Pos: (2212 to 2213) SpanInfo: {"start":2189,"length":21} + >console.log(primaryA) + >:=> (line 64, col 4) to (line 64, col 25) +-------------------------------- +66 >for ({ + + ~~~~~~~ => Pos: (2214 to 2220) SpanInfo: {"start":2225,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +-------------------------------- +67 > skills: { + + ~~~~~~~~~~~ => Pos: (2221 to 2231) SpanInfo: {"start":2225,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +67 > skills: { + + ~~~ => Pos: (2232 to 2234) SpanInfo: {"start":2243,"length":19} + >primary = "primary" + >:=> (line 68, col 8) to (line 68, col 27) +-------------------------------- +68 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2235 to 2263) SpanInfo: {"start":2243,"length":19} + >primary = "primary" + >:=> (line 68, col 8) to (line 68, col 27) +-------------------------------- +69 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2264 to 2295) SpanInfo: {"start":2272,"length":23} + >secondary = "secondary" + >:=> (line 69, col 8) to (line 69, col 31) +-------------------------------- +70 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2296 to 2348) SpanInfo: {"start":2272,"length":23} + >secondary = "secondary" + >:=> (line 69, col 8) to (line 69, col 31) +-------------------------------- +71 >} of getMultiRobots()) { + + ~ => Pos: (2349 to 2349) SpanInfo: {"start":2225,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +71 >} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2350 to 2373) SpanInfo: {"start":2354,"length":16} + >getMultiRobots() + >:=> (line 71, col 5) to (line 71, col 21) +-------------------------------- +72 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2374 to 2400) SpanInfo: {"start":2378,"length":21} + >console.log(primaryA) + >:=> (line 72, col 4) to (line 72, col 25) +-------------------------------- +73 >} + + ~~ => Pos: (2401 to 2402) SpanInfo: {"start":2378,"length":21} + >console.log(primaryA) + >:=> (line 72, col 4) to (line 72, col 25) +-------------------------------- +74 >for ({ + + ~~~~~~~ => Pos: (2403 to 2409) SpanInfo: {"start":2414,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 75, col 4) to (line 78, col 52) +-------------------------------- +75 > skills: { + + ~~~~~~~~~~~ => Pos: (2410 to 2420) SpanInfo: {"start":2414,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 75, col 4) to (line 78, col 52) +75 > skills: { + + ~~~ => Pos: (2421 to 2423) SpanInfo: {"start":2432,"length":19} + >primary = "primary" + >:=> (line 76, col 8) to (line 76, col 27) +-------------------------------- +76 > primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2424 to 2452) SpanInfo: {"start":2432,"length":19} + >primary = "primary" + >:=> (line 76, col 8) to (line 76, col 27) +-------------------------------- +77 > secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2453 to 2484) SpanInfo: {"start":2461,"length":23} + >secondary = "secondary" + >:=> (line 77, col 8) to (line 77, col 31) +-------------------------------- +78 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2485 to 2537) SpanInfo: {"start":2461,"length":23} + >secondary = "secondary" + >:=> (line 77, col 8) to (line 77, col 31) +-------------------------------- +79 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (2538 to 2538) SpanInfo: {"start":2414,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 75, col 4) to (line 78, col 52) +79 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2539 to 2612) SpanInfo: {"start":2543,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 5) to (line 80, col 78) +-------------------------------- +80 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2613 to 2694) SpanInfo: {"start":2543,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 79, col 5) to (line 80, col 78) +-------------------------------- +81 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2695 to 2721) SpanInfo: {"start":2699,"length":21} + >console.log(primaryA) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +82 >} + + ~~ => Pos: (2722 to 2723) SpanInfo: {"start":2699,"length":21} + >console.log(primaryA) + >:=> (line 81, col 4) to (line 81, col 25) +-------------------------------- +83 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2724 to 2752) SpanInfo: {"start":2730,"length":22} + >name: nameA = "noName" + >:=> (line 83, col 6) to (line 83, col 28) +83 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2753 to 2780) SpanInfo: {"start":2754,"length":25} + >skill: skillA = "noSkill" + >:=> (line 83, col 30) to (line 83, col 55) +83 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2781 to 2794) SpanInfo: {"start":2785,"length":6} + >robots + >:=> (line 83, col 61) to (line 83, col 67) +-------------------------------- +84 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2795 to 2818) SpanInfo: {"start":2799,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +85 >} + + ~~ => Pos: (2819 to 2820) SpanInfo: {"start":2799,"length":18} + >console.log(nameA) + >:=> (line 84, col 4) to (line 84, col 22) +-------------------------------- +86 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2821 to 2849) SpanInfo: {"start":2827,"length":22} + >name: nameA = "noName" + >:=> (line 86, col 6) to (line 86, col 28) +86 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2850 to 2878) SpanInfo: {"start":2851,"length":25} + >skill: skillA = "noSkill" + >:=> (line 86, col 30) to (line 86, col 55) +86 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2879 to 2897) SpanInfo: {"start":2883,"length":11} + >getRobots() + >:=> (line 86, col 62) to (line 86, col 73) +-------------------------------- +87 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2898 to 2921) SpanInfo: {"start":2902,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +88 >} + + ~~ => Pos: (2922 to 2923) SpanInfo: {"start":2902,"length":18} + >console.log(nameA) + >:=> (line 87, col 4) to (line 87, col 22) +-------------------------------- +89 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2924 to 2952) SpanInfo: {"start":2930,"length":22} + >name: nameA = "noName" + >:=> (line 89, col 6) to (line 89, col 28) +89 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2953 to 2981) SpanInfo: {"start":2954,"length":25} + >skill: skillA = "noSkill" + >:=> (line 89, col 30) to (line 89, col 55) +89 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2982 to 3065) SpanInfo: {"start":2986,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 89, col 62) to (line 89, col 138) +-------------------------------- +90 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3066 to 3089) SpanInfo: {"start":3070,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +91 >} + + ~~ => Pos: (3090 to 3091) SpanInfo: {"start":3070,"length":18} + >console.log(nameA) + >:=> (line 90, col 4) to (line 90, col 22) +-------------------------------- +92 >for ({ + + ~~~~~~~ => Pos: (3092 to 3098) SpanInfo: {"start":3103,"length":22} + >name: nameA = "noName" + >:=> (line 93, col 4) to (line 93, col 26) +-------------------------------- +93 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3099 to 3126) SpanInfo: {"start":3103,"length":22} + >name: nameA = "noName" + >:=> (line 93, col 4) to (line 93, col 26) +-------------------------------- +94 > skills: { + + ~~~~~~~~~~~ => Pos: (3127 to 3137) SpanInfo: {"start":3131,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 94, col 4) to (line 97, col 52) +94 > skills: { + + ~~~ => Pos: (3138 to 3140) SpanInfo: {"start":3149,"length":29} + >primary: primaryA = "primary" + >:=> (line 95, col 8) to (line 95, col 37) +-------------------------------- +95 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3141 to 3179) SpanInfo: {"start":3149,"length":29} + >primary: primaryA = "primary" + >:=> (line 95, col 8) to (line 95, col 37) +-------------------------------- +96 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3180 to 3223) SpanInfo: {"start":3188,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 96, col 8) to (line 96, col 43) +-------------------------------- +97 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3224 to 3276) SpanInfo: {"start":3188,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 96, col 8) to (line 96, col 43) +-------------------------------- +98 >} of multiRobots) { + + ~ => Pos: (3277 to 3277) SpanInfo: {"start":3131,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 94, col 4) to (line 97, col 52) +98 >} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (3278 to 3296) SpanInfo: {"start":3282,"length":11} + >multiRobots + >:=> (line 98, col 5) to (line 98, col 16) +-------------------------------- +99 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3297 to 3320) SpanInfo: {"start":3301,"length":18} + >console.log(nameA) + >:=> (line 99, col 4) to (line 99, col 22) +-------------------------------- +100>} + + ~~ => Pos: (3321 to 3322) SpanInfo: {"start":3301,"length":18} + >console.log(nameA) + >:=> (line 99, col 4) to (line 99, col 22) +-------------------------------- +101>for ({ + + ~~~~~~~ => Pos: (3323 to 3329) SpanInfo: {"start":3334,"length":22} + >name: nameA = "noName" + >:=> (line 102, col 4) to (line 102, col 26) +-------------------------------- +102> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3330 to 3357) SpanInfo: {"start":3334,"length":22} + >name: nameA = "noName" + >:=> (line 102, col 4) to (line 102, col 26) +-------------------------------- +103> skills: { + + ~~~~~~~~~~~ => Pos: (3358 to 3368) SpanInfo: {"start":3362,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 103, col 4) to (line 106, col 52) +103> skills: { + + ~~~ => Pos: (3369 to 3371) SpanInfo: {"start":3380,"length":29} + >primary: primaryA = "primary" + >:=> (line 104, col 8) to (line 104, col 37) +-------------------------------- +104> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3372 to 3410) SpanInfo: {"start":3380,"length":29} + >primary: primaryA = "primary" + >:=> (line 104, col 8) to (line 104, col 37) +-------------------------------- +105> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3411 to 3454) SpanInfo: {"start":3419,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 105, col 8) to (line 105, col 43) +-------------------------------- +106> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3455 to 3507) SpanInfo: {"start":3419,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 105, col 8) to (line 105, col 43) +-------------------------------- +107>} of getMultiRobots()) { + + ~ => Pos: (3508 to 3508) SpanInfo: {"start":3362,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 103, col 4) to (line 106, col 52) +107>} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3509 to 3532) SpanInfo: {"start":3513,"length":16} + >getMultiRobots() + >:=> (line 107, col 5) to (line 107, col 21) +-------------------------------- +108> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3533 to 3556) SpanInfo: {"start":3537,"length":18} + >console.log(nameA) + >:=> (line 108, col 4) to (line 108, col 22) +-------------------------------- +109>} + + ~~ => Pos: (3557 to 3558) SpanInfo: {"start":3537,"length":18} + >console.log(nameA) + >:=> (line 108, col 4) to (line 108, col 22) +-------------------------------- +110>for ({ + + ~~~~~~~ => Pos: (3559 to 3565) SpanInfo: {"start":3570,"length":22} + >name: nameA = "noName" + >:=> (line 111, col 4) to (line 111, col 26) +-------------------------------- +111> name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3566 to 3593) SpanInfo: {"start":3570,"length":22} + >name: nameA = "noName" + >:=> (line 111, col 4) to (line 111, col 26) +-------------------------------- +112> skills: { + + ~~~~~~~~~~~ => Pos: (3594 to 3604) SpanInfo: {"start":3598,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 112, col 4) to (line 115, col 52) +112> skills: { + + ~~~ => Pos: (3605 to 3607) SpanInfo: {"start":3616,"length":29} + >primary: primaryA = "primary" + >:=> (line 113, col 8) to (line 113, col 37) +-------------------------------- +113> primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3608 to 3646) SpanInfo: {"start":3616,"length":29} + >primary: primaryA = "primary" + >:=> (line 113, col 8) to (line 113, col 37) +-------------------------------- +114> secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3647 to 3690) SpanInfo: {"start":3655,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 114, col 8) to (line 114, col 43) +-------------------------------- +115> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3691 to 3743) SpanInfo: {"start":3655,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 114, col 8) to (line 114, col 43) +-------------------------------- +116>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (3744 to 3744) SpanInfo: {"start":3598,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 112, col 4) to (line 115, col 52) +116>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3745 to 3832) SpanInfo: {"start":3749,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 116, col 5) to (line 117, col 78) +-------------------------------- +117> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3833 to 3914) SpanInfo: {"start":3749,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 116, col 5) to (line 117, col 78) +-------------------------------- +118> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3915 to 3938) SpanInfo: {"start":3919,"length":18} + >console.log(nameA) + >:=> (line 118, col 4) to (line 118, col 22) +-------------------------------- +119>} + + ~~ => Pos: (3939 to 3940) SpanInfo: {"start":3919,"length":18} + >console.log(nameA) + >:=> (line 118, col 4) to (line 118, col 22) +-------------------------------- +120>for ({ name = "noName", skill = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3941 to 3963) SpanInfo: {"start":3948,"length":15} + >name = "noName" + >:=> (line 120, col 7) to (line 120, col 22) +120>for ({ name = "noName", skill = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (3964 to 3984) SpanInfo: {"start":3965,"length":18} + >skill = "noSkill" + >:=> (line 120, col 24) to (line 120, col 42) +120>for ({ name = "noName", skill = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (3985 to 3998) SpanInfo: {"start":3989,"length":6} + >robots + >:=> (line 120, col 48) to (line 120, col 54) +-------------------------------- +121> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3999 to 4022) SpanInfo: {"start":4003,"length":18} + >console.log(nameA) + >:=> (line 121, col 4) to (line 121, col 22) +-------------------------------- +122>} + + ~~ => Pos: (4023 to 4024) SpanInfo: {"start":4003,"length":18} + >console.log(nameA) + >:=> (line 121, col 4) to (line 121, col 22) +-------------------------------- +123>for ({ name = "noName", skill = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4025 to 4047) SpanInfo: {"start":4032,"length":15} + >name = "noName" + >:=> (line 123, col 7) to (line 123, col 22) +123>for ({ name = "noName", skill = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4048 to 4068) SpanInfo: {"start":4049,"length":17} + >skill = "noSkill" + >:=> (line 123, col 24) to (line 123, col 41) +123>for ({ name = "noName", skill = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (4069 to 4087) SpanInfo: {"start":4073,"length":11} + >getRobots() + >:=> (line 123, col 48) to (line 123, col 59) +-------------------------------- +124> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4088 to 4111) SpanInfo: {"start":4092,"length":18} + >console.log(nameA) + >:=> (line 124, col 4) to (line 124, col 22) +-------------------------------- +125>} + + ~~ => Pos: (4112 to 4113) SpanInfo: {"start":4092,"length":18} + >console.log(nameA) + >:=> (line 124, col 4) to (line 124, col 22) +-------------------------------- +126>for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4114 to 4136) SpanInfo: {"start":4121,"length":15} + >name = "noName" + >:=> (line 126, col 7) to (line 126, col 22) +126>for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4137 to 4157) SpanInfo: {"start":4138,"length":18} + >skill = "noSkill" + >:=> (line 126, col 24) to (line 126, col 42) +126>for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4158 to 4241) SpanInfo: {"start":4162,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 126, col 48) to (line 126, col 124) +-------------------------------- +127> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4242 to 4265) SpanInfo: {"start":4246,"length":18} + >console.log(nameA) + >:=> (line 127, col 4) to (line 127, col 22) +-------------------------------- +128>} + + ~~ => Pos: (4266 to 4267) SpanInfo: {"start":4246,"length":18} + >console.log(nameA) + >:=> (line 127, col 4) to (line 127, col 22) +-------------------------------- +129>for ({ + + ~~~~~~~ => Pos: (4268 to 4274) SpanInfo: {"start":4279,"length":15} + >name = "noName" + >:=> (line 130, col 4) to (line 130, col 19) +-------------------------------- +130> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4275 to 4295) SpanInfo: {"start":4279,"length":15} + >name = "noName" + >:=> (line 130, col 4) to (line 130, col 19) +-------------------------------- +131> skills: { + + ~~~~~~~~~~~ => Pos: (4296 to 4306) SpanInfo: {"start":4300,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 131, col 4) to (line 134, col 52) +131> skills: { + + ~~~ => Pos: (4307 to 4309) SpanInfo: {"start":4318,"length":19} + >primary = "primary" + >:=> (line 132, col 8) to (line 132, col 27) +-------------------------------- +132> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4310 to 4338) SpanInfo: {"start":4318,"length":19} + >primary = "primary" + >:=> (line 132, col 8) to (line 132, col 27) +-------------------------------- +133> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4339 to 4370) SpanInfo: {"start":4347,"length":23} + >secondary = "secondary" + >:=> (line 133, col 8) to (line 133, col 31) +-------------------------------- +134> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4371 to 4423) SpanInfo: {"start":4347,"length":23} + >secondary = "secondary" + >:=> (line 133, col 8) to (line 133, col 31) +-------------------------------- +135>} of multiRobots) { + + ~ => Pos: (4424 to 4424) SpanInfo: {"start":4300,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 131, col 4) to (line 134, col 52) +135>} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (4425 to 4443) SpanInfo: {"start":4429,"length":11} + >multiRobots + >:=> (line 135, col 5) to (line 135, col 16) +-------------------------------- +136> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4444 to 4467) SpanInfo: {"start":4448,"length":18} + >console.log(nameA) + >:=> (line 136, col 4) to (line 136, col 22) +-------------------------------- +137>} + + ~~ => Pos: (4468 to 4469) SpanInfo: {"start":4448,"length":18} + >console.log(nameA) + >:=> (line 136, col 4) to (line 136, col 22) +-------------------------------- +138>for ({ + + ~~~~~~~ => Pos: (4470 to 4476) SpanInfo: {"start":4481,"length":15} + >name = "noName" + >:=> (line 139, col 4) to (line 139, col 19) +-------------------------------- +139> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4477 to 4497) SpanInfo: {"start":4481,"length":15} + >name = "noName" + >:=> (line 139, col 4) to (line 139, col 19) +-------------------------------- +140> skills: { + + ~~~~~~~~~~~ => Pos: (4498 to 4508) SpanInfo: {"start":4502,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 140, col 4) to (line 143, col 52) +140> skills: { + + ~~~ => Pos: (4509 to 4511) SpanInfo: {"start":4520,"length":19} + >primary = "primary" + >:=> (line 141, col 8) to (line 141, col 27) +-------------------------------- +141> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4512 to 4540) SpanInfo: {"start":4520,"length":19} + >primary = "primary" + >:=> (line 141, col 8) to (line 141, col 27) +-------------------------------- +142> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4541 to 4572) SpanInfo: {"start":4549,"length":23} + >secondary = "secondary" + >:=> (line 142, col 8) to (line 142, col 31) +-------------------------------- +143> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4573 to 4625) SpanInfo: {"start":4549,"length":23} + >secondary = "secondary" + >:=> (line 142, col 8) to (line 142, col 31) +-------------------------------- +144>} of getMultiRobots()) { + + ~ => Pos: (4626 to 4626) SpanInfo: {"start":4502,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 140, col 4) to (line 143, col 52) +144>} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4627 to 4650) SpanInfo: {"start":4631,"length":16} + >getMultiRobots() + >:=> (line 144, col 5) to (line 144, col 21) +-------------------------------- +145> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4651 to 4674) SpanInfo: {"start":4655,"length":18} + >console.log(nameA) + >:=> (line 145, col 4) to (line 145, col 22) +-------------------------------- +146>} + + ~~ => Pos: (4675 to 4676) SpanInfo: {"start":4655,"length":18} + >console.log(nameA) + >:=> (line 145, col 4) to (line 145, col 22) +-------------------------------- +147>for ({ + + ~~~~~~~ => Pos: (4677 to 4683) SpanInfo: {"start":4688,"length":15} + >name = "noName" + >:=> (line 148, col 4) to (line 148, col 19) +-------------------------------- +148> name = "noName", + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (4684 to 4704) SpanInfo: {"start":4688,"length":15} + >name = "noName" + >:=> (line 148, col 4) to (line 148, col 19) +-------------------------------- +149> skills: { + + ~~~~~~~~~~~ => Pos: (4705 to 4715) SpanInfo: {"start":4709,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 149, col 4) to (line 152, col 52) +149> skills: { + + ~~~ => Pos: (4716 to 4718) SpanInfo: {"start":4727,"length":19} + >primary = "primary" + >:=> (line 150, col 8) to (line 150, col 27) +-------------------------------- +150> primary = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4719 to 4747) SpanInfo: {"start":4727,"length":19} + >primary = "primary" + >:=> (line 150, col 8) to (line 150, col 27) +-------------------------------- +151> secondary = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4748 to 4779) SpanInfo: {"start":4756,"length":23} + >secondary = "secondary" + >:=> (line 151, col 8) to (line 151, col 31) +-------------------------------- +152> } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4780 to 4832) SpanInfo: {"start":4756,"length":23} + >secondary = "secondary" + >:=> (line 151, col 8) to (line 151, col 31) +-------------------------------- +153>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (4833 to 4833) SpanInfo: {"start":4709,"length":123} + >skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 149, col 4) to (line 152, col 52) +153>} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4834 to 4907) SpanInfo: {"start":4838,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 153, col 5) to (line 154, col 78) +-------------------------------- +154> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (4908 to 4989) SpanInfo: {"start":4838,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 153, col 5) to (line 154, col 78) +-------------------------------- +155> console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (4990 to 5013) SpanInfo: {"start":4994,"length":18} + >console.log(nameA) + >:=> (line 155, col 4) to (line 155, col 22) +-------------------------------- +156>} + ~ => Pos: (5014 to 5014) SpanInfo: {"start":4994,"length":18} + >console.log(nameA) + >:=> (line 155, col 4) to (line 155, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPattern.baseline new file mode 100644 index 00000000000..87bf1b5a179 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPattern.baseline @@ -0,0 +1,365 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 > + + ~ => Pos: (142 to 142) SpanInfo: undefined +-------------------------------- +7 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (143 to 186) SpanInfo: {"start":143,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 7, col 0) to (line 7, col 42) +-------------------------------- +8 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 234) SpanInfo: {"start":187,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 8, col 0) to (line 8, col 46) +-------------------------------- +9 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (235 to 298) SpanInfo: {"start":235,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 9, col 0) to (line 9, col 62) +-------------------------------- +10 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (299 to 372) SpanInfo: {"start":299,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 10, col 0) to (line 10, col 72) +-------------------------------- +11 > + + ~ => Pos: (373 to 373) SpanInfo: undefined +-------------------------------- +12 >let nameA: string, numberB: number, nameB: string, skillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (374 to 440) SpanInfo: undefined +-------------------------------- +13 >let robotAInfo: (number | string)[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (441 to 477) SpanInfo: undefined +-------------------------------- +14 > + + ~ => Pos: (478 to 478) SpanInfo: undefined +-------------------------------- +15 >let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (479 to 577) SpanInfo: undefined +-------------------------------- +16 >let multiRobotAInfo: (string | [string, string])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (578 to 629) SpanInfo: undefined +-------------------------------- +17 > + + ~ => Pos: (630 to 630) SpanInfo: undefined +-------------------------------- +18 >[, nameA] = robotA; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (631 to 650) SpanInfo: {"start":634,"length":5} + >nameA + >:=> (line 18, col 3) to (line 18, col 8) +-------------------------------- +19 >[, nameB] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (651 to 675) SpanInfo: {"start":654,"length":5} + >nameB + >:=> (line 19, col 3) to (line 19, col 8) +-------------------------------- +20 >[, nameB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (676 to 715) SpanInfo: {"start":679,"length":5} + >nameB + >:=> (line 20, col 3) to (line 20, col 8) +-------------------------------- +21 >[, multiSkillB] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (716 to 746) SpanInfo: {"start":719,"length":11} + >multiSkillB + >:=> (line 21, col 3) to (line 21, col 14) +-------------------------------- +22 >[, multiSkillB] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (747 to 782) SpanInfo: {"start":750,"length":11} + >multiSkillB + >:=> (line 22, col 3) to (line 22, col 14) +-------------------------------- +23 >[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (783 to 835) SpanInfo: {"start":786,"length":11} + >multiSkillB + >:=> (line 23, col 3) to (line 23, col 14) +-------------------------------- +24 > + + ~ => Pos: (836 to 836) SpanInfo: undefined +-------------------------------- +25 >[numberB] = robotB; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (837 to 856) SpanInfo: {"start":838,"length":7} + >numberB + >:=> (line 25, col 1) to (line 25, col 8) +-------------------------------- +26 >[numberB] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (857 to 881) SpanInfo: {"start":858,"length":7} + >numberB + >:=> (line 26, col 1) to (line 26, col 8) +-------------------------------- +27 >[numberB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (882 to 921) SpanInfo: {"start":883,"length":7} + >numberB + >:=> (line 27, col 1) to (line 27, col 8) +-------------------------------- +28 >[nameMB] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (922 to 945) SpanInfo: {"start":923,"length":6} + >nameMB + >:=> (line 28, col 1) to (line 28, col 7) +-------------------------------- +29 >[nameMB] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (946 to 974) SpanInfo: {"start":947,"length":6} + >nameMB + >:=> (line 29, col 1) to (line 29, col 7) +-------------------------------- +30 >[nameMB] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (975 to 1022) SpanInfo: {"start":976,"length":6} + >nameMB + >:=> (line 30, col 1) to (line 30, col 7) +-------------------------------- +31 > + + ~ => Pos: (1023 to 1023) SpanInfo: undefined +-------------------------------- +32 >[numberB, nameB, skillB] = robotB; + + ~~~~~~~~~ => Pos: (1024 to 1032) SpanInfo: {"start":1025,"length":7} + >numberB + >:=> (line 32, col 1) to (line 32, col 8) +32 >[numberB, nameB, skillB] = robotB; + + ~~~~~~~ => Pos: (1033 to 1039) SpanInfo: {"start":1034,"length":5} + >nameB + >:=> (line 32, col 10) to (line 32, col 15) +32 >[numberB, nameB, skillB] = robotB; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1040 to 1058) SpanInfo: {"start":1041,"length":6} + >skillB + >:=> (line 32, col 17) to (line 32, col 23) +-------------------------------- +33 >[numberB, nameB, skillB] = getRobotB(); + + ~~~~~~~~~ => Pos: (1059 to 1067) SpanInfo: {"start":1060,"length":7} + >numberB + >:=> (line 33, col 1) to (line 33, col 8) +33 >[numberB, nameB, skillB] = getRobotB(); + + ~~~~~~~ => Pos: (1068 to 1074) SpanInfo: {"start":1069,"length":5} + >nameB + >:=> (line 33, col 10) to (line 33, col 15) +33 >[numberB, nameB, skillB] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1075 to 1098) SpanInfo: {"start":1076,"length":6} + >skillB + >:=> (line 33, col 17) to (line 33, col 23) +-------------------------------- +34 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~ => Pos: (1099 to 1107) SpanInfo: {"start":1100,"length":7} + >numberB + >:=> (line 34, col 1) to (line 34, col 8) +34 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; + + ~~~~~~~ => Pos: (1108 to 1114) SpanInfo: {"start":1109,"length":5} + >nameB + >:=> (line 34, col 10) to (line 34, col 15) +34 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1115 to 1153) SpanInfo: {"start":1116,"length":6} + >skillB + >:=> (line 34, col 17) to (line 34, col 23) +-------------------------------- +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~ => Pos: (1154 to 1161) SpanInfo: {"start":1155,"length":6} + >nameMB + >:=> (line 35, col 1) to (line 35, col 7) +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~~~~~~~~~ => Pos: (1162 to 1177) SpanInfo: {"start":1164,"length":13} + >primarySkillB + >:=> (line 35, col 10) to (line 35, col 23) +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~~~~~~~~~~ => Pos: (1178 to 1194) SpanInfo: {"start":1179,"length":15} + >secondarySkillB + >:=> (line 35, col 25) to (line 35, col 40) +35 >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; + + ~~~~~~~~~~~~~~~~~=> Pos: (1195 to 1211) SpanInfo: {"start":1163,"length":32} + >[primarySkillB, secondarySkillB] + >:=> (line 35, col 9) to (line 35, col 41) +-------------------------------- +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~ => Pos: (1212 to 1219) SpanInfo: {"start":1213,"length":6} + >nameMB + >:=> (line 36, col 1) to (line 36, col 7) +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~ => Pos: (1220 to 1235) SpanInfo: {"start":1222,"length":13} + >primarySkillB + >:=> (line 36, col 10) to (line 36, col 23) +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~ => Pos: (1236 to 1252) SpanInfo: {"start":1237,"length":15} + >secondarySkillB + >:=> (line 36, col 25) to (line 36, col 40) +36 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1253 to 1274) SpanInfo: {"start":1221,"length":32} + >[primarySkillB, secondarySkillB] + >:=> (line 36, col 9) to (line 36, col 41) +-------------------------------- +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~ => Pos: (1275 to 1282) SpanInfo: {"start":1276,"length":6} + >nameMB + >:=> (line 37, col 1) to (line 37, col 7) +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~ => Pos: (1283 to 1298) SpanInfo: {"start":1285,"length":13} + >primarySkillB + >:=> (line 37, col 10) to (line 37, col 23) +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~ => Pos: (1299 to 1315) SpanInfo: {"start":1300,"length":15} + >secondarySkillB + >:=> (line 37, col 25) to (line 37, col 40) +37 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1316 to 1356) SpanInfo: {"start":1284,"length":32} + >[primarySkillB, secondarySkillB] + >:=> (line 37, col 9) to (line 37, col 41) +-------------------------------- +38 > + + ~ => Pos: (1357 to 1357) SpanInfo: undefined +-------------------------------- +39 >[numberB, ...robotAInfo] = robotB; + + ~~~~~~~~~ => Pos: (1358 to 1366) SpanInfo: {"start":1359,"length":7} + >numberB + >:=> (line 39, col 1) to (line 39, col 8) +39 >[numberB, ...robotAInfo] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1367 to 1392) SpanInfo: {"start":1368,"length":13} + >...robotAInfo + >:=> (line 39, col 10) to (line 39, col 23) +-------------------------------- +40 >[numberB, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~ => Pos: (1393 to 1401) SpanInfo: {"start":1394,"length":7} + >numberB + >:=> (line 40, col 1) to (line 40, col 8) +40 >[numberB, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1402 to 1432) SpanInfo: {"start":1403,"length":13} + >...robotAInfo + >:=> (line 40, col 10) to (line 40, col 23) +-------------------------------- +41 >[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~ => Pos: (1433 to 1441) SpanInfo: {"start":1434,"length":7} + >numberB + >:=> (line 41, col 1) to (line 41, col 8) +41 >[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1442 to 1494) SpanInfo: {"start":1443,"length":13} + >...robotAInfo + >:=> (line 41, col 10) to (line 41, col 23) +-------------------------------- +42 >[...multiRobotAInfo] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1495 to 1530) SpanInfo: {"start":1496,"length":18} + >...multiRobotAInfo + >:=> (line 42, col 1) to (line 42, col 19) +-------------------------------- +43 >[...multiRobotAInfo] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1531 to 1571) SpanInfo: {"start":1532,"length":18} + >...multiRobotAInfo + >:=> (line 43, col 1) to (line 43, col 19) +-------------------------------- +44 >[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1572 to 1631) SpanInfo: {"start":1573,"length":18} + >...multiRobotAInfo + >:=> (line 44, col 1) to (line 44, col 19) +-------------------------------- +45 > + + ~ => Pos: (1632 to 1632) SpanInfo: undefined +-------------------------------- +46 >function getRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1633 to 1655) SpanInfo: {"start":1660,"length":13} + >return robotB + >:=> (line 47, col 4) to (line 47, col 17) +-------------------------------- +47 > return robotB; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1656 to 1674) SpanInfo: {"start":1660,"length":13} + >return robotB + >:=> (line 47, col 4) to (line 47, col 17) +-------------------------------- +48 >} + + ~~ => Pos: (1675 to 1676) SpanInfo: {"start":1675,"length":1} + >} + >:=> (line 48, col 0) to (line 48, col 1) +-------------------------------- +49 > + + ~ => Pos: (1677 to 1677) SpanInfo: undefined +-------------------------------- +50 >function getMultiRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1678 to 1705) SpanInfo: {"start":1710,"length":18} + >return multiRobotB + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +51 > return multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1706 to 1729) SpanInfo: {"start":1710,"length":18} + >return multiRobotB + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +52 >} + ~ => Pos: (1730 to 1730) SpanInfo: {"start":1730,"length":1} + >} + >:=> (line 52, col 0) to (line 52, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..7169d67bfef --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringAssignmentStatementArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,353 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 133) SpanInfo: undefined +-------------------------------- +6 > + + ~ => Pos: (134 to 134) SpanInfo: undefined +-------------------------------- +7 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (135 to 178) SpanInfo: {"start":135,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 7, col 0) to (line 7, col 42) +-------------------------------- +8 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (179 to 226) SpanInfo: {"start":179,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 8, col 0) to (line 8, col 46) +-------------------------------- +9 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (227 to 290) SpanInfo: {"start":227,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 9, col 0) to (line 9, col 62) +-------------------------------- +10 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (291 to 364) SpanInfo: {"start":291,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 10, col 0) to (line 10, col 72) +-------------------------------- +11 > + + ~ => Pos: (365 to 365) SpanInfo: undefined +-------------------------------- +12 >let nameA: string, numberB: number, nameB: string, skillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (366 to 432) SpanInfo: undefined +-------------------------------- +13 >let robotAInfo: (number | string)[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (433 to 469) SpanInfo: undefined +-------------------------------- +14 > + + ~ => Pos: (470 to 470) SpanInfo: undefined +-------------------------------- +15 >let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (471 to 561) SpanInfo: undefined +-------------------------------- +16 >let multiRobotAInfo: (string | string[])[]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (562 to 605) SpanInfo: undefined +-------------------------------- +17 > + + ~ => Pos: (606 to 606) SpanInfo: undefined +-------------------------------- +18 >[, nameA = "helloNoName"] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (607 to 642) SpanInfo: {"start":610,"length":21} + >nameA = "helloNoName" + >:=> (line 18, col 3) to (line 18, col 24) +-------------------------------- +19 >[, nameB = "helloNoName"] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (643 to 683) SpanInfo: {"start":646,"length":21} + >nameB = "helloNoName" + >:=> (line 19, col 3) to (line 19, col 24) +-------------------------------- +20 >[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (684 to 739) SpanInfo: {"start":687,"length":21} + >nameB = "helloNoName" + >:=> (line 20, col 3) to (line 20, col 24) +-------------------------------- +21 >[, multiSkillB = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (740 to 775) SpanInfo: {"start":743,"length":16} + >multiSkillB = [] + >:=> (line 21, col 3) to (line 21, col 19) +-------------------------------- +22 >[, multiSkillB = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (776 to 816) SpanInfo: {"start":779,"length":16} + >multiSkillB = [] + >:=> (line 22, col 3) to (line 22, col 19) +-------------------------------- +23 >[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (817 to 874) SpanInfo: {"start":820,"length":16} + >multiSkillB = [] + >:=> (line 23, col 3) to (line 23, col 19) +-------------------------------- +24 > + + ~ => Pos: (875 to 875) SpanInfo: undefined +-------------------------------- +25 >[numberB = -1] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (876 to 900) SpanInfo: {"start":877,"length":12} + >numberB = -1 + >:=> (line 25, col 1) to (line 25, col 13) +-------------------------------- +26 >[numberB = -1] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (901 to 930) SpanInfo: {"start":902,"length":12} + >numberB = -1 + >:=> (line 26, col 1) to (line 26, col 13) +-------------------------------- +27 >[numberB = -1] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (931 to 975) SpanInfo: {"start":932,"length":12} + >numberB = -1 + >:=> (line 27, col 1) to (line 27, col 13) +-------------------------------- +28 >[nameMB = "helloNoName"] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (976 to 1015) SpanInfo: {"start":977,"length":22} + >nameMB = "helloNoName" + >:=> (line 28, col 1) to (line 28, col 23) +-------------------------------- +29 >[nameMB = "helloNoName"] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1016 to 1060) SpanInfo: {"start":1017,"length":22} + >nameMB = "helloNoName" + >:=> (line 29, col 1) to (line 29, col 23) +-------------------------------- +30 >[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1061 to 1124) SpanInfo: {"start":1062,"length":22} + >nameMB = "helloNoName" + >:=> (line 30, col 1) to (line 30, col 23) +-------------------------------- +31 > + + ~ => Pos: (1125 to 1125) SpanInfo: undefined +-------------------------------- +32 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; + + ~~~~~~~~~~~~~~ => Pos: (1126 to 1139) SpanInfo: {"start":1127,"length":12} + >numberB = -1 + >:=> (line 32, col 1) to (line 32, col 13) +32 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1140 to 1162) SpanInfo: {"start":1141,"length":21} + >nameB = "helloNoName" + >:=> (line 32, col 15) to (line 32, col 36) +32 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1163 to 1193) SpanInfo: {"start":1164,"length":18} + >skillB = "noSkill" + >:=> (line 32, col 38) to (line 32, col 56) +-------------------------------- +33 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); + + ~~~~~~~~~~~~~~ => Pos: (1194 to 1207) SpanInfo: {"start":1195,"length":12} + >numberB = -1 + >:=> (line 33, col 1) to (line 33, col 13) +33 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1208 to 1230) SpanInfo: {"start":1209,"length":21} + >nameB = "helloNoName" + >:=> (line 33, col 15) to (line 33, col 36) +33 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1231 to 1266) SpanInfo: {"start":1232,"length":18} + >skillB = "noSkill" + >:=> (line 33, col 38) to (line 33, col 56) +-------------------------------- +34 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~ => Pos: (1267 to 1280) SpanInfo: {"start":1268,"length":12} + >numberB = -1 + >:=> (line 34, col 1) to (line 34, col 13) +34 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1281 to 1303) SpanInfo: {"start":1282,"length":21} + >nameB = "helloNoName" + >:=> (line 34, col 15) to (line 34, col 36) +34 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1304 to 1354) SpanInfo: {"start":1305,"length":18} + >skillB = "noSkill" + >:=> (line 34, col 38) to (line 34, col 56) +-------------------------------- +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1355 to 1378) SpanInfo: {"start":1356,"length":22} + >nameMB = "helloNoName" + >:=> (line 35, col 1) to (line 35, col 23) +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1379 to 1406) SpanInfo: {"start":1381,"length":25} + >primarySkillB = "noSkill" + >:=> (line 35, col 26) to (line 35, col 51) +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1407 to 1440) SpanInfo: {"start":1408,"length":27} + >secondarySkillB = "noSkill" + >:=> (line 35, col 53) to (line 35, col 80) +35 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; + + ~~~~~~~~~~~~~~~~~=> Pos: (1441 to 1457) SpanInfo: {"start":1380,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 35, col 25) to (line 35, col 86) +-------------------------------- +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1458 to 1481) SpanInfo: {"start":1459,"length":22} + >nameMB = "helloNoName" + >:=> (line 36, col 1) to (line 36, col 23) +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1482 to 1509) SpanInfo: {"start":1484,"length":25} + >primarySkillB = "noSkill" + >:=> (line 36, col 26) to (line 36, col 51) +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1510 to 1543) SpanInfo: {"start":1511,"length":27} + >secondarySkillB = "noSkill" + >:=> (line 36, col 53) to (line 36, col 80) +36 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1544 to 1565) SpanInfo: {"start":1483,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 36, col 25) to (line 36, col 86) +-------------------------------- +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1566 to 1589) SpanInfo: {"start":1567,"length":22} + >nameMB = "helloNoName" + >:=> (line 37, col 1) to (line 37, col 23) +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1590 to 1617) SpanInfo: {"start":1592,"length":25} + >primarySkillB = "noSkill" + >:=> (line 37, col 26) to (line 37, col 51) +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1618 to 1651) SpanInfo: {"start":1619,"length":27} + >secondarySkillB = "noSkill" + >:=> (line 37, col 53) to (line 37, col 80) +37 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + + ~~~~=> Pos: (1652 to 1655) SpanInfo: {"start":1591,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 37, col 25) to (line 37, col 86) +-------------------------------- +38 > ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1656 to 1696) SpanInfo: {"start":1591,"length":61} + >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] + >:=> (line 37, col 25) to (line 37, col 86) +-------------------------------- +39 > + + ~ => Pos: (1697 to 1697) SpanInfo: undefined +-------------------------------- +40 >[numberB = -1, ...robotAInfo] = robotB; + + ~~~~~~~~~~~~~~ => Pos: (1698 to 1711) SpanInfo: {"start":1699,"length":12} + >numberB = -1 + >:=> (line 40, col 1) to (line 40, col 13) +40 >[numberB = -1, ...robotAInfo] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1712 to 1737) SpanInfo: {"start":1713,"length":13} + >...robotAInfo + >:=> (line 40, col 15) to (line 40, col 28) +-------------------------------- +41 >[numberB = -1, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~~~~~~ => Pos: (1738 to 1751) SpanInfo: {"start":1739,"length":12} + >numberB = -1 + >:=> (line 41, col 1) to (line 41, col 13) +41 >[numberB = -1, ...robotAInfo] = getRobotB(); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1752 to 1782) SpanInfo: {"start":1753,"length":13} + >...robotAInfo + >:=> (line 41, col 15) to (line 41, col 28) +-------------------------------- +42 >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~ => Pos: (1783 to 1796) SpanInfo: {"start":1784,"length":12} + >numberB = -1 + >:=> (line 42, col 1) to (line 42, col 13) +42 >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1797 to 1849) SpanInfo: {"start":1798,"length":13} + >...robotAInfo + >:=> (line 42, col 15) to (line 42, col 28) +-------------------------------- +43 > + + ~ => Pos: (1850 to 1850) SpanInfo: undefined +-------------------------------- +44 >function getRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1851 to 1873) SpanInfo: {"start":1878,"length":13} + >return robotB + >:=> (line 45, col 4) to (line 45, col 17) +-------------------------------- +45 > return robotB; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1874 to 1892) SpanInfo: {"start":1878,"length":13} + >return robotB + >:=> (line 45, col 4) to (line 45, col 17) +-------------------------------- +46 >} + + ~~ => Pos: (1893 to 1894) SpanInfo: {"start":1893,"length":1} + >} + >:=> (line 46, col 0) to (line 46, col 1) +-------------------------------- +47 > + + ~ => Pos: (1895 to 1895) SpanInfo: undefined +-------------------------------- +48 >function getMultiRobotB() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1896 to 1923) SpanInfo: {"start":1928,"length":18} + >return multiRobotB + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +49 > return multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1924 to 1947) SpanInfo: {"start":1928,"length":18} + >return multiRobotB + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + ~ => Pos: (1948 to 1948) SpanInfo: {"start":1948,"length":1} + >} + >:=> (line 50, col 0) to (line 50, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPattern.baseline new file mode 100644 index 00000000000..9a65a6f2e95 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPattern.baseline @@ -0,0 +1,1024 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 > + + ~ => Pos: (142 to 142) SpanInfo: undefined +-------------------------------- +7 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (143 to 186) SpanInfo: {"start":143,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 7, col 0) to (line 7, col 42) +-------------------------------- +8 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 208) SpanInfo: {"start":213,"length":13} + >return robotA + >:=> (line 9, col 4) to (line 9, col 17) +-------------------------------- +9 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (209 to 227) SpanInfo: {"start":213,"length":13} + >return robotA + >:=> (line 9, col 4) to (line 9, col 17) +-------------------------------- +10 >} + + ~~ => Pos: (228 to 229) SpanInfo: {"start":228,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) +-------------------------------- +11 > + + ~ => Pos: (230 to 230) SpanInfo: undefined +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (231 to 294) SpanInfo: {"start":231,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (295 to 368) SpanInfo: {"start":295,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (369 to 395) SpanInfo: {"start":400,"length":18} + >return multiRobotA + >:=> (line 15, col 4) to (line 15, col 22) +-------------------------------- +15 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (396 to 419) SpanInfo: {"start":400,"length":18} + >return multiRobotA + >:=> (line 15, col 4) to (line 15, col 22) +-------------------------------- +16 >} + + ~~ => Pos: (420 to 421) SpanInfo: {"start":420,"length":1} + >} + >:=> (line 16, col 0) to (line 16, col 1) +-------------------------------- +17 > + + ~ => Pos: (422 to 422) SpanInfo: undefined +-------------------------------- +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (423 to 450) SpanInfo: {"start":435,"length":5} + >nameA + >:=> (line 18, col 12) to (line 18, col 17) +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (451 to 457) SpanInfo: {"start":452,"length":5} + >i = 0 + >:=> (line 18, col 29) to (line 18, col 34) +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (458 to 464) SpanInfo: {"start":459,"length":5} + >i < 1 + >:=> (line 18, col 36) to (line 18, col 41) +18 >for (let [, nameA] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (465 to 472) SpanInfo: {"start":466,"length":3} + >i++ + >:=> (line 18, col 43) to (line 18, col 46) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (473 to 496) SpanInfo: {"start":477,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (497 to 498) SpanInfo: {"start":477,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (499 to 530) SpanInfo: {"start":511,"length":5} + >nameA + >:=> (line 21, col 12) to (line 21, col 17) +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (531 to 537) SpanInfo: {"start":532,"length":5} + >i = 0 + >:=> (line 21, col 33) to (line 21, col 38) +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (538 to 544) SpanInfo: {"start":539,"length":5} + >i < 1 + >:=> (line 21, col 40) to (line 21, col 45) +21 >for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (545 to 552) SpanInfo: {"start":546,"length":3} + >i++ + >:=> (line 21, col 47) to (line 21, col 50) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (553 to 576) SpanInfo: {"start":557,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (577 to 578) SpanInfo: {"start":557,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (579 to 626) SpanInfo: {"start":591,"length":5} + >nameA + >:=> (line 24, col 12) to (line 24, col 17) +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (627 to 633) SpanInfo: {"start":628,"length":5} + >i = 0 + >:=> (line 24, col 49) to (line 24, col 54) +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (634 to 640) SpanInfo: {"start":635,"length":5} + >i < 1 + >:=> (line 24, col 56) to (line 24, col 61) +24 >for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (641 to 648) SpanInfo: {"start":642,"length":3} + >i++ + >:=> (line 24, col 63) to (line 24, col 66) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (649 to 672) SpanInfo: {"start":653,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (673 to 674) SpanInfo: {"start":653,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (675 to 685) SpanInfo: {"start":687,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (686 to 701) SpanInfo: {"start":688,"length":13} + >primarySkillA + >:=> (line 27, col 13) to (line 27, col 26) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (702 to 718) SpanInfo: {"start":703,"length":15} + >secondarySkillA + >:=> (line 27, col 28) to (line 27, col 43) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (719 to 734) SpanInfo: {"start":687,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (735 to 741) SpanInfo: {"start":736,"length":5} + >i = 0 + >:=> (line 27, col 61) to (line 27, col 66) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (742 to 748) SpanInfo: {"start":743,"length":5} + >i < 1 + >:=> (line 27, col 68) to (line 27, col 73) +27 >for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (749 to 756) SpanInfo: {"start":750,"length":3} + >i++ + >:=> (line 27, col 75) to (line 27, col 78) +-------------------------------- +28 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (757 to 788) SpanInfo: {"start":761,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +29 >} + + ~~ => Pos: (789 to 790) SpanInfo: {"start":761,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (791 to 801) SpanInfo: {"start":803,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (802 to 817) SpanInfo: {"start":804,"length":13} + >primarySkillA + >:=> (line 30, col 13) to (line 30, col 26) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (818 to 834) SpanInfo: {"start":819,"length":15} + >secondarySkillA + >:=> (line 30, col 28) to (line 30, col 43) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (835 to 854) SpanInfo: {"start":803,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (855 to 861) SpanInfo: {"start":856,"length":5} + >i = 0 + >:=> (line 30, col 65) to (line 30, col 70) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (862 to 868) SpanInfo: {"start":863,"length":5} + >i < 1 + >:=> (line 30, col 72) to (line 30, col 77) +30 >for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (869 to 876) SpanInfo: {"start":870,"length":3} + >i++ + >:=> (line 30, col 79) to (line 30, col 82) +-------------------------------- +31 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (877 to 908) SpanInfo: {"start":881,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +32 >} + + ~~ => Pos: (909 to 910) SpanInfo: {"start":881,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~ => Pos: (911 to 921) SpanInfo: {"start":923,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (922 to 937) SpanInfo: {"start":924,"length":13} + >primarySkillA + >:=> (line 33, col 13) to (line 33, col 26) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (938 to 954) SpanInfo: {"start":939,"length":15} + >secondarySkillA + >:=> (line 33, col 28) to (line 33, col 43) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (955 to 994) SpanInfo: {"start":923,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (995 to 1001) SpanInfo: {"start":996,"length":5} + >i = 0 + >:=> (line 33, col 85) to (line 33, col 90) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1002 to 1008) SpanInfo: {"start":1003,"length":5} + >i < 1 + >:=> (line 33, col 92) to (line 33, col 97) +33 >for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1009 to 1016) SpanInfo: {"start":1010,"length":3} + >i++ + >:=> (line 33, col 99) to (line 33, col 102) +-------------------------------- +34 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1017 to 1048) SpanInfo: {"start":1021,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +35 >} + + ~~ => Pos: (1049 to 1050) SpanInfo: {"start":1021,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +36 > + + ~ => Pos: (1051 to 1051) SpanInfo: undefined +-------------------------------- +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1052 to 1079) SpanInfo: {"start":1062,"length":7} + >numberB + >:=> (line 37, col 10) to (line 37, col 17) +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1080 to 1086) SpanInfo: {"start":1081,"length":5} + >i = 0 + >:=> (line 37, col 29) to (line 37, col 34) +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1087 to 1093) SpanInfo: {"start":1088,"length":5} + >i < 1 + >:=> (line 37, col 36) to (line 37, col 41) +37 >for (let [numberB] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1094 to 1101) SpanInfo: {"start":1095,"length":3} + >i++ + >:=> (line 37, col 43) to (line 37, col 46) +-------------------------------- +38 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1102 to 1127) SpanInfo: {"start":1106,"length":20} + >console.log(numberB) + >:=> (line 38, col 4) to (line 38, col 24) +-------------------------------- +39 >} + + ~~ => Pos: (1128 to 1129) SpanInfo: {"start":1106,"length":20} + >console.log(numberB) + >:=> (line 38, col 4) to (line 38, col 24) +-------------------------------- +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1130 to 1161) SpanInfo: {"start":1140,"length":7} + >numberB + >:=> (line 40, col 10) to (line 40, col 17) +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1162 to 1168) SpanInfo: {"start":1163,"length":5} + >i = 0 + >:=> (line 40, col 33) to (line 40, col 38) +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1169 to 1175) SpanInfo: {"start":1170,"length":5} + >i < 1 + >:=> (line 40, col 40) to (line 40, col 45) +40 >for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1176 to 1183) SpanInfo: {"start":1177,"length":3} + >i++ + >:=> (line 40, col 47) to (line 40, col 50) +-------------------------------- +41 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1184 to 1209) SpanInfo: {"start":1188,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +42 >} + + ~~ => Pos: (1210 to 1211) SpanInfo: {"start":1188,"length":20} + >console.log(numberB) + >:=> (line 41, col 4) to (line 41, col 24) +-------------------------------- +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1212 to 1259) SpanInfo: {"start":1222,"length":7} + >numberB + >:=> (line 43, col 10) to (line 43, col 17) +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1260 to 1266) SpanInfo: {"start":1261,"length":5} + >i = 0 + >:=> (line 43, col 49) to (line 43, col 54) +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1267 to 1273) SpanInfo: {"start":1268,"length":5} + >i < 1 + >:=> (line 43, col 56) to (line 43, col 61) +43 >for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1274 to 1281) SpanInfo: {"start":1275,"length":3} + >i++ + >:=> (line 43, col 63) to (line 43, col 66) +-------------------------------- +44 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1282 to 1307) SpanInfo: {"start":1286,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +45 >} + + ~~ => Pos: (1308 to 1309) SpanInfo: {"start":1286,"length":20} + >console.log(numberB) + >:=> (line 44, col 4) to (line 44, col 24) +-------------------------------- +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1310 to 1340) SpanInfo: {"start":1320,"length":5} + >nameB + >:=> (line 46, col 10) to (line 46, col 15) +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1341 to 1347) SpanInfo: {"start":1342,"length":5} + >i = 0 + >:=> (line 46, col 32) to (line 46, col 37) +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1348 to 1354) SpanInfo: {"start":1349,"length":5} + >i < 1 + >:=> (line 46, col 39) to (line 46, col 44) +46 >for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1355 to 1362) SpanInfo: {"start":1356,"length":3} + >i++ + >:=> (line 46, col 46) to (line 46, col 49) +-------------------------------- +47 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1363 to 1386) SpanInfo: {"start":1367,"length":18} + >console.log(nameB) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +48 >} + + ~~ => Pos: (1387 to 1388) SpanInfo: {"start":1367,"length":18} + >console.log(nameB) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1389 to 1423) SpanInfo: {"start":1399,"length":5} + >nameB + >:=> (line 49, col 10) to (line 49, col 15) +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1424 to 1430) SpanInfo: {"start":1425,"length":5} + >i = 0 + >:=> (line 49, col 36) to (line 49, col 41) +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1431 to 1437) SpanInfo: {"start":1432,"length":5} + >i < 1 + >:=> (line 49, col 43) to (line 49, col 48) +49 >for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1438 to 1445) SpanInfo: {"start":1439,"length":3} + >i++ + >:=> (line 49, col 50) to (line 49, col 53) +-------------------------------- +50 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1446 to 1469) SpanInfo: {"start":1450,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1470 to 1471) SpanInfo: {"start":1450,"length":18} + >console.log(nameB) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1472 to 1526) SpanInfo: {"start":1482,"length":5} + >nameB + >:=> (line 52, col 10) to (line 52, col 15) +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1527 to 1533) SpanInfo: {"start":1528,"length":5} + >i = 0 + >:=> (line 52, col 56) to (line 52, col 61) +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1534 to 1540) SpanInfo: {"start":1535,"length":5} + >i < 1 + >:=> (line 52, col 63) to (line 52, col 68) +52 >for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1541 to 1548) SpanInfo: {"start":1542,"length":3} + >i++ + >:=> (line 52, col 70) to (line 52, col 73) +-------------------------------- +53 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1549 to 1572) SpanInfo: {"start":1553,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1573 to 1574) SpanInfo: {"start":1553,"length":18} + >console.log(nameB) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 > + + ~ => Pos: (1575 to 1575) SpanInfo: undefined +-------------------------------- +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1576 to 1594) SpanInfo: {"start":1586,"length":8} + >numberA2 + >:=> (line 56, col 10) to (line 56, col 18) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1595 to 1602) SpanInfo: {"start":1596,"length":6} + >nameA2 + >:=> (line 56, col 20) to (line 56, col 26) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1603 to 1621) SpanInfo: {"start":1604,"length":7} + >skillA2 + >:=> (line 56, col 28) to (line 56, col 35) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1622 to 1628) SpanInfo: {"start":1623,"length":5} + >i = 0 + >:=> (line 56, col 47) to (line 56, col 52) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1629 to 1635) SpanInfo: {"start":1630,"length":5} + >i < 1 + >:=> (line 56, col 54) to (line 56, col 59) +56 >for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1636 to 1643) SpanInfo: {"start":1637,"length":3} + >i++ + >:=> (line 56, col 61) to (line 56, col 64) +-------------------------------- +57 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1644 to 1668) SpanInfo: {"start":1648,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +58 >} + + ~~ => Pos: (1669 to 1670) SpanInfo: {"start":1648,"length":19} + >console.log(nameA2) + >:=> (line 57, col 4) to (line 57, col 23) +-------------------------------- +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1671 to 1689) SpanInfo: {"start":1681,"length":8} + >numberA2 + >:=> (line 59, col 10) to (line 59, col 18) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1690 to 1697) SpanInfo: {"start":1691,"length":6} + >nameA2 + >:=> (line 59, col 20) to (line 59, col 26) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1698 to 1720) SpanInfo: {"start":1699,"length":7} + >skillA2 + >:=> (line 59, col 28) to (line 59, col 35) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1721 to 1727) SpanInfo: {"start":1722,"length":5} + >i = 0 + >:=> (line 59, col 51) to (line 59, col 56) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1728 to 1734) SpanInfo: {"start":1729,"length":5} + >i < 1 + >:=> (line 59, col 58) to (line 59, col 63) +59 >for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1735 to 1742) SpanInfo: {"start":1736,"length":3} + >i++ + >:=> (line 59, col 65) to (line 59, col 68) +-------------------------------- +60 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1743 to 1767) SpanInfo: {"start":1747,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +61 >} + + ~~ => Pos: (1768 to 1769) SpanInfo: {"start":1747,"length":19} + >console.log(nameA2) + >:=> (line 60, col 4) to (line 60, col 23) +-------------------------------- +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1770 to 1788) SpanInfo: {"start":1780,"length":8} + >numberA2 + >:=> (line 62, col 10) to (line 62, col 18) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1789 to 1796) SpanInfo: {"start":1790,"length":6} + >nameA2 + >:=> (line 62, col 20) to (line 62, col 26) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1797 to 1835) SpanInfo: {"start":1798,"length":7} + >skillA2 + >:=> (line 62, col 28) to (line 62, col 35) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1836 to 1842) SpanInfo: {"start":1837,"length":5} + >i = 0 + >:=> (line 62, col 67) to (line 62, col 72) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1843 to 1849) SpanInfo: {"start":1844,"length":5} + >i < 1 + >:=> (line 62, col 74) to (line 62, col 79) +62 >for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1850 to 1857) SpanInfo: {"start":1851,"length":3} + >i++ + >:=> (line 62, col 81) to (line 62, col 84) +-------------------------------- +63 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1858 to 1882) SpanInfo: {"start":1862,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +64 >} + + ~~ => Pos: (1883 to 1884) SpanInfo: {"start":1862,"length":19} + >console.log(nameA2) + >:=> (line 63, col 4) to (line 63, col 23) +-------------------------------- +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1885 to 1901) SpanInfo: {"start":1895,"length":6} + >nameMA + >:=> (line 65, col 10) to (line 65, col 16) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (1902 to 1917) SpanInfo: {"start":1904,"length":13} + >primarySkillA + >:=> (line 65, col 19) to (line 65, col 32) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1918 to 1934) SpanInfo: {"start":1919,"length":15} + >secondarySkillA + >:=> (line 65, col 34) to (line 65, col 49) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (1935 to 1950) SpanInfo: {"start":1903,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 65, col 18) to (line 65, col 50) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1951 to 1957) SpanInfo: {"start":1952,"length":5} + >i = 0 + >:=> (line 65, col 67) to (line 65, col 72) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1958 to 1964) SpanInfo: {"start":1959,"length":5} + >i < 1 + >:=> (line 65, col 74) to (line 65, col 79) +65 >for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1965 to 1972) SpanInfo: {"start":1966,"length":3} + >i++ + >:=> (line 65, col 81) to (line 65, col 84) +-------------------------------- +66 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1973 to 1997) SpanInfo: {"start":1977,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +67 >} + + ~~ => Pos: (1998 to 1999) SpanInfo: {"start":1977,"length":19} + >console.log(nameMA) + >:=> (line 66, col 4) to (line 66, col 23) +-------------------------------- +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2000 to 2016) SpanInfo: {"start":2010,"length":6} + >nameMA + >:=> (line 68, col 10) to (line 68, col 16) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2017 to 2032) SpanInfo: {"start":2019,"length":13} + >primarySkillA + >:=> (line 68, col 19) to (line 68, col 32) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2033 to 2049) SpanInfo: {"start":2034,"length":15} + >secondarySkillA + >:=> (line 68, col 34) to (line 68, col 49) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~=> Pos: (2050 to 2069) SpanInfo: {"start":2018,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 68, col 18) to (line 68, col 50) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2070 to 2076) SpanInfo: {"start":2071,"length":5} + >i = 0 + >:=> (line 68, col 71) to (line 68, col 76) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2077 to 2083) SpanInfo: {"start":2078,"length":5} + >i < 1 + >:=> (line 68, col 78) to (line 68, col 83) +68 >for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2084 to 2091) SpanInfo: {"start":2085,"length":3} + >i++ + >:=> (line 68, col 85) to (line 68, col 88) +-------------------------------- +69 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2092 to 2116) SpanInfo: {"start":2096,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +70 >} + + ~~ => Pos: (2117 to 2118) SpanInfo: {"start":2096,"length":19} + >console.log(nameMA) + >:=> (line 69, col 4) to (line 69, col 23) +-------------------------------- +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2119 to 2135) SpanInfo: {"start":2129,"length":6} + >nameMA + >:=> (line 71, col 10) to (line 71, col 16) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~ => Pos: (2136 to 2151) SpanInfo: {"start":2138,"length":13} + >primarySkillA + >:=> (line 71, col 19) to (line 71, col 32) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~=> Pos: (2152 to 2168) SpanInfo: {"start":2153,"length":15} + >secondarySkillA + >:=> (line 71, col 34) to (line 71, col 49) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2169 to 2208) SpanInfo: {"start":2137,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 71, col 18) to (line 71, col 50) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2209 to 2215) SpanInfo: {"start":2210,"length":5} + >i = 0 + >:=> (line 71, col 91) to (line 71, col 96) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2216 to 2222) SpanInfo: {"start":2217,"length":5} + >i < 1 + >:=> (line 71, col 98) to (line 71, col 103) +71 >for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2223 to 2230) SpanInfo: {"start":2224,"length":3} + >i++ + >:=> (line 71, col 105) to (line 71, col 108) +-------------------------------- +72 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2231 to 2255) SpanInfo: {"start":2235,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +73 >} + + ~~ => Pos: (2256 to 2257) SpanInfo: {"start":2235,"length":19} + >console.log(nameMA) + >:=> (line 72, col 4) to (line 72, col 23) +-------------------------------- +74 > + + ~ => Pos: (2258 to 2258) SpanInfo: undefined +-------------------------------- +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2259 to 2277) SpanInfo: {"start":2269,"length":8} + >numberA3 + >:=> (line 75, col 10) to (line 75, col 18) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2278 to 2302) SpanInfo: {"start":2279,"length":13} + >...robotAInfo + >:=> (line 75, col 20) to (line 75, col 33) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2303 to 2309) SpanInfo: {"start":2304,"length":5} + >i = 0 + >:=> (line 75, col 45) to (line 75, col 50) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2310 to 2316) SpanInfo: {"start":2311,"length":5} + >i < 1 + >:=> (line 75, col 52) to (line 75, col 57) +75 >for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2317 to 2324) SpanInfo: {"start":2318,"length":3} + >i++ + >:=> (line 75, col 59) to (line 75, col 62) +-------------------------------- +76 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2325 to 2351) SpanInfo: {"start":2329,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +77 >} + + ~~ => Pos: (2352 to 2353) SpanInfo: {"start":2329,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2354 to 2372) SpanInfo: {"start":2364,"length":8} + >numberA3 + >:=> (line 78, col 10) to (line 78, col 18) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2373 to 2401) SpanInfo: {"start":2374,"length":13} + >...robotAInfo + >:=> (line 78, col 20) to (line 78, col 33) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2402 to 2408) SpanInfo: {"start":2403,"length":5} + >i = 0 + >:=> (line 78, col 49) to (line 78, col 54) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2409 to 2415) SpanInfo: {"start":2410,"length":5} + >i < 1 + >:=> (line 78, col 56) to (line 78, col 61) +78 >for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2416 to 2423) SpanInfo: {"start":2417,"length":3} + >i++ + >:=> (line 78, col 63) to (line 78, col 66) +-------------------------------- +79 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2424 to 2450) SpanInfo: {"start":2428,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +80 >} + + ~~ => Pos: (2451 to 2452) SpanInfo: {"start":2428,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2453 to 2471) SpanInfo: {"start":2463,"length":8} + >numberA3 + >:=> (line 81, col 10) to (line 81, col 18) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2472 to 2516) SpanInfo: {"start":2473,"length":13} + >...robotAInfo + >:=> (line 81, col 20) to (line 81, col 33) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2517 to 2523) SpanInfo: {"start":2518,"length":5} + >i = 0 + >:=> (line 81, col 65) to (line 81, col 70) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2524 to 2530) SpanInfo: {"start":2525,"length":5} + >i < 1 + >:=> (line 81, col 72) to (line 81, col 77) +81 >for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2531 to 2538) SpanInfo: {"start":2532,"length":3} + >i++ + >:=> (line 81, col 79) to (line 81, col 82) +-------------------------------- +82 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2539 to 2565) SpanInfo: {"start":2543,"length":21} + >console.log(numberA3) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +83 >} + + ~~ => Pos: (2566 to 2567) SpanInfo: {"start":2543,"length":21} + >console.log(numberA3) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2568 to 2611) SpanInfo: {"start":2578,"length":18} + >...multiRobotAInfo + >:=> (line 84, col 10) to (line 84, col 28) +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2612 to 2618) SpanInfo: {"start":2613,"length":5} + >i = 0 + >:=> (line 84, col 45) to (line 84, col 50) +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2619 to 2625) SpanInfo: {"start":2620,"length":5} + >i < 1 + >:=> (line 84, col 52) to (line 84, col 57) +84 >for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2626 to 2633) SpanInfo: {"start":2627,"length":3} + >i++ + >:=> (line 84, col 59) to (line 84, col 62) +-------------------------------- +85 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2634 to 2667) SpanInfo: {"start":2638,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +86 >} + + ~~ => Pos: (2668 to 2669) SpanInfo: {"start":2638,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2670 to 2717) SpanInfo: {"start":2680,"length":18} + >...multiRobotAInfo + >:=> (line 87, col 10) to (line 87, col 28) +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2718 to 2724) SpanInfo: {"start":2719,"length":5} + >i = 0 + >:=> (line 87, col 49) to (line 87, col 54) +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2725 to 2731) SpanInfo: {"start":2726,"length":5} + >i < 1 + >:=> (line 87, col 56) to (line 87, col 61) +87 >for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2732 to 2739) SpanInfo: {"start":2733,"length":3} + >i++ + >:=> (line 87, col 63) to (line 87, col 66) +-------------------------------- +88 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2740 to 2773) SpanInfo: {"start":2744,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) +-------------------------------- +89 >} + + ~~ => Pos: (2774 to 2775) SpanInfo: {"start":2744,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) +-------------------------------- +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2776 to 2843) SpanInfo: {"start":2786,"length":18} + >...multiRobotAInfo + >:=> (line 90, col 10) to (line 90, col 28) +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2844 to 2850) SpanInfo: {"start":2845,"length":5} + >i = 0 + >:=> (line 90, col 69) to (line 90, col 74) +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2851 to 2857) SpanInfo: {"start":2852,"length":5} + >i < 1 + >:=> (line 90, col 76) to (line 90, col 81) +90 >for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2858 to 2865) SpanInfo: {"start":2859,"length":3} + >i++ + >:=> (line 90, col 83) to (line 90, col 86) +-------------------------------- +91 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2866 to 2899) SpanInfo: {"start":2870,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 91, col 4) to (line 91, col 32) +-------------------------------- +92 >} + ~ => Pos: (2900 to 2900) SpanInfo: {"start":2870,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 91, col 4) to (line 91, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..78fc1b42b2f --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,1042 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 133) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (134 to 177) SpanInfo: {"start":134,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (178 to 199) SpanInfo: {"start":204,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +8 > return robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (200 to 218) SpanInfo: {"start":204,"length":13} + >return robotA + >:=> (line 8, col 4) to (line 8, col 17) +-------------------------------- +9 >} + + ~~ => Pos: (219 to 220) SpanInfo: {"start":219,"length":1} + >} + >:=> (line 9, col 0) to (line 9, col 1) +-------------------------------- +10 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (221 to 284) SpanInfo: {"start":221,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 10, col 0) to (line 10, col 62) +-------------------------------- +11 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (285 to 358) SpanInfo: {"start":285,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 11, col 0) to (line 11, col 72) +-------------------------------- +12 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (359 to 385) SpanInfo: {"start":390,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +13 > return multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (386 to 409) SpanInfo: {"start":390,"length":18} + >return multiRobotA + >:=> (line 13, col 4) to (line 13, col 22) +-------------------------------- +14 >} + + ~~ => Pos: (410 to 411) SpanInfo: {"start":410,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (412 to 447) SpanInfo: {"start":424,"length":13} + >nameA ="name" + >:=> (line 15, col 12) to (line 15, col 25) +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (448 to 454) SpanInfo: {"start":449,"length":5} + >i = 0 + >:=> (line 15, col 37) to (line 15, col 42) +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (455 to 461) SpanInfo: {"start":456,"length":5} + >i < 1 + >:=> (line 15, col 44) to (line 15, col 49) +15 >for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (462 to 469) SpanInfo: {"start":463,"length":3} + >i++ + >:=> (line 15, col 51) to (line 15, col 54) +-------------------------------- +16 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (470 to 493) SpanInfo: {"start":474,"length":18} + >console.log(nameA) + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (494 to 495) SpanInfo: {"start":474,"length":18} + >console.log(nameA) + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (496 to 536) SpanInfo: {"start":508,"length":14} + >nameA = "name" + >:=> (line 18, col 12) to (line 18, col 26) +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (537 to 543) SpanInfo: {"start":538,"length":5} + >i = 0 + >:=> (line 18, col 42) to (line 18, col 47) +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (544 to 550) SpanInfo: {"start":545,"length":5} + >i < 1 + >:=> (line 18, col 49) to (line 18, col 54) +18 >for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (551 to 558) SpanInfo: {"start":552,"length":3} + >i++ + >:=> (line 18, col 56) to (line 18, col 59) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (559 to 582) SpanInfo: {"start":563,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (583 to 584) SpanInfo: {"start":563,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (585 to 641) SpanInfo: {"start":597,"length":14} + >nameA = "name" + >:=> (line 21, col 12) to (line 21, col 26) +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (642 to 648) SpanInfo: {"start":643,"length":5} + >i = 0 + >:=> (line 21, col 58) to (line 21, col 63) +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (649 to 655) SpanInfo: {"start":650,"length":5} + >i < 1 + >:=> (line 21, col 65) to (line 21, col 70) +21 >for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (656 to 663) SpanInfo: {"start":657,"length":3} + >i++ + >:=> (line 21, col 72) to (line 21, col 75) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (664 to 687) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (688 to 689) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (690 to 700) SpanInfo: {"start":702,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 24, col 12) to (line 27, col 20) +24 >for (let [, [ + + ~~~ => Pos: (701 to 703) SpanInfo: {"start":708,"length":25} + >primarySkillA = "primary" + >:=> (line 25, col 4) to (line 25, col 29) +-------------------------------- +25 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (704 to 734) SpanInfo: {"start":708,"length":25} + >primarySkillA = "primary" + >:=> (line 25, col 4) to (line 25, col 29) +-------------------------------- +26 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (735 to 768) SpanInfo: {"start":739,"length":29} + >secondarySkillA = "secondary" + >:=> (line 26, col 4) to (line 26, col 33) +-------------------------------- +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~ => Pos: (769 to 769) SpanInfo: {"start":739,"length":29} + >secondarySkillA = "secondary" + >:=> (line 26, col 4) to (line 26, col 33) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (770 to 804) SpanInfo: {"start":702,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 24, col 12) to (line 27, col 20) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (805 to 811) SpanInfo: {"start":806,"length":5} + >i = 0 + >:=> (line 27, col 37) to (line 27, col 42) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (812 to 818) SpanInfo: {"start":813,"length":5} + >i < 1 + >:=> (line 27, col 44) to (line 27, col 49) +27 >] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (819 to 826) SpanInfo: {"start":820,"length":3} + >i++ + >:=> (line 27, col 51) to (line 27, col 54) +-------------------------------- +28 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (827 to 858) SpanInfo: {"start":831,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +29 >} + + ~~ => Pos: (859 to 860) SpanInfo: {"start":831,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +30 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (861 to 871) SpanInfo: {"start":873,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 30, col 12) to (line 33, col 20) +30 >for (let [, [ + + ~~~ => Pos: (872 to 874) SpanInfo: {"start":879,"length":25} + >primarySkillA = "primary" + >:=> (line 31, col 4) to (line 31, col 29) +-------------------------------- +31 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (875 to 905) SpanInfo: {"start":879,"length":25} + >primarySkillA = "primary" + >:=> (line 31, col 4) to (line 31, col 29) +-------------------------------- +32 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (906 to 939) SpanInfo: {"start":910,"length":29} + >secondarySkillA = "secondary" + >:=> (line 32, col 4) to (line 32, col 33) +-------------------------------- +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~ => Pos: (940 to 940) SpanInfo: {"start":910,"length":29} + >secondarySkillA = "secondary" + >:=> (line 32, col 4) to (line 32, col 33) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (941 to 979) SpanInfo: {"start":873,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 30, col 12) to (line 33, col 20) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (980 to 986) SpanInfo: {"start":981,"length":5} + >i = 0 + >:=> (line 33, col 41) to (line 33, col 46) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (987 to 993) SpanInfo: {"start":988,"length":5} + >i < 1 + >:=> (line 33, col 48) to (line 33, col 53) +33 >] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (994 to 1001) SpanInfo: {"start":995,"length":3} + >i++ + >:=> (line 33, col 55) to (line 33, col 58) +-------------------------------- +34 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1002 to 1033) SpanInfo: {"start":1006,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +35 >} + + ~~ => Pos: (1034 to 1035) SpanInfo: {"start":1006,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +36 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (1036 to 1046) SpanInfo: {"start":1048,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 36, col 12) to (line 39, col 20) +36 >for (let [, [ + + ~~~ => Pos: (1047 to 1049) SpanInfo: {"start":1054,"length":25} + >primarySkillA = "primary" + >:=> (line 37, col 4) to (line 37, col 29) +-------------------------------- +37 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1050 to 1080) SpanInfo: {"start":1054,"length":25} + >primarySkillA = "primary" + >:=> (line 37, col 4) to (line 37, col 29) +-------------------------------- +38 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1081 to 1114) SpanInfo: {"start":1085,"length":29} + >secondarySkillA = "secondary" + >:=> (line 38, col 4) to (line 38, col 33) +-------------------------------- +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~ => Pos: (1115 to 1115) SpanInfo: {"start":1085,"length":29} + >secondarySkillA = "secondary" + >:=> (line 38, col 4) to (line 38, col 33) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1116 to 1174) SpanInfo: {"start":1048,"length":87} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["none", "none"] + >:=> (line 36, col 12) to (line 39, col 20) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1175 to 1181) SpanInfo: {"start":1176,"length":5} + >i = 0 + >:=> (line 39, col 61) to (line 39, col 66) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1182 to 1188) SpanInfo: {"start":1183,"length":5} + >i < 1 + >:=> (line 39, col 68) to (line 39, col 73) +39 >] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1189 to 1196) SpanInfo: {"start":1190,"length":3} + >i++ + >:=> (line 39, col 75) to (line 39, col 78) +-------------------------------- +40 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1197 to 1228) SpanInfo: {"start":1201,"length":26} + >console.log(primarySkillA) + >:=> (line 40, col 4) to (line 40, col 30) +-------------------------------- +41 >} + + ~~ => Pos: (1229 to 1230) SpanInfo: {"start":1201,"length":26} + >console.log(primarySkillA) + >:=> (line 40, col 4) to (line 40, col 30) +-------------------------------- +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1231 to 1263) SpanInfo: {"start":1241,"length":12} + >numberB = -1 + >:=> (line 42, col 10) to (line 42, col 22) +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1264 to 1270) SpanInfo: {"start":1265,"length":5} + >i = 0 + >:=> (line 42, col 34) to (line 42, col 39) +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1271 to 1277) SpanInfo: {"start":1272,"length":5} + >i < 1 + >:=> (line 42, col 41) to (line 42, col 46) +42 >for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1278 to 1285) SpanInfo: {"start":1279,"length":3} + >i++ + >:=> (line 42, col 48) to (line 42, col 51) +-------------------------------- +43 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1286 to 1311) SpanInfo: {"start":1290,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +44 >} + + ~~ => Pos: (1312 to 1313) SpanInfo: {"start":1290,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1314 to 1350) SpanInfo: {"start":1324,"length":12} + >numberB = -1 + >:=> (line 45, col 10) to (line 45, col 22) +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1351 to 1357) SpanInfo: {"start":1352,"length":5} + >i = 0 + >:=> (line 45, col 38) to (line 45, col 43) +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1358 to 1364) SpanInfo: {"start":1359,"length":5} + >i < 1 + >:=> (line 45, col 45) to (line 45, col 50) +45 >for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1365 to 1372) SpanInfo: {"start":1366,"length":3} + >i++ + >:=> (line 45, col 52) to (line 45, col 55) +-------------------------------- +46 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1373 to 1398) SpanInfo: {"start":1377,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +47 >} + + ~~ => Pos: (1399 to 1400) SpanInfo: {"start":1377,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1401 to 1453) SpanInfo: {"start":1411,"length":12} + >numberB = -1 + >:=> (line 48, col 10) to (line 48, col 22) +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1454 to 1460) SpanInfo: {"start":1455,"length":5} + >i = 0 + >:=> (line 48, col 54) to (line 48, col 59) +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1461 to 1467) SpanInfo: {"start":1462,"length":5} + >i < 1 + >:=> (line 48, col 61) to (line 48, col 66) +48 >for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1468 to 1475) SpanInfo: {"start":1469,"length":3} + >i++ + >:=> (line 48, col 68) to (line 48, col 71) +-------------------------------- +49 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1476 to 1501) SpanInfo: {"start":1480,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +50 >} + + ~~ => Pos: (1502 to 1503) SpanInfo: {"start":1480,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1504 to 1543) SpanInfo: {"start":1514,"length":14} + >nameB = "name" + >:=> (line 51, col 10) to (line 51, col 24) +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1544 to 1550) SpanInfo: {"start":1545,"length":5} + >i = 0 + >:=> (line 51, col 41) to (line 51, col 46) +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1551 to 1557) SpanInfo: {"start":1552,"length":5} + >i < 1 + >:=> (line 51, col 48) to (line 51, col 53) +51 >for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1558 to 1565) SpanInfo: {"start":1559,"length":3} + >i++ + >:=> (line 51, col 55) to (line 51, col 58) +-------------------------------- +52 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1566 to 1589) SpanInfo: {"start":1570,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1590 to 1591) SpanInfo: {"start":1570,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1592 to 1635) SpanInfo: {"start":1602,"length":14} + >nameB = "name" + >:=> (line 54, col 10) to (line 54, col 24) +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1636 to 1642) SpanInfo: {"start":1637,"length":5} + >i = 0 + >:=> (line 54, col 45) to (line 54, col 50) +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1643 to 1649) SpanInfo: {"start":1644,"length":5} + >i < 1 + >:=> (line 54, col 52) to (line 54, col 57) +54 >for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1650 to 1657) SpanInfo: {"start":1651,"length":3} + >i++ + >:=> (line 54, col 59) to (line 54, col 62) +-------------------------------- +55 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1658 to 1681) SpanInfo: {"start":1662,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +56 >} + + ~~ => Pos: (1682 to 1683) SpanInfo: {"start":1662,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1684 to 1747) SpanInfo: {"start":1694,"length":14} + >nameB = "name" + >:=> (line 57, col 10) to (line 57, col 24) +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1748 to 1754) SpanInfo: {"start":1749,"length":5} + >i = 0 + >:=> (line 57, col 65) to (line 57, col 70) +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1755 to 1761) SpanInfo: {"start":1756,"length":5} + >i < 1 + >:=> (line 57, col 72) to (line 57, col 77) +57 >for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1762 to 1769) SpanInfo: {"start":1763,"length":3} + >i++ + >:=> (line 57, col 79) to (line 57, col 82) +-------------------------------- +58 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1770 to 1793) SpanInfo: {"start":1774,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +59 >} + + ~~ => Pos: (1794 to 1795) SpanInfo: {"start":1774,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1796 to 1819) SpanInfo: {"start":1806,"length":13} + >numberA2 = -1 + >:=> (line 60, col 10) to (line 60, col 23) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1820 to 1836) SpanInfo: {"start":1821,"length":15} + >nameA2 = "name" + >:=> (line 60, col 25) to (line 60, col 40) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1837 to 1865) SpanInfo: {"start":1838,"length":17} + >skillA2 = "skill" + >:=> (line 60, col 42) to (line 60, col 59) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1866 to 1872) SpanInfo: {"start":1867,"length":5} + >i = 0 + >:=> (line 60, col 71) to (line 60, col 76) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1873 to 1879) SpanInfo: {"start":1874,"length":5} + >i < 1 + >:=> (line 60, col 78) to (line 60, col 83) +60 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1880 to 1887) SpanInfo: {"start":1881,"length":3} + >i++ + >:=> (line 60, col 85) to (line 60, col 88) +-------------------------------- +61 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1888 to 1912) SpanInfo: {"start":1892,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +62 >} + + ~~ => Pos: (1913 to 1914) SpanInfo: {"start":1892,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1915 to 1938) SpanInfo: {"start":1925,"length":13} + >numberA2 = -1 + >:=> (line 63, col 10) to (line 63, col 23) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1939 to 1955) SpanInfo: {"start":1940,"length":15} + >nameA2 = "name" + >:=> (line 63, col 25) to (line 63, col 40) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1956 to 1988) SpanInfo: {"start":1957,"length":17} + >skillA2 = "skill" + >:=> (line 63, col 42) to (line 63, col 59) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1989 to 1995) SpanInfo: {"start":1990,"length":5} + >i = 0 + >:=> (line 63, col 75) to (line 63, col 80) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1996 to 2002) SpanInfo: {"start":1997,"length":5} + >i < 1 + >:=> (line 63, col 82) to (line 63, col 87) +63 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2003 to 2010) SpanInfo: {"start":2004,"length":3} + >i++ + >:=> (line 63, col 89) to (line 63, col 92) +-------------------------------- +64 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2011 to 2035) SpanInfo: {"start":2015,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +65 >} + + ~~ => Pos: (2036 to 2037) SpanInfo: {"start":2015,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2038 to 2061) SpanInfo: {"start":2048,"length":13} + >numberA2 = -1 + >:=> (line 66, col 10) to (line 66, col 23) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~ => Pos: (2062 to 2078) SpanInfo: {"start":2063,"length":15} + >nameA2 = "name" + >:=> (line 66, col 25) to (line 66, col 40) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2079 to 2127) SpanInfo: {"start":2080,"length":17} + >skillA2 = "skill" + >:=> (line 66, col 42) to (line 66, col 59) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2128 to 2134) SpanInfo: {"start":2129,"length":5} + >i = 0 + >:=> (line 66, col 91) to (line 66, col 96) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2135 to 2141) SpanInfo: {"start":2136,"length":5} + >i < 1 + >:=> (line 66, col 98) to (line 66, col 103) +66 >for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2142 to 2149) SpanInfo: {"start":2143,"length":3} + >i++ + >:=> (line 66, col 105) to (line 66, col 108) +-------------------------------- +67 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2150 to 2174) SpanInfo: {"start":2154,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +68 >} + + ~~ => Pos: (2175 to 2176) SpanInfo: {"start":2154,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +69 >for (let + + ~~~~~~~~~ => Pos: (2177 to 2185) SpanInfo: {"start":2191,"length":17} + >nameMA = "noName" + >:=> (line 70, col 5) to (line 70, col 22) +-------------------------------- +70 > [nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2186 to 2209) SpanInfo: {"start":2191,"length":17} + >nameMA = "noName" + >:=> (line 70, col 5) to (line 70, col 22) +-------------------------------- +71 > [ + + ~~~~~~~~~~ => Pos: (2210 to 2219) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 72, col 12) to (line 72, col 37) +-------------------------------- +72 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2220 to 2258) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 72, col 12) to (line 72, col 37) +-------------------------------- +73 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2259 to 2300) SpanInfo: {"start":2271,"length":29} + >secondarySkillA = "secondary" + >:=> (line 73, col 12) to (line 73, col 41) +-------------------------------- +74 > ] = ["none", "none"] + + ~~~~~~~~~ => Pos: (2301 to 2309) SpanInfo: {"start":2271,"length":29} + >secondarySkillA = "secondary" + >:=> (line 73, col 12) to (line 73, col 41) +74 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2310 to 2329) SpanInfo: {"start":2218,"length":111} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 71, col 8) to (line 74, col 28) +-------------------------------- +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2330 to 2349) SpanInfo: {"start":2218,"length":111} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 71, col 8) to (line 74, col 28) +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2350 to 2356) SpanInfo: {"start":2351,"length":5} + >i = 0 + >:=> (line 75, col 21) to (line 75, col 26) +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2357 to 2363) SpanInfo: {"start":2358,"length":5} + >i < 1 + >:=> (line 75, col 28) to (line 75, col 33) +75 > ] = multiRobotA, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2364 to 2371) SpanInfo: {"start":2365,"length":3} + >i++ + >:=> (line 75, col 35) to (line 75, col 38) +-------------------------------- +76 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2372 to 2396) SpanInfo: {"start":2376,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +77 >} + + ~~ => Pos: (2397 to 2398) SpanInfo: {"start":2376,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +78 >for (let [nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2399 to 2427) SpanInfo: {"start":2409,"length":17} + >nameMA = "noName" + >:=> (line 78, col 10) to (line 78, col 27) +-------------------------------- +79 > [ + + ~~~~~~ => Pos: (2428 to 2433) SpanInfo: {"start":2442,"length":25} + >primarySkillA = "primary" + >:=> (line 80, col 8) to (line 80, col 33) +-------------------------------- +80 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2434 to 2468) SpanInfo: {"start":2442,"length":25} + >primarySkillA = "primary" + >:=> (line 80, col 8) to (line 80, col 33) +-------------------------------- +81 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2469 to 2506) SpanInfo: {"start":2477,"length":29} + >secondarySkillA = "secondary" + >:=> (line 81, col 8) to (line 81, col 37) +-------------------------------- +82 > ] = ["none", "none"] + + ~~~~~ => Pos: (2507 to 2511) SpanInfo: {"start":2477,"length":29} + >secondarySkillA = "secondary" + >:=> (line 81, col 8) to (line 81, col 37) +82 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2512 to 2531) SpanInfo: {"start":2432,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 79, col 4) to (line 82, col 24) +-------------------------------- +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (2532 to 2552) SpanInfo: {"start":2432,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 79, col 4) to (line 82, col 24) +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2553 to 2559) SpanInfo: {"start":2554,"length":5} + >i = 0 + >:=> (line 83, col 22) to (line 83, col 27) +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2560 to 2566) SpanInfo: {"start":2561,"length":5} + >i < 1 + >:=> (line 83, col 29) to (line 83, col 34) +83 >] = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2567 to 2574) SpanInfo: {"start":2568,"length":3} + >i++ + >:=> (line 83, col 36) to (line 83, col 39) +-------------------------------- +84 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2575 to 2599) SpanInfo: {"start":2579,"length":19} + >console.log(nameMA) + >:=> (line 84, col 4) to (line 84, col 23) +-------------------------------- +85 >} + + ~~ => Pos: (2600 to 2601) SpanInfo: {"start":2579,"length":19} + >console.log(nameMA) + >:=> (line 84, col 4) to (line 84, col 23) +-------------------------------- +86 >for (let [nameMA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2602 to 2630) SpanInfo: {"start":2612,"length":17} + >nameMA = "noName" + >:=> (line 86, col 10) to (line 86, col 27) +-------------------------------- +87 > [ + + ~~~~~~ => Pos: (2631 to 2636) SpanInfo: {"start":2645,"length":25} + >primarySkillA = "primary" + >:=> (line 88, col 8) to (line 88, col 33) +-------------------------------- +88 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2637 to 2671) SpanInfo: {"start":2645,"length":25} + >primarySkillA = "primary" + >:=> (line 88, col 8) to (line 88, col 33) +-------------------------------- +89 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2672 to 2709) SpanInfo: {"start":2680,"length":29} + >secondarySkillA = "secondary" + >:=> (line 89, col 8) to (line 89, col 37) +-------------------------------- +90 > ] = ["none", "none"] + + ~~~~~ => Pos: (2710 to 2714) SpanInfo: {"start":2680,"length":29} + >secondarySkillA = "secondary" + >:=> (line 89, col 8) to (line 89, col 37) +90 > ] = ["none", "none"] + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2715 to 2734) SpanInfo: {"start":2635,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 87, col 4) to (line 90, col 24) +-------------------------------- +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2735 to 2775) SpanInfo: {"start":2635,"length":99} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + >:=> (line 87, col 4) to (line 90, col 24) +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2776 to 2782) SpanInfo: {"start":2777,"length":5} + >i = 0 + >:=> (line 91, col 42) to (line 91, col 47) +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2783 to 2789) SpanInfo: {"start":2784,"length":5} + >i < 1 + >:=> (line 91, col 49) to (line 91, col 54) +91 >] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2790 to 2797) SpanInfo: {"start":2791,"length":3} + >i++ + >:=> (line 91, col 56) to (line 91, col 59) +-------------------------------- +92 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2798 to 2822) SpanInfo: {"start":2802,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +93 >} + + ~~ => Pos: (2823 to 2824) SpanInfo: {"start":2802,"length":19} + >console.log(nameMA) + >:=> (line 92, col 4) to (line 92, col 23) +-------------------------------- +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2825 to 2848) SpanInfo: {"start":2835,"length":13} + >numberA3 = -1 + >:=> (line 94, col 10) to (line 94, col 23) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2849 to 2873) SpanInfo: {"start":2850,"length":13} + >...robotAInfo + >:=> (line 94, col 25) to (line 94, col 38) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2874 to 2880) SpanInfo: {"start":2875,"length":5} + >i = 0 + >:=> (line 94, col 50) to (line 94, col 55) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2881 to 2887) SpanInfo: {"start":2882,"length":5} + >i < 1 + >:=> (line 94, col 57) to (line 94, col 62) +94 >for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2888 to 2895) SpanInfo: {"start":2889,"length":3} + >i++ + >:=> (line 94, col 64) to (line 94, col 67) +-------------------------------- +95 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2896 to 2922) SpanInfo: {"start":2900,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +96 >} + + ~~ => Pos: (2923 to 2924) SpanInfo: {"start":2900,"length":21} + >console.log(numberA3) + >:=> (line 95, col 4) to (line 95, col 25) +-------------------------------- +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2925 to 2948) SpanInfo: {"start":2935,"length":13} + >numberA3 = -1 + >:=> (line 97, col 10) to (line 97, col 23) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2949 to 2977) SpanInfo: {"start":2950,"length":13} + >...robotAInfo + >:=> (line 97, col 25) to (line 97, col 38) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2978 to 2984) SpanInfo: {"start":2979,"length":5} + >i = 0 + >:=> (line 97, col 54) to (line 97, col 59) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (2985 to 2991) SpanInfo: {"start":2986,"length":5} + >i < 1 + >:=> (line 97, col 61) to (line 97, col 66) +97 >for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (2992 to 2999) SpanInfo: {"start":2993,"length":3} + >i++ + >:=> (line 97, col 68) to (line 97, col 71) +-------------------------------- +98 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3000 to 3026) SpanInfo: {"start":3004,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +99 >} + + ~~ => Pos: (3027 to 3028) SpanInfo: {"start":3004,"length":21} + >console.log(numberA3) + >:=> (line 98, col 4) to (line 98, col 25) +-------------------------------- +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3029 to 3052) SpanInfo: {"start":3039,"length":13} + >numberA3 = -1 + >:=> (line 100, col 10) to (line 100, col 23) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (3053 to 3097) SpanInfo: {"start":3054,"length":13} + >...robotAInfo + >:=> (line 100, col 25) to (line 100, col 38) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3098 to 3104) SpanInfo: {"start":3099,"length":5} + >i = 0 + >:=> (line 100, col 70) to (line 100, col 75) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (3105 to 3111) SpanInfo: {"start":3106,"length":5} + >i < 1 + >:=> (line 100, col 77) to (line 100, col 82) +100>for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (3112 to 3119) SpanInfo: {"start":3113,"length":3} + >i++ + >:=> (line 100, col 84) to (line 100, col 87) +-------------------------------- +101> console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (3120 to 3146) SpanInfo: {"start":3124,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) +-------------------------------- +102>} + ~ => Pos: (3147 to 3147) SpanInfo: {"start":3124,"length":21} + >console.log(numberA3) + >:=> (line 101, col 4) to (line 101, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPattern.baseline new file mode 100644 index 00000000000..718799a8334 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPattern.baseline @@ -0,0 +1,633 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 277) SpanInfo: {"start":223,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (278 to 375) SpanInfo: {"start":278,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (376 to 397) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (398 to 415) SpanInfo: {"start":402,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (416 to 417) SpanInfo: {"start":416,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (418 to 444) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (445 to 467) SpanInfo: {"start":449,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (468 to 469) SpanInfo: {"start":468,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (470 to 501) SpanInfo: {"start":480,"length":11} + >name: nameA + >:=> (line 23, col 10) to (line 23, col 21) +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (502 to 508) SpanInfo: {"start":503,"length":5} + >i = 0 + >:=> (line 23, col 33) to (line 23, col 38) +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (509 to 515) SpanInfo: {"start":510,"length":5} + >i < 1 + >:=> (line 23, col 40) to (line 23, col 45) +23 >for (let {name: nameA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (516 to 523) SpanInfo: {"start":517,"length":3} + >i++ + >:=> (line 23, col 47) to (line 23, col 50) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (524 to 547) SpanInfo: {"start":528,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (548 to 549) SpanInfo: {"start":528,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (550 to 586) SpanInfo: {"start":560,"length":11} + >name: nameA + >:=> (line 26, col 10) to (line 26, col 21) +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (587 to 593) SpanInfo: {"start":588,"length":5} + >i = 0 + >:=> (line 26, col 38) to (line 26, col 43) +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (594 to 600) SpanInfo: {"start":595,"length":5} + >i < 1 + >:=> (line 26, col 45) to (line 26, col 50) +26 >for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (601 to 608) SpanInfo: {"start":602,"length":3} + >i++ + >:=> (line 26, col 52) to (line 26, col 55) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (609 to 632) SpanInfo: {"start":613,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (633 to 634) SpanInfo: {"start":613,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (635 to 706) SpanInfo: {"start":645,"length":11} + >name: nameA + >:=> (line 29, col 10) to (line 29, col 21) +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (707 to 713) SpanInfo: {"start":708,"length":5} + >i = 0 + >:=> (line 29, col 73) to (line 29, col 78) +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (714 to 720) SpanInfo: {"start":715,"length":5} + >i < 1 + >:=> (line 29, col 80) to (line 29, col 85) +29 >for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (721 to 728) SpanInfo: {"start":722,"length":3} + >i++ + >:=> (line 29, col 87) to (line 29, col 90) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (729 to 752) SpanInfo: {"start":733,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (753 to 754) SpanInfo: {"start":733,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (755 to 772) SpanInfo: {"start":766,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 32, col 11) to (line 32, col 63) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (773 to 793) SpanInfo: {"start":776,"length":17} + >primary: primaryA + >:=> (line 32, col 21) to (line 32, col 38) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (794 to 817) SpanInfo: {"start":795,"length":21} + >secondary: secondaryA + >:=> (line 32, col 40) to (line 32, col 61) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (818 to 833) SpanInfo: {"start":766,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 32, col 11) to (line 32, col 63) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (834 to 840) SpanInfo: {"start":835,"length":5} + >i = 0 + >:=> (line 32, col 80) to (line 32, col 85) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (841 to 847) SpanInfo: {"start":842,"length":5} + >i < 1 + >:=> (line 32, col 87) to (line 32, col 92) +32 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (848 to 855) SpanInfo: {"start":849,"length":3} + >i++ + >:=> (line 32, col 94) to (line 32, col 97) +-------------------------------- +33 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (856 to 882) SpanInfo: {"start":860,"length":21} + >console.log(primaryA) + >:=> (line 33, col 4) to (line 33, col 25) +-------------------------------- +34 >} + + ~~ => Pos: (883 to 884) SpanInfo: {"start":860,"length":21} + >console.log(primaryA) + >:=> (line 33, col 4) to (line 33, col 25) +-------------------------------- +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (885 to 902) SpanInfo: {"start":896,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 11) to (line 35, col 63) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (903 to 923) SpanInfo: {"start":906,"length":17} + >primary: primaryA + >:=> (line 35, col 21) to (line 35, col 38) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (924 to 947) SpanInfo: {"start":925,"length":21} + >secondary: secondaryA + >:=> (line 35, col 40) to (line 35, col 61) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (948 to 968) SpanInfo: {"start":896,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 35, col 11) to (line 35, col 63) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (969 to 975) SpanInfo: {"start":970,"length":5} + >i = 0 + >:=> (line 35, col 85) to (line 35, col 90) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (976 to 982) SpanInfo: {"start":977,"length":5} + >i < 1 + >:=> (line 35, col 92) to (line 35, col 97) +35 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (983 to 990) SpanInfo: {"start":984,"length":3} + >i++ + >:=> (line 35, col 99) to (line 35, col 102) +-------------------------------- +36 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (991 to 1017) SpanInfo: {"start":995,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +37 >} + + ~~ => Pos: (1018 to 1019) SpanInfo: {"start":995,"length":21} + >console.log(primaryA) + >:=> (line 36, col 4) to (line 36, col 25) +-------------------------------- +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (1020 to 1037) SpanInfo: {"start":1031,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 11) to (line 38, col 63) +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1038 to 1058) SpanInfo: {"start":1041,"length":17} + >primary: primaryA + >:=> (line 38, col 21) to (line 38, col 38) +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1059 to 1082) SpanInfo: {"start":1060,"length":21} + >secondary: secondaryA + >:=> (line 38, col 40) to (line 38, col 61) +38 >for (let { skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (1083 to 1087) SpanInfo: {"start":1031,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 11) to (line 38, col 63) +-------------------------------- +39 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1088 to 1178) SpanInfo: {"start":1031,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 38, col 11) to (line 38, col 63) +-------------------------------- +40 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1179 to 1188) SpanInfo: {"start":1183,"length":5} + >i = 0 + >:=> (line 40, col 4) to (line 40, col 9) +40 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1189 to 1195) SpanInfo: {"start":1190,"length":5} + >i < 1 + >:=> (line 40, col 11) to (line 40, col 16) +40 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1196 to 1203) SpanInfo: {"start":1197,"length":3} + >i++ + >:=> (line 40, col 18) to (line 40, col 21) +-------------------------------- +41 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1204 to 1230) SpanInfo: {"start":1208,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +42 >} + + ~~ => Pos: (1231 to 1232) SpanInfo: {"start":1208,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1233 to 1254) SpanInfo: {"start":1243,"length":11} + >name: nameA + >:=> (line 43, col 10) to (line 43, col 21) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1255 to 1279) SpanInfo: {"start":1256,"length":13} + >skill: skillA + >:=> (line 43, col 23) to (line 43, col 36) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1280 to 1286) SpanInfo: {"start":1281,"length":5} + >i = 0 + >:=> (line 43, col 48) to (line 43, col 53) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1287 to 1293) SpanInfo: {"start":1288,"length":5} + >i < 1 + >:=> (line 43, col 55) to (line 43, col 60) +43 >for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1294 to 1301) SpanInfo: {"start":1295,"length":3} + >i++ + >:=> (line 43, col 62) to (line 43, col 65) +-------------------------------- +44 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1302 to 1325) SpanInfo: {"start":1306,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +45 >} + + ~~ => Pos: (1326 to 1327) SpanInfo: {"start":1306,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1328 to 1349) SpanInfo: {"start":1338,"length":11} + >name: nameA + >:=> (line 46, col 10) to (line 46, col 21) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1350 to 1379) SpanInfo: {"start":1351,"length":13} + >skill: skillA + >:=> (line 46, col 23) to (line 46, col 36) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1380 to 1386) SpanInfo: {"start":1381,"length":5} + >i = 0 + >:=> (line 46, col 53) to (line 46, col 58) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1387 to 1393) SpanInfo: {"start":1388,"length":5} + >i < 1 + >:=> (line 46, col 60) to (line 46, col 65) +46 >for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1394 to 1401) SpanInfo: {"start":1395,"length":3} + >i++ + >:=> (line 46, col 67) to (line 46, col 70) +-------------------------------- +47 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1402 to 1425) SpanInfo: {"start":1406,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +48 >} + + ~~ => Pos: (1426 to 1427) SpanInfo: {"start":1406,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1428 to 1449) SpanInfo: {"start":1438,"length":11} + >name: nameA + >:=> (line 49, col 10) to (line 49, col 21) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1450 to 1514) SpanInfo: {"start":1451,"length":13} + >skill: skillA + >:=> (line 49, col 23) to (line 49, col 36) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1515 to 1521) SpanInfo: {"start":1516,"length":5} + >i = 0 + >:=> (line 49, col 88) to (line 49, col 93) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1522 to 1528) SpanInfo: {"start":1523,"length":5} + >i < 1 + >:=> (line 49, col 95) to (line 49, col 100) +49 >for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1529 to 1536) SpanInfo: {"start":1530,"length":3} + >i++ + >:=> (line 49, col 102) to (line 49, col 105) +-------------------------------- +50 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1537 to 1560) SpanInfo: {"start":1541,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1561 to 1562) SpanInfo: {"start":1541,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1563 to 1584) SpanInfo: {"start":1573,"length":11} + >name: nameA + >:=> (line 52, col 10) to (line 52, col 21) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1585 to 1592) SpanInfo: {"start":1586,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1593 to 1613) SpanInfo: {"start":1596,"length":17} + >primary: primaryA + >:=> (line 52, col 33) to (line 52, col 50) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1614 to 1637) SpanInfo: {"start":1615,"length":21} + >secondary: secondaryA + >:=> (line 52, col 52) to (line 52, col 73) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~=> Pos: (1638 to 1653) SpanInfo: {"start":1586,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1654 to 1660) SpanInfo: {"start":1655,"length":5} + >i = 0 + >:=> (line 52, col 92) to (line 52, col 97) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1661 to 1667) SpanInfo: {"start":1662,"length":5} + >i < 1 + >:=> (line 52, col 99) to (line 52, col 104) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1668 to 1675) SpanInfo: {"start":1669,"length":3} + >i++ + >:=> (line 52, col 106) to (line 52, col 109) +-------------------------------- +53 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1676 to 1702) SpanInfo: {"start":1680,"length":21} + >console.log(primaryA) + >:=> (line 53, col 4) to (line 53, col 25) +-------------------------------- +54 >} + + ~~ => Pos: (1703 to 1704) SpanInfo: {"start":1680,"length":21} + >console.log(primaryA) + >:=> (line 53, col 4) to (line 53, col 25) +-------------------------------- +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1705 to 1726) SpanInfo: {"start":1715,"length":11} + >name: nameA + >:=> (line 55, col 10) to (line 55, col 21) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1727 to 1734) SpanInfo: {"start":1728,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1735 to 1755) SpanInfo: {"start":1738,"length":17} + >primary: primaryA + >:=> (line 55, col 33) to (line 55, col 50) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1756 to 1779) SpanInfo: {"start":1757,"length":21} + >secondary: secondaryA + >:=> (line 55, col 52) to (line 55, col 73) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1780 to 1800) SpanInfo: {"start":1728,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1801 to 1807) SpanInfo: {"start":1802,"length":5} + >i = 0 + >:=> (line 55, col 97) to (line 55, col 102) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1808 to 1814) SpanInfo: {"start":1809,"length":5} + >i < 1 + >:=> (line 55, col 104) to (line 55, col 109) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1815 to 1822) SpanInfo: {"start":1816,"length":3} + >i++ + >:=> (line 55, col 111) to (line 55, col 114) +-------------------------------- +56 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1823 to 1849) SpanInfo: {"start":1827,"length":21} + >console.log(primaryA) + >:=> (line 56, col 4) to (line 56, col 25) +-------------------------------- +57 >} + + ~~ => Pos: (1850 to 1851) SpanInfo: {"start":1827,"length":21} + >console.log(primaryA) + >:=> (line 56, col 4) to (line 56, col 25) +-------------------------------- +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1852 to 1873) SpanInfo: {"start":1862,"length":11} + >name: nameA + >:=> (line 58, col 10) to (line 58, col 21) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~ => Pos: (1874 to 1881) SpanInfo: {"start":1875,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1882 to 1902) SpanInfo: {"start":1885,"length":17} + >primary: primaryA + >:=> (line 58, col 33) to (line 58, col 50) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1903 to 1926) SpanInfo: {"start":1904,"length":21} + >secondary: secondaryA + >:=> (line 58, col 52) to (line 58, col 73) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + + ~~~~~=> Pos: (1927 to 1931) SpanInfo: {"start":1875,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +-------------------------------- +59 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1932 to 2022) SpanInfo: {"start":1875,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +-------------------------------- +60 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2023 to 2032) SpanInfo: {"start":2027,"length":5} + >i = 0 + >:=> (line 60, col 4) to (line 60, col 9) +60 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2033 to 2039) SpanInfo: {"start":2034,"length":5} + >i < 1 + >:=> (line 60, col 11) to (line 60, col 16) +60 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2040 to 2047) SpanInfo: {"start":2041,"length":3} + >i++ + >:=> (line 60, col 18) to (line 60, col 21) +-------------------------------- +61 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2048 to 2074) SpanInfo: {"start":2052,"length":21} + >console.log(primaryA) + >:=> (line 61, col 4) to (line 61, col 25) +-------------------------------- +62 >} + ~ => Pos: (2075 to 2075) SpanInfo: {"start":2052,"length":21} + >console.log(primaryA) + >:=> (line 61, col 4) to (line 61, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..54d9cbc0471 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,837 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 187) SpanInfo: undefined +-------------------------------- +12 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (188 to 215) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (216 to 222) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (223 to 224) SpanInfo: undefined +-------------------------------- +15 >let robot: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (225 to 279) SpanInfo: {"start":225,"length":53} + >let robot: Robot = { name: "mower", skill: "mowing" } + >:=> (line 15, col 0) to (line 15, col 53) +-------------------------------- +16 >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (280 to 377) SpanInfo: {"start":280,"length":96} + >let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 16, col 0) to (line 16, col 96) +-------------------------------- +17 >function getRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 399) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +18 > return robot; + + ~~~~~~~~~~~~~~~~~~ => Pos: (400 to 417) SpanInfo: {"start":404,"length":12} + >return robot + >:=> (line 18, col 4) to (line 18, col 16) +-------------------------------- +19 >} + + ~~ => Pos: (418 to 419) SpanInfo: {"start":418,"length":1} + >} + >:=> (line 19, col 0) to (line 19, col 1) +-------------------------------- +20 >function getMultiRobot() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (420 to 446) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +21 > return multiRobot; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (447 to 469) SpanInfo: {"start":451,"length":17} + >return multiRobot + >:=> (line 21, col 4) to (line 21, col 21) +-------------------------------- +22 >} + + ~~ => Pos: (470 to 471) SpanInfo: {"start":470,"length":1} + >} + >:=> (line 22, col 0) to (line 22, col 1) +-------------------------------- +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (472 to 513) SpanInfo: {"start":482,"length":21} + >name: nameA= "noName" + >:=> (line 23, col 10) to (line 23, col 31) +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (514 to 520) SpanInfo: {"start":515,"length":5} + >i = 0 + >:=> (line 23, col 43) to (line 23, col 48) +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (521 to 527) SpanInfo: {"start":522,"length":5} + >i < 1 + >:=> (line 23, col 50) to (line 23, col 55) +23 >for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (528 to 535) SpanInfo: {"start":529,"length":3} + >i++ + >:=> (line 23, col 57) to (line 23, col 60) +-------------------------------- +24 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (536 to 559) SpanInfo: {"start":540,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +25 >} + + ~~ => Pos: (560 to 561) SpanInfo: {"start":540,"length":18} + >console.log(nameA) + >:=> (line 24, col 4) to (line 24, col 22) +-------------------------------- +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (562 to 609) SpanInfo: {"start":572,"length":22} + >name: nameA = "noName" + >:=> (line 26, col 10) to (line 26, col 32) +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (610 to 616) SpanInfo: {"start":611,"length":5} + >i = 0 + >:=> (line 26, col 49) to (line 26, col 54) +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (617 to 623) SpanInfo: {"start":618,"length":5} + >i < 1 + >:=> (line 26, col 56) to (line 26, col 61) +26 >for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (624 to 631) SpanInfo: {"start":625,"length":3} + >i++ + >:=> (line 26, col 63) to (line 26, col 66) +-------------------------------- +27 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (632 to 655) SpanInfo: {"start":636,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +28 >} + + ~~ => Pos: (656 to 657) SpanInfo: {"start":636,"length":18} + >console.log(nameA) + >:=> (line 27, col 4) to (line 27, col 22) +-------------------------------- +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (658 to 740) SpanInfo: {"start":668,"length":22} + >name: nameA = "noName" + >:=> (line 29, col 10) to (line 29, col 32) +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (741 to 747) SpanInfo: {"start":742,"length":5} + >i = 0 + >:=> (line 29, col 84) to (line 29, col 89) +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (748 to 754) SpanInfo: {"start":749,"length":5} + >i < 1 + >:=> (line 29, col 91) to (line 29, col 96) +29 >for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (755 to 762) SpanInfo: {"start":756,"length":3} + >i++ + >:=> (line 29, col 98) to (line 29, col 101) +-------------------------------- +30 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (763 to 786) SpanInfo: {"start":767,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +31 >} + + ~~ => Pos: (787 to 788) SpanInfo: {"start":767,"length":18} + >console.log(nameA) + >:=> (line 30, col 4) to (line 30, col 22) +-------------------------------- +32 >for (let { + + ~~~~~~~~~~~ => Pos: (789 to 799) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +-------------------------------- +33 > skills: { + + ~~~~~~~~~~~ => Pos: (800 to 810) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +33 > skills: { + + ~~~ => Pos: (811 to 813) SpanInfo: {"start":822,"length":29} + >primary: primaryA = "primary" + >:=> (line 34, col 8) to (line 34, col 37) +-------------------------------- +34 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (814 to 852) SpanInfo: {"start":822,"length":29} + >primary: primaryA = "primary" + >:=> (line 34, col 8) to (line 34, col 37) +-------------------------------- +35 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (853 to 896) SpanInfo: {"start":861,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 8) to (line 35, col 43) +-------------------------------- +36 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (897 to 901) SpanInfo: {"start":861,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 35, col 8) to (line 35, col 43) +36 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (902 to 943) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +-------------------------------- +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (944 to 958) SpanInfo: {"start":804,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 33, col 4) to (line 36, col 46) +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (959 to 965) SpanInfo: {"start":960,"length":5} + >i = 0 + >:=> (line 37, col 16) to (line 37, col 21) +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (966 to 972) SpanInfo: {"start":967,"length":5} + >i < 1 + >:=> (line 37, col 23) to (line 37, col 28) +37 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (973 to 980) SpanInfo: {"start":974,"length":3} + >i++ + >:=> (line 37, col 30) to (line 37, col 33) +-------------------------------- +38 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (981 to 1007) SpanInfo: {"start":985,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +39 >} + + ~~ => Pos: (1008 to 1009) SpanInfo: {"start":985,"length":21} + >console.log(primaryA) + >:=> (line 38, col 4) to (line 38, col 25) +-------------------------------- +40 >for (let { + + ~~~~~~~~~~~ => Pos: (1010 to 1020) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +-------------------------------- +41 > skills: { + + ~~~~~~~~~~~ => Pos: (1021 to 1031) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +41 > skills: { + + ~~~ => Pos: (1032 to 1034) SpanInfo: {"start":1043,"length":29} + >primary: primaryA = "primary" + >:=> (line 42, col 8) to (line 42, col 37) +-------------------------------- +42 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1035 to 1073) SpanInfo: {"start":1043,"length":29} + >primary: primaryA = "primary" + >:=> (line 42, col 8) to (line 42, col 37) +-------------------------------- +43 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1074 to 1117) SpanInfo: {"start":1082,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 8) to (line 43, col 43) +-------------------------------- +44 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (1118 to 1122) SpanInfo: {"start":1082,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 43, col 8) to (line 43, col 43) +44 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1123 to 1164) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +-------------------------------- +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (1165 to 1184) SpanInfo: {"start":1025,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 41, col 4) to (line 44, col 46) +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1185 to 1191) SpanInfo: {"start":1186,"length":5} + >i = 0 + >:=> (line 45, col 21) to (line 45, col 26) +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1192 to 1198) SpanInfo: {"start":1193,"length":5} + >i < 1 + >:=> (line 45, col 28) to (line 45, col 33) +45 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1199 to 1206) SpanInfo: {"start":1200,"length":3} + >i++ + >:=> (line 45, col 35) to (line 45, col 38) +-------------------------------- +46 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1207 to 1233) SpanInfo: {"start":1211,"length":21} + >console.log(primaryA) + >:=> (line 46, col 4) to (line 46, col 25) +-------------------------------- +47 >} + + ~~ => Pos: (1234 to 1235) SpanInfo: {"start":1211,"length":21} + >console.log(primaryA) + >:=> (line 46, col 4) to (line 46, col 25) +-------------------------------- +48 >for (let { + + ~~~~~~~~~~~ => Pos: (1236 to 1246) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +-------------------------------- +49 > skills: { + + ~~~~~~~~~~~ => Pos: (1247 to 1257) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +49 > skills: { + + ~~~ => Pos: (1258 to 1260) SpanInfo: {"start":1269,"length":29} + >primary: primaryA = "primary" + >:=> (line 50, col 8) to (line 50, col 37) +-------------------------------- +50 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1261 to 1299) SpanInfo: {"start":1269,"length":29} + >primary: primaryA = "primary" + >:=> (line 50, col 8) to (line 50, col 37) +-------------------------------- +51 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1300 to 1343) SpanInfo: {"start":1308,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 51, col 8) to (line 51, col 43) +-------------------------------- +52 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (1344 to 1348) SpanInfo: {"start":1308,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 51, col 8) to (line 51, col 43) +52 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1349 to 1390) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +-------------------------------- +53 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1391 to 1481) SpanInfo: {"start":1251,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 49, col 4) to (line 52, col 46) +-------------------------------- +54 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (1482 to 1491) SpanInfo: {"start":1486,"length":5} + >i = 0 + >:=> (line 54, col 4) to (line 54, col 9) +54 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (1492 to 1498) SpanInfo: {"start":1493,"length":5} + >i < 1 + >:=> (line 54, col 11) to (line 54, col 16) +54 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (1499 to 1506) SpanInfo: {"start":1500,"length":3} + >i++ + >:=> (line 54, col 18) to (line 54, col 21) +-------------------------------- +55 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1507 to 1533) SpanInfo: {"start":1511,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +56 >} + + ~~ => Pos: (1534 to 1535) SpanInfo: {"start":1511,"length":21} + >console.log(primaryA) + >:=> (line 55, col 4) to (line 55, col 25) +-------------------------------- +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1536 to 1568) SpanInfo: {"start":1546,"length":22} + >name: nameA = "noName" + >:=> (line 57, col 10) to (line 57, col 32) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1569 to 1603) SpanInfo: {"start":1570,"length":23} + >skill: skillA = "skill" + >:=> (line 57, col 34) to (line 57, col 57) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1604 to 1610) SpanInfo: {"start":1605,"length":5} + >i = 0 + >:=> (line 57, col 69) to (line 57, col 74) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1611 to 1617) SpanInfo: {"start":1612,"length":5} + >i < 1 + >:=> (line 57, col 76) to (line 57, col 81) +57 >for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1618 to 1625) SpanInfo: {"start":1619,"length":3} + >i++ + >:=> (line 57, col 83) to (line 57, col 86) +-------------------------------- +58 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1626 to 1649) SpanInfo: {"start":1630,"length":18} + >console.log(nameA) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +59 >} + + ~~ => Pos: (1650 to 1651) SpanInfo: {"start":1630,"length":18} + >console.log(nameA) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1652 to 1684) SpanInfo: {"start":1662,"length":22} + >name: nameA = "noName" + >:=> (line 60, col 10) to (line 60, col 32) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1685 to 1724) SpanInfo: {"start":1686,"length":23} + >skill: skillA = "skill" + >:=> (line 60, col 34) to (line 60, col 57) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1725 to 1731) SpanInfo: {"start":1726,"length":5} + >i = 0 + >:=> (line 60, col 74) to (line 60, col 79) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1732 to 1738) SpanInfo: {"start":1733,"length":5} + >i < 1 + >:=> (line 60, col 81) to (line 60, col 86) +60 >for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1739 to 1746) SpanInfo: {"start":1740,"length":3} + >i++ + >:=> (line 60, col 88) to (line 60, col 91) +-------------------------------- +61 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1747 to 1770) SpanInfo: {"start":1751,"length":18} + >console.log(nameA) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +62 >} + + ~~ => Pos: (1771 to 1772) SpanInfo: {"start":1751,"length":18} + >console.log(nameA) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1773 to 1805) SpanInfo: {"start":1783,"length":22} + >name: nameA = "noName" + >:=> (line 63, col 10) to (line 63, col 32) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1806 to 1880) SpanInfo: {"start":1807,"length":23} + >skill: skillA = "skill" + >:=> (line 63, col 34) to (line 63, col 57) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1881 to 1887) SpanInfo: {"start":1882,"length":5} + >i = 0 + >:=> (line 63, col 109) to (line 63, col 114) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~=> Pos: (1888 to 1894) SpanInfo: {"start":1889,"length":5} + >i < 1 + >:=> (line 63, col 116) to (line 63, col 121) +63 >for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + + ~~~~~~~~=> Pos: (1895 to 1902) SpanInfo: {"start":1896,"length":3} + >i++ + >:=> (line 63, col 123) to (line 63, col 126) +-------------------------------- +64 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1903 to 1926) SpanInfo: {"start":1907,"length":18} + >console.log(nameA) + >:=> (line 64, col 4) to (line 64, col 22) +-------------------------------- +65 >} + + ~~ => Pos: (1927 to 1928) SpanInfo: {"start":1907,"length":18} + >console.log(nameA) + >:=> (line 64, col 4) to (line 64, col 22) +-------------------------------- +66 >for (let { + + ~~~~~~~~~~~ => Pos: (1929 to 1939) SpanInfo: {"start":1944,"length":22} + >name: nameA = "noName" + >:=> (line 67, col 4) to (line 67, col 26) +-------------------------------- +67 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1940 to 1967) SpanInfo: {"start":1944,"length":22} + >name: nameA = "noName" + >:=> (line 67, col 4) to (line 67, col 26) +-------------------------------- +68 > skills: { + + ~~~~~~~~~~~ => Pos: (1968 to 1978) SpanInfo: {"start":1972,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 68, col 4) to (line 71, col 46) +68 > skills: { + + ~~~ => Pos: (1979 to 1981) SpanInfo: {"start":1990,"length":29} + >primary: primaryA = "primary" + >:=> (line 69, col 8) to (line 69, col 37) +-------------------------------- +69 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1982 to 2020) SpanInfo: {"start":1990,"length":29} + >primary: primaryA = "primary" + >:=> (line 69, col 8) to (line 69, col 37) +-------------------------------- +70 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2021 to 2064) SpanInfo: {"start":2029,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 70, col 8) to (line 70, col 43) +-------------------------------- +71 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (2065 to 2069) SpanInfo: {"start":2029,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 70, col 8) to (line 70, col 43) +71 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2070 to 2111) SpanInfo: {"start":1972,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 68, col 4) to (line 71, col 46) +-------------------------------- +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~ => Pos: (2112 to 2126) SpanInfo: {"start":1972,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 68, col 4) to (line 71, col 46) +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2127 to 2133) SpanInfo: {"start":2128,"length":5} + >i = 0 + >:=> (line 72, col 16) to (line 72, col 21) +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2134 to 2140) SpanInfo: {"start":2135,"length":5} + >i < 1 + >:=> (line 72, col 23) to (line 72, col 28) +72 >} = multiRobot, i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2141 to 2148) SpanInfo: {"start":2142,"length":3} + >i++ + >:=> (line 72, col 30) to (line 72, col 33) +-------------------------------- +73 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2149 to 2175) SpanInfo: {"start":2153,"length":21} + >console.log(primaryA) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +74 >} + + ~~ => Pos: (2176 to 2177) SpanInfo: {"start":2153,"length":21} + >console.log(primaryA) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +75 >for (let { + + ~~~~~~~~~~~ => Pos: (2178 to 2188) SpanInfo: {"start":2193,"length":22} + >name: nameA = "noName" + >:=> (line 76, col 4) to (line 76, col 26) +-------------------------------- +76 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2189 to 2216) SpanInfo: {"start":2193,"length":22} + >name: nameA = "noName" + >:=> (line 76, col 4) to (line 76, col 26) +-------------------------------- +77 > skills: { + + ~~~~~~~~~~~ => Pos: (2217 to 2227) SpanInfo: {"start":2221,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +77 > skills: { + + ~~~ => Pos: (2228 to 2230) SpanInfo: {"start":2239,"length":29} + >primary: primaryA = "primary" + >:=> (line 78, col 8) to (line 78, col 37) +-------------------------------- +78 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2231 to 2269) SpanInfo: {"start":2239,"length":29} + >primary: primaryA = "primary" + >:=> (line 78, col 8) to (line 78, col 37) +-------------------------------- +79 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2270 to 2313) SpanInfo: {"start":2278,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 79, col 8) to (line 79, col 43) +-------------------------------- +80 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (2314 to 2318) SpanInfo: {"start":2278,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 79, col 8) to (line 79, col 43) +80 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2319 to 2360) SpanInfo: {"start":2221,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +-------------------------------- +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (2361 to 2380) SpanInfo: {"start":2221,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 77, col 4) to (line 80, col 46) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2381 to 2387) SpanInfo: {"start":2382,"length":5} + >i = 0 + >:=> (line 81, col 21) to (line 81, col 26) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2388 to 2394) SpanInfo: {"start":2389,"length":5} + >i < 1 + >:=> (line 81, col 28) to (line 81, col 33) +81 >} = getMultiRobot(), i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2395 to 2402) SpanInfo: {"start":2396,"length":3} + >i++ + >:=> (line 81, col 35) to (line 81, col 38) +-------------------------------- +82 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2403 to 2429) SpanInfo: {"start":2407,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +83 >} + + ~~ => Pos: (2430 to 2431) SpanInfo: {"start":2407,"length":21} + >console.log(primaryA) + >:=> (line 82, col 4) to (line 82, col 25) +-------------------------------- +84 >for (let { + + ~~~~~~~~~~~ => Pos: (2432 to 2442) SpanInfo: {"start":2447,"length":22} + >name: nameA = "noName" + >:=> (line 85, col 4) to (line 85, col 26) +-------------------------------- +85 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2443 to 2470) SpanInfo: {"start":2447,"length":22} + >name: nameA = "noName" + >:=> (line 85, col 4) to (line 85, col 26) +-------------------------------- +86 > skills: { + + ~~~~~~~~~~~ => Pos: (2471 to 2481) SpanInfo: {"start":2475,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 86, col 4) to (line 89, col 46) +86 > skills: { + + ~~~ => Pos: (2482 to 2484) SpanInfo: {"start":2493,"length":29} + >primary: primaryA = "primary" + >:=> (line 87, col 8) to (line 87, col 37) +-------------------------------- +87 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2485 to 2523) SpanInfo: {"start":2493,"length":29} + >primary: primaryA = "primary" + >:=> (line 87, col 8) to (line 87, col 37) +-------------------------------- +88 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2524 to 2567) SpanInfo: {"start":2532,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 88, col 8) to (line 88, col 43) +-------------------------------- +89 > } = { primary: "none", secondary: "none" } + + ~~~~~ => Pos: (2568 to 2572) SpanInfo: {"start":2532,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 88, col 8) to (line 88, col 43) +89 > } = { primary: "none", secondary: "none" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2573 to 2614) SpanInfo: {"start":2475,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 86, col 4) to (line 89, col 46) +-------------------------------- +90 >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2615 to 2705) SpanInfo: {"start":2475,"length":139} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + >:=> (line 86, col 4) to (line 89, col 46) +-------------------------------- +91 > i = 0; i < 1; i++) { + + ~~~~~~~~~~ => Pos: (2706 to 2715) SpanInfo: {"start":2710,"length":5} + >i = 0 + >:=> (line 91, col 4) to (line 91, col 9) +91 > i = 0; i < 1; i++) { + + ~~~~~~~ => Pos: (2716 to 2722) SpanInfo: {"start":2717,"length":5} + >i < 1 + >:=> (line 91, col 11) to (line 91, col 16) +91 > i = 0; i < 1; i++) { + + ~~~~~~~~ => Pos: (2723 to 2730) SpanInfo: {"start":2724,"length":3} + >i++ + >:=> (line 91, col 18) to (line 91, col 21) +-------------------------------- +92 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2731 to 2757) SpanInfo: {"start":2735,"length":21} + >console.log(primaryA) + >:=> (line 92, col 4) to (line 92, col 25) +-------------------------------- +93 >} + ~ => Pos: (2758 to 2758) SpanInfo: {"start":2735,"length":21} + >console.log(primaryA) + >:=> (line 92, col 4) to (line 92, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPattern.baseline new file mode 100644 index 00000000000..2d0cbda5d8d --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPattern.baseline @@ -0,0 +1,778 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >for (let [, nameA] of robots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (547 to 564) SpanInfo: {"start":559,"length":5} + >nameA + >:=> (line 18, col 12) to (line 18, col 17) +18 >for (let [, nameA] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (565 to 578) SpanInfo: {"start":569,"length":6} + >robots + >:=> (line 18, col 22) to (line 18, col 28) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (579 to 602) SpanInfo: {"start":583,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (603 to 604) SpanInfo: {"start":583,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (605 to 622) SpanInfo: {"start":617,"length":5} + >nameA + >:=> (line 21, col 12) to (line 21, col 17) +21 >for (let [, nameA] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (623 to 641) SpanInfo: {"start":627,"length":11} + >getRobots() + >:=> (line 21, col 22) to (line 21, col 33) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (642 to 665) SpanInfo: {"start":646,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (666 to 667) SpanInfo: {"start":646,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (668 to 685) SpanInfo: {"start":680,"length":5} + >nameA + >:=> (line 24, col 12) to (line 24, col 17) +24 >for (let [, nameA] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (686 to 709) SpanInfo: {"start":690,"length":16} + >[robotA, robotB] + >:=> (line 24, col 22) to (line 24, col 38) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (710 to 733) SpanInfo: {"start":714,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (734 to 735) SpanInfo: {"start":714,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~ => Pos: (736 to 746) SpanInfo: {"start":748,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (747 to 762) SpanInfo: {"start":749,"length":13} + >primarySkillA + >:=> (line 27, col 13) to (line 27, col 26) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~ => Pos: (763 to 779) SpanInfo: {"start":764,"length":15} + >secondarySkillA + >:=> (line 27, col 28) to (line 27, col 43) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~ => Pos: (780 to 780) SpanInfo: {"start":748,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 27, col 12) to (line 27, col 44) +27 >for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (781 to 799) SpanInfo: {"start":785,"length":11} + >multiRobots + >:=> (line 27, col 49) to (line 27, col 60) +-------------------------------- +28 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (800 to 831) SpanInfo: {"start":804,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +29 >} + + ~~ => Pos: (832 to 833) SpanInfo: {"start":804,"length":26} + >console.log(primarySkillA) + >:=> (line 28, col 4) to (line 28, col 30) +-------------------------------- +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~ => Pos: (834 to 844) SpanInfo: {"start":846,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (845 to 860) SpanInfo: {"start":847,"length":13} + >primarySkillA + >:=> (line 30, col 13) to (line 30, col 26) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~ => Pos: (861 to 877) SpanInfo: {"start":862,"length":15} + >secondarySkillA + >:=> (line 30, col 28) to (line 30, col 43) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~ => Pos: (878 to 878) SpanInfo: {"start":846,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 30, col 12) to (line 30, col 44) +30 >for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (879 to 902) SpanInfo: {"start":883,"length":16} + >getMultiRobots() + >:=> (line 30, col 49) to (line 30, col 65) +-------------------------------- +31 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (903 to 934) SpanInfo: {"start":907,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +32 >} + + ~~ => Pos: (935 to 936) SpanInfo: {"start":907,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~ => Pos: (937 to 947) SpanInfo: {"start":949,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (948 to 963) SpanInfo: {"start":950,"length":13} + >primarySkillA + >:=> (line 33, col 13) to (line 33, col 26) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~ => Pos: (964 to 980) SpanInfo: {"start":965,"length":15} + >secondarySkillA + >:=> (line 33, col 28) to (line 33, col 43) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (981 to 981) SpanInfo: {"start":949,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 33, col 12) to (line 33, col 44) +33 >for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (982 to 1015) SpanInfo: {"start":986,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 33, col 49) to (line 33, col 75) +-------------------------------- +34 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1016 to 1047) SpanInfo: {"start":1020,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +35 >} + + ~~ => Pos: (1048 to 1049) SpanInfo: {"start":1020,"length":26} + >console.log(primarySkillA) + >:=> (line 34, col 4) to (line 34, col 30) +-------------------------------- +36 >for (let [numberB] of robots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (1050 to 1067) SpanInfo: {"start":1060,"length":7} + >numberB + >:=> (line 36, col 10) to (line 36, col 17) +36 >for (let [numberB] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1068 to 1081) SpanInfo: {"start":1072,"length":6} + >robots + >:=> (line 36, col 22) to (line 36, col 28) +-------------------------------- +37 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1082 to 1107) SpanInfo: {"start":1086,"length":20} + >console.log(numberB) + >:=> (line 37, col 4) to (line 37, col 24) +-------------------------------- +38 >} + + ~~ => Pos: (1108 to 1109) SpanInfo: {"start":1086,"length":20} + >console.log(numberB) + >:=> (line 37, col 4) to (line 37, col 24) +-------------------------------- +39 >for (let [numberB] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (1110 to 1127) SpanInfo: {"start":1120,"length":7} + >numberB + >:=> (line 39, col 10) to (line 39, col 17) +39 >for (let [numberB] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1128 to 1146) SpanInfo: {"start":1132,"length":11} + >getRobots() + >:=> (line 39, col 22) to (line 39, col 33) +-------------------------------- +40 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1147 to 1172) SpanInfo: {"start":1151,"length":20} + >console.log(numberB) + >:=> (line 40, col 4) to (line 40, col 24) +-------------------------------- +41 >} + + ~~ => Pos: (1173 to 1174) SpanInfo: {"start":1151,"length":20} + >console.log(numberB) + >:=> (line 40, col 4) to (line 40, col 24) +-------------------------------- +42 >for (let [numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (1175 to 1192) SpanInfo: {"start":1185,"length":7} + >numberB + >:=> (line 42, col 10) to (line 42, col 17) +42 >for (let [numberB] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1193 to 1216) SpanInfo: {"start":1197,"length":16} + >[robotA, robotB] + >:=> (line 42, col 22) to (line 42, col 38) +-------------------------------- +43 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1217 to 1242) SpanInfo: {"start":1221,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +44 >} + + ~~ => Pos: (1243 to 1244) SpanInfo: {"start":1221,"length":20} + >console.log(numberB) + >:=> (line 43, col 4) to (line 43, col 24) +-------------------------------- +45 >for (let [nameB] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1245 to 1260) SpanInfo: {"start":1255,"length":5} + >nameB + >:=> (line 45, col 10) to (line 45, col 15) +45 >for (let [nameB] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1261 to 1279) SpanInfo: {"start":1265,"length":11} + >multiRobots + >:=> (line 45, col 20) to (line 45, col 31) +-------------------------------- +46 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1280 to 1303) SpanInfo: {"start":1284,"length":18} + >console.log(nameB) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +47 >} + + ~~ => Pos: (1304 to 1305) SpanInfo: {"start":1284,"length":18} + >console.log(nameB) + >:=> (line 46, col 4) to (line 46, col 22) +-------------------------------- +48 >for (let [nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (1306 to 1321) SpanInfo: {"start":1316,"length":5} + >nameB + >:=> (line 48, col 10) to (line 48, col 15) +48 >for (let [nameB] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1322 to 1345) SpanInfo: {"start":1326,"length":16} + >getMultiRobots() + >:=> (line 48, col 20) to (line 48, col 36) +-------------------------------- +49 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1346 to 1369) SpanInfo: {"start":1350,"length":18} + >console.log(nameB) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +50 >} + + ~~ => Pos: (1370 to 1371) SpanInfo: {"start":1350,"length":18} + >console.log(nameB) + >:=> (line 49, col 4) to (line 49, col 22) +-------------------------------- +51 >for (let [nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (1372 to 1387) SpanInfo: {"start":1382,"length":5} + >nameB + >:=> (line 51, col 10) to (line 51, col 15) +51 >for (let [nameB] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1388 to 1421) SpanInfo: {"start":1392,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 51, col 20) to (line 51, col 46) +-------------------------------- +52 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1422 to 1445) SpanInfo: {"start":1426,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +53 >} + + ~~ => Pos: (1446 to 1447) SpanInfo: {"start":1426,"length":18} + >console.log(nameB) + >:=> (line 52, col 4) to (line 52, col 22) +-------------------------------- +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1448 to 1466) SpanInfo: {"start":1458,"length":8} + >numberA2 + >:=> (line 54, col 10) to (line 54, col 18) +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~ => Pos: (1467 to 1474) SpanInfo: {"start":1468,"length":6} + >nameA2 + >:=> (line 54, col 20) to (line 54, col 26) +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~ => Pos: (1475 to 1483) SpanInfo: {"start":1476,"length":7} + >skillA2 + >:=> (line 54, col 28) to (line 54, col 35) +54 >for (let [numberA2, nameA2, skillA2] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1484 to 1497) SpanInfo: {"start":1488,"length":6} + >robots + >:=> (line 54, col 40) to (line 54, col 46) +-------------------------------- +55 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1498 to 1522) SpanInfo: {"start":1502,"length":19} + >console.log(nameA2) + >:=> (line 55, col 4) to (line 55, col 23) +-------------------------------- +56 >} + + ~~ => Pos: (1523 to 1524) SpanInfo: {"start":1502,"length":19} + >console.log(nameA2) + >:=> (line 55, col 4) to (line 55, col 23) +-------------------------------- +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1525 to 1543) SpanInfo: {"start":1535,"length":8} + >numberA2 + >:=> (line 57, col 10) to (line 57, col 18) +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~ => Pos: (1544 to 1551) SpanInfo: {"start":1545,"length":6} + >nameA2 + >:=> (line 57, col 20) to (line 57, col 26) +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~ => Pos: (1552 to 1560) SpanInfo: {"start":1553,"length":7} + >skillA2 + >:=> (line 57, col 28) to (line 57, col 35) +57 >for (let [numberA2, nameA2, skillA2] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1561 to 1579) SpanInfo: {"start":1565,"length":11} + >getRobots() + >:=> (line 57, col 40) to (line 57, col 51) +-------------------------------- +58 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1580 to 1604) SpanInfo: {"start":1584,"length":19} + >console.log(nameA2) + >:=> (line 58, col 4) to (line 58, col 23) +-------------------------------- +59 >} + + ~~ => Pos: (1605 to 1606) SpanInfo: {"start":1584,"length":19} + >console.log(nameA2) + >:=> (line 58, col 4) to (line 58, col 23) +-------------------------------- +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1607 to 1625) SpanInfo: {"start":1617,"length":8} + >numberA2 + >:=> (line 60, col 10) to (line 60, col 18) +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~ => Pos: (1626 to 1633) SpanInfo: {"start":1627,"length":6} + >nameA2 + >:=> (line 60, col 20) to (line 60, col 26) +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~ => Pos: (1634 to 1642) SpanInfo: {"start":1635,"length":7} + >skillA2 + >:=> (line 60, col 28) to (line 60, col 35) +60 >for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1643 to 1666) SpanInfo: {"start":1647,"length":16} + >[robotA, robotB] + >:=> (line 60, col 40) to (line 60, col 56) +-------------------------------- +61 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1667 to 1691) SpanInfo: {"start":1671,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +62 >} + + ~~ => Pos: (1692 to 1693) SpanInfo: {"start":1671,"length":19} + >console.log(nameA2) + >:=> (line 61, col 4) to (line 61, col 23) +-------------------------------- +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1694 to 1710) SpanInfo: {"start":1704,"length":6} + >nameMA + >:=> (line 63, col 10) to (line 63, col 16) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1711 to 1726) SpanInfo: {"start":1713,"length":13} + >primarySkillA + >:=> (line 63, col 19) to (line 63, col 32) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1727 to 1743) SpanInfo: {"start":1728,"length":15} + >secondarySkillA + >:=> (line 63, col 34) to (line 63, col 49) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~=> Pos: (1744 to 1744) SpanInfo: {"start":1712,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 63, col 18) to (line 63, col 50) +63 >for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1745 to 1763) SpanInfo: {"start":1749,"length":11} + >multiRobots + >:=> (line 63, col 55) to (line 63, col 66) +-------------------------------- +64 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1764 to 1788) SpanInfo: {"start":1768,"length":19} + >console.log(nameMA) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +65 >} + + ~~ => Pos: (1789 to 1790) SpanInfo: {"start":1768,"length":19} + >console.log(nameMA) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1791 to 1807) SpanInfo: {"start":1801,"length":6} + >nameMA + >:=> (line 66, col 10) to (line 66, col 16) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (1808 to 1823) SpanInfo: {"start":1810,"length":13} + >primarySkillA + >:=> (line 66, col 19) to (line 66, col 32) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1824 to 1840) SpanInfo: {"start":1825,"length":15} + >secondarySkillA + >:=> (line 66, col 34) to (line 66, col 49) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~=> Pos: (1841 to 1841) SpanInfo: {"start":1809,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 66, col 18) to (line 66, col 50) +66 >for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1842 to 1865) SpanInfo: {"start":1846,"length":16} + >getMultiRobots() + >:=> (line 66, col 55) to (line 66, col 71) +-------------------------------- +67 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1866 to 1890) SpanInfo: {"start":1870,"length":19} + >console.log(nameMA) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +68 >} + + ~~ => Pos: (1891 to 1892) SpanInfo: {"start":1870,"length":19} + >console.log(nameMA) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~ => Pos: (1893 to 1909) SpanInfo: {"start":1903,"length":6} + >nameMA + >:=> (line 69, col 10) to (line 69, col 16) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~ => Pos: (1910 to 1925) SpanInfo: {"start":1912,"length":13} + >primarySkillA + >:=> (line 69, col 19) to (line 69, col 32) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~=> Pos: (1926 to 1942) SpanInfo: {"start":1927,"length":15} + >secondarySkillA + >:=> (line 69, col 34) to (line 69, col 49) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~=> Pos: (1943 to 1943) SpanInfo: {"start":1911,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 69, col 18) to (line 69, col 50) +69 >for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1944 to 1977) SpanInfo: {"start":1948,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 69, col 55) to (line 69, col 81) +-------------------------------- +70 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1978 to 2002) SpanInfo: {"start":1982,"length":19} + >console.log(nameMA) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +71 >} + + ~~ => Pos: (2003 to 2004) SpanInfo: {"start":1982,"length":19} + >console.log(nameMA) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +72 >for (let [numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2005 to 2023) SpanInfo: {"start":2015,"length":8} + >numberA3 + >:=> (line 72, col 10) to (line 72, col 18) +72 >for (let [numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2024 to 2038) SpanInfo: {"start":2025,"length":13} + >...robotAInfo + >:=> (line 72, col 20) to (line 72, col 33) +72 >for (let [numberA3, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2039 to 2052) SpanInfo: {"start":2043,"length":6} + >robots + >:=> (line 72, col 38) to (line 72, col 44) +-------------------------------- +73 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2053 to 2079) SpanInfo: {"start":2057,"length":21} + >console.log(numberA3) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +74 >} + + ~~ => Pos: (2080 to 2081) SpanInfo: {"start":2057,"length":21} + >console.log(numberA3) + >:=> (line 73, col 4) to (line 73, col 25) +-------------------------------- +75 >for (let [numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2082 to 2100) SpanInfo: {"start":2092,"length":8} + >numberA3 + >:=> (line 75, col 10) to (line 75, col 18) +75 >for (let [numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2101 to 2115) SpanInfo: {"start":2102,"length":13} + >...robotAInfo + >:=> (line 75, col 20) to (line 75, col 33) +75 >for (let [numberA3, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2116 to 2134) SpanInfo: {"start":2120,"length":11} + >getRobots() + >:=> (line 75, col 38) to (line 75, col 49) +-------------------------------- +76 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2135 to 2161) SpanInfo: {"start":2139,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +77 >} + + ~~ => Pos: (2162 to 2163) SpanInfo: {"start":2139,"length":21} + >console.log(numberA3) + >:=> (line 76, col 4) to (line 76, col 25) +-------------------------------- +78 >for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2164 to 2182) SpanInfo: {"start":2174,"length":8} + >numberA3 + >:=> (line 78, col 10) to (line 78, col 18) +78 >for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2183 to 2197) SpanInfo: {"start":2184,"length":13} + >...robotAInfo + >:=> (line 78, col 20) to (line 78, col 33) +78 >for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2198 to 2221) SpanInfo: {"start":2202,"length":16} + >[robotA, robotB] + >:=> (line 78, col 38) to (line 78, col 54) +-------------------------------- +79 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2222 to 2248) SpanInfo: {"start":2226,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +80 >} + + ~~ => Pos: (2249 to 2250) SpanInfo: {"start":2226,"length":21} + >console.log(numberA3) + >:=> (line 79, col 4) to (line 79, col 25) +-------------------------------- +81 >for (let [...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2251 to 2279) SpanInfo: {"start":2261,"length":18} + >...multiRobotAInfo + >:=> (line 81, col 10) to (line 81, col 28) +81 >for (let [...multiRobotAInfo] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2280 to 2298) SpanInfo: {"start":2284,"length":11} + >multiRobots + >:=> (line 81, col 33) to (line 81, col 44) +-------------------------------- +82 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2299 to 2332) SpanInfo: {"start":2303,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 82, col 4) to (line 82, col 32) +-------------------------------- +83 >} + + ~~ => Pos: (2333 to 2334) SpanInfo: {"start":2303,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 82, col 4) to (line 82, col 32) +-------------------------------- +84 >for (let [...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2335 to 2363) SpanInfo: {"start":2345,"length":18} + >...multiRobotAInfo + >:=> (line 84, col 10) to (line 84, col 28) +84 >for (let [...multiRobotAInfo] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2364 to 2387) SpanInfo: {"start":2368,"length":16} + >getMultiRobots() + >:=> (line 84, col 33) to (line 84, col 49) +-------------------------------- +85 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2388 to 2421) SpanInfo: {"start":2392,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +86 >} + + ~~ => Pos: (2422 to 2423) SpanInfo: {"start":2392,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 85, col 4) to (line 85, col 32) +-------------------------------- +87 >for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2424 to 2452) SpanInfo: {"start":2434,"length":18} + >...multiRobotAInfo + >:=> (line 87, col 10) to (line 87, col 28) +87 >for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2453 to 2486) SpanInfo: {"start":2457,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 87, col 33) to (line 87, col 59) +-------------------------------- +88 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2487 to 2520) SpanInfo: {"start":2491,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) +-------------------------------- +89 >} + ~ => Pos: (2521 to 2521) SpanInfo: {"start":2491,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 88, col 4) to (line 88, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..5dfc730003f --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,814 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (89 to 141) SpanInfo: undefined +-------------------------------- +6 >let robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (142 to 185) SpanInfo: {"start":142,"length":42} + >let robotA: Robot = [1, "mower", "mowing"] + >:=> (line 6, col 0) to (line 6, col 42) +-------------------------------- +7 >let robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (186 to 233) SpanInfo: {"start":186,"length":46} + >let robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 7, col 0) to (line 7, col 46) +-------------------------------- +8 >let robots = [robotA, robotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (234 to 264) SpanInfo: {"start":234,"length":29} + >let robots = [robotA, robotB] + >:=> (line 8, col 0) to (line 8, col 29) +-------------------------------- +9 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (265 to 287) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +10 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 306) SpanInfo: {"start":292,"length":13} + >return robots + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 >} + + ~~ => Pos: (307 to 308) SpanInfo: {"start":307,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (309 to 372) SpanInfo: {"start":309,"length":62} + >let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 12, col 0) to (line 12, col 62) +-------------------------------- +13 >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 446) SpanInfo: {"start":373,"length":72} + >let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 13, col 0) to (line 13, col 72) +-------------------------------- +14 >let multiRobots = [multiRobotA, multiRobotB]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (447 to 492) SpanInfo: {"start":447,"length":44} + >let multiRobots = [multiRobotA, multiRobotB] + >:=> (line 14, col 0) to (line 14, col 44) +-------------------------------- +15 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (493 to 520) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +16 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 544) SpanInfo: {"start":525,"length":18} + >return multiRobots + >:=> (line 16, col 4) to (line 16, col 22) +-------------------------------- +17 >} + + ~~ => Pos: (545 to 546) SpanInfo: {"start":545,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >for (let [, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (547 to 575) SpanInfo: {"start":559,"length":16} + >nameA = "noName" + >:=> (line 18, col 12) to (line 18, col 28) +18 >for (let [, nameA = "noName"] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (576 to 589) SpanInfo: {"start":580,"length":6} + >robots + >:=> (line 18, col 33) to (line 18, col 39) +-------------------------------- +19 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (590 to 613) SpanInfo: {"start":594,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (614 to 615) SpanInfo: {"start":594,"length":18} + >console.log(nameA) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >for (let [, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (616 to 644) SpanInfo: {"start":628,"length":16} + >nameA = "noName" + >:=> (line 21, col 12) to (line 21, col 28) +21 >for (let [, nameA = "noName"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (645 to 663) SpanInfo: {"start":649,"length":11} + >getRobots() + >:=> (line 21, col 33) to (line 21, col 44) +-------------------------------- +22 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (664 to 687) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (688 to 689) SpanInfo: {"start":668,"length":18} + >console.log(nameA) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +24 >for (let [, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (690 to 718) SpanInfo: {"start":702,"length":16} + >nameA = "noName" + >:=> (line 24, col 12) to (line 24, col 28) +24 >for (let [, nameA = "noName"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (719 to 742) SpanInfo: {"start":723,"length":16} + >[robotA, robotB] + >:=> (line 24, col 33) to (line 24, col 49) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (743 to 766) SpanInfo: {"start":747,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (767 to 768) SpanInfo: {"start":747,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (769 to 779) SpanInfo: {"start":781,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 27, col 12) to (line 30, col 24) +27 >for (let [, [ + + ~~~ => Pos: (780 to 782) SpanInfo: {"start":787,"length":25} + >primarySkillA = "primary" + >:=> (line 28, col 4) to (line 28, col 29) +-------------------------------- +28 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (783 to 813) SpanInfo: {"start":787,"length":25} + >primarySkillA = "primary" + >:=> (line 28, col 4) to (line 28, col 29) +-------------------------------- +29 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (814 to 847) SpanInfo: {"start":818,"length":29} + >secondarySkillA = "secondary" + >:=> (line 29, col 4) to (line 29, col 33) +-------------------------------- +30 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (848 to 848) SpanInfo: {"start":818,"length":29} + >secondarySkillA = "secondary" + >:=> (line 29, col 4) to (line 29, col 33) +30 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (849 to 872) SpanInfo: {"start":781,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 27, col 12) to (line 30, col 24) +30 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (873 to 891) SpanInfo: {"start":877,"length":11} + >multiRobots + >:=> (line 30, col 29) to (line 30, col 40) +-------------------------------- +31 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (892 to 923) SpanInfo: {"start":896,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +32 >} + + ~~ => Pos: (924 to 925) SpanInfo: {"start":896,"length":26} + >console.log(primarySkillA) + >:=> (line 31, col 4) to (line 31, col 30) +-------------------------------- +33 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (926 to 936) SpanInfo: {"start":938,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 33, col 12) to (line 36, col 24) +33 >for (let [, [ + + ~~~ => Pos: (937 to 939) SpanInfo: {"start":944,"length":25} + >primarySkillA = "primary" + >:=> (line 34, col 4) to (line 34, col 29) +-------------------------------- +34 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (940 to 970) SpanInfo: {"start":944,"length":25} + >primarySkillA = "primary" + >:=> (line 34, col 4) to (line 34, col 29) +-------------------------------- +35 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (971 to 1004) SpanInfo: {"start":975,"length":29} + >secondarySkillA = "secondary" + >:=> (line 35, col 4) to (line 35, col 33) +-------------------------------- +36 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (1005 to 1005) SpanInfo: {"start":975,"length":29} + >secondarySkillA = "secondary" + >:=> (line 35, col 4) to (line 35, col 33) +36 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1006 to 1029) SpanInfo: {"start":938,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 33, col 12) to (line 36, col 24) +36 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1030 to 1053) SpanInfo: {"start":1034,"length":16} + >getMultiRobots() + >:=> (line 36, col 29) to (line 36, col 45) +-------------------------------- +37 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1054 to 1085) SpanInfo: {"start":1058,"length":26} + >console.log(primarySkillA) + >:=> (line 37, col 4) to (line 37, col 30) +-------------------------------- +38 >} + + ~~ => Pos: (1086 to 1087) SpanInfo: {"start":1058,"length":26} + >console.log(primarySkillA) + >:=> (line 37, col 4) to (line 37, col 30) +-------------------------------- +39 >for (let [, [ + + ~~~~~~~~~~~ => Pos: (1088 to 1098) SpanInfo: {"start":1100,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 39, col 12) to (line 42, col 24) +39 >for (let [, [ + + ~~~ => Pos: (1099 to 1101) SpanInfo: {"start":1106,"length":25} + >primarySkillA = "primary" + >:=> (line 40, col 4) to (line 40, col 29) +-------------------------------- +40 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1102 to 1132) SpanInfo: {"start":1106,"length":25} + >primarySkillA = "primary" + >:=> (line 40, col 4) to (line 40, col 29) +-------------------------------- +41 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1133 to 1166) SpanInfo: {"start":1137,"length":29} + >secondarySkillA = "secondary" + >:=> (line 41, col 4) to (line 41, col 33) +-------------------------------- +42 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (1167 to 1167) SpanInfo: {"start":1137,"length":29} + >secondarySkillA = "secondary" + >:=> (line 41, col 4) to (line 41, col 33) +42 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1168 to 1191) SpanInfo: {"start":1100,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 39, col 12) to (line 42, col 24) +42 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1192 to 1225) SpanInfo: {"start":1196,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 42, col 29) to (line 42, col 55) +-------------------------------- +43 > console.log(primarySkillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1226 to 1257) SpanInfo: {"start":1230,"length":26} + >console.log(primarySkillA) + >:=> (line 43, col 4) to (line 43, col 30) +-------------------------------- +44 >} + + ~~ => Pos: (1258 to 1259) SpanInfo: {"start":1230,"length":26} + >console.log(primarySkillA) + >:=> (line 43, col 4) to (line 43, col 30) +-------------------------------- +45 >for (let [numberB = -1] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1260 to 1282) SpanInfo: {"start":1270,"length":12} + >numberB = -1 + >:=> (line 45, col 10) to (line 45, col 22) +45 >for (let [numberB = -1] of robots) { + + ~~~~~~~~~~~~~~ => Pos: (1283 to 1296) SpanInfo: {"start":1287,"length":6} + >robots + >:=> (line 45, col 27) to (line 45, col 33) +-------------------------------- +46 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1297 to 1322) SpanInfo: {"start":1301,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +47 >} + + ~~ => Pos: (1323 to 1324) SpanInfo: {"start":1301,"length":20} + >console.log(numberB) + >:=> (line 46, col 4) to (line 46, col 24) +-------------------------------- +48 >for (let [numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1325 to 1347) SpanInfo: {"start":1335,"length":12} + >numberB = -1 + >:=> (line 48, col 10) to (line 48, col 22) +48 >for (let [numberB = -1] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1348 to 1366) SpanInfo: {"start":1352,"length":11} + >getRobots() + >:=> (line 48, col 27) to (line 48, col 38) +-------------------------------- +49 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1367 to 1392) SpanInfo: {"start":1371,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +50 >} + + ~~ => Pos: (1393 to 1394) SpanInfo: {"start":1371,"length":20} + >console.log(numberB) + >:=> (line 49, col 4) to (line 49, col 24) +-------------------------------- +51 >for (let [numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1395 to 1417) SpanInfo: {"start":1405,"length":12} + >numberB = -1 + >:=> (line 51, col 10) to (line 51, col 22) +51 >for (let [numberB = -1] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1418 to 1441) SpanInfo: {"start":1422,"length":16} + >[robotA, robotB] + >:=> (line 51, col 27) to (line 51, col 43) +-------------------------------- +52 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1442 to 1467) SpanInfo: {"start":1446,"length":20} + >console.log(numberB) + >:=> (line 52, col 4) to (line 52, col 24) +-------------------------------- +53 >} + + ~~ => Pos: (1468 to 1469) SpanInfo: {"start":1446,"length":20} + >console.log(numberB) + >:=> (line 52, col 4) to (line 52, col 24) +-------------------------------- +54 >for (let [nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1470 to 1496) SpanInfo: {"start":1480,"length":16} + >nameB = "noName" + >:=> (line 54, col 10) to (line 54, col 26) +54 >for (let [nameB = "noName"] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1497 to 1515) SpanInfo: {"start":1501,"length":11} + >multiRobots + >:=> (line 54, col 31) to (line 54, col 42) +-------------------------------- +55 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1516 to 1539) SpanInfo: {"start":1520,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +56 >} + + ~~ => Pos: (1540 to 1541) SpanInfo: {"start":1520,"length":18} + >console.log(nameB) + >:=> (line 55, col 4) to (line 55, col 22) +-------------------------------- +57 >for (let [nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1542 to 1568) SpanInfo: {"start":1552,"length":16} + >nameB = "noName" + >:=> (line 57, col 10) to (line 57, col 26) +57 >for (let [nameB = "noName"] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1569 to 1592) SpanInfo: {"start":1573,"length":16} + >getMultiRobots() + >:=> (line 57, col 31) to (line 57, col 47) +-------------------------------- +58 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1593 to 1616) SpanInfo: {"start":1597,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +59 >} + + ~~ => Pos: (1617 to 1618) SpanInfo: {"start":1597,"length":18} + >console.log(nameB) + >:=> (line 58, col 4) to (line 58, col 22) +-------------------------------- +60 >for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1619 to 1645) SpanInfo: {"start":1629,"length":16} + >nameB = "noName" + >:=> (line 60, col 10) to (line 60, col 26) +60 >for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1646 to 1679) SpanInfo: {"start":1650,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 60, col 31) to (line 60, col 57) +-------------------------------- +61 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1680 to 1703) SpanInfo: {"start":1684,"length":18} + >console.log(nameB) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +62 >} + + ~~ => Pos: (1704 to 1705) SpanInfo: {"start":1684,"length":18} + >console.log(nameB) + >:=> (line 61, col 4) to (line 61, col 22) +-------------------------------- +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1706 to 1729) SpanInfo: {"start":1716,"length":13} + >numberA2 = -1 + >:=> (line 63, col 10) to (line 63, col 23) +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1730 to 1748) SpanInfo: {"start":1731,"length":17} + >nameA2 = "noName" + >:=> (line 63, col 25) to (line 63, col 42) +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1749 to 1767) SpanInfo: {"start":1750,"length":17} + >skillA2 = "skill" + >:=> (line 63, col 44) to (line 63, col 61) +63 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1768 to 1781) SpanInfo: {"start":1772,"length":6} + >robots + >:=> (line 63, col 66) to (line 63, col 72) +-------------------------------- +64 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1782 to 1806) SpanInfo: {"start":1786,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +65 >} + + ~~ => Pos: (1807 to 1808) SpanInfo: {"start":1786,"length":19} + >console.log(nameA2) + >:=> (line 64, col 4) to (line 64, col 23) +-------------------------------- +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1809 to 1832) SpanInfo: {"start":1819,"length":13} + >numberA2 = -1 + >:=> (line 66, col 10) to (line 66, col 23) +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1833 to 1851) SpanInfo: {"start":1834,"length":17} + >nameA2 = "noName" + >:=> (line 66, col 25) to (line 66, col 42) +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1852 to 1870) SpanInfo: {"start":1853,"length":17} + >skillA2 = "skill" + >:=> (line 66, col 44) to (line 66, col 61) +66 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1871 to 1889) SpanInfo: {"start":1875,"length":11} + >getRobots() + >:=> (line 66, col 66) to (line 66, col 77) +-------------------------------- +67 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1890 to 1914) SpanInfo: {"start":1894,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +68 >} + + ~~ => Pos: (1915 to 1916) SpanInfo: {"start":1894,"length":19} + >console.log(nameA2) + >:=> (line 67, col 4) to (line 67, col 23) +-------------------------------- +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1917 to 1940) SpanInfo: {"start":1927,"length":13} + >numberA2 = -1 + >:=> (line 69, col 10) to (line 69, col 23) +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (1941 to 1959) SpanInfo: {"start":1942,"length":17} + >nameA2 = "noName" + >:=> (line 69, col 25) to (line 69, col 42) +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1960 to 1978) SpanInfo: {"start":1961,"length":17} + >skillA2 = "skill" + >:=> (line 69, col 44) to (line 69, col 61) +69 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1979 to 2002) SpanInfo: {"start":1983,"length":16} + >[robotA, robotB] + >:=> (line 69, col 66) to (line 69, col 82) +-------------------------------- +70 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2003 to 2027) SpanInfo: {"start":2007,"length":19} + >console.log(nameA2) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +71 >} + + ~~ => Pos: (2028 to 2029) SpanInfo: {"start":2007,"length":19} + >console.log(nameA2) + >:=> (line 70, col 4) to (line 70, col 23) +-------------------------------- +72 >for (let [nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2030 to 2057) SpanInfo: {"start":2040,"length":17} + >nameMA = "noName" + >:=> (line 72, col 10) to (line 72, col 27) +72 >for (let [nameMA = "noName", [ + + ~~~ => Pos: (2058 to 2060) SpanInfo: {"start":2065,"length":25} + >primarySkillA = "primary" + >:=> (line 73, col 4) to (line 73, col 29) +-------------------------------- +73 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2061 to 2091) SpanInfo: {"start":2065,"length":25} + >primarySkillA = "primary" + >:=> (line 73, col 4) to (line 73, col 29) +-------------------------------- +74 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2092 to 2125) SpanInfo: {"start":2096,"length":29} + >secondarySkillA = "secondary" + >:=> (line 74, col 4) to (line 74, col 33) +-------------------------------- +75 >] = ["skill1", "skill2"]] of multiRobots) { + + ~ => Pos: (2126 to 2126) SpanInfo: {"start":2096,"length":29} + >secondarySkillA = "secondary" + >:=> (line 74, col 4) to (line 74, col 33) +75 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2127 to 2150) SpanInfo: {"start":2059,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 72, col 29) to (line 75, col 24) +75 >] = ["skill1", "skill2"]] of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2151 to 2169) SpanInfo: {"start":2155,"length":11} + >multiRobots + >:=> (line 75, col 29) to (line 75, col 40) +-------------------------------- +76 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2170 to 2194) SpanInfo: {"start":2174,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +77 >} + + ~~ => Pos: (2195 to 2196) SpanInfo: {"start":2174,"length":19} + >console.log(nameMA) + >:=> (line 76, col 4) to (line 76, col 23) +-------------------------------- +78 >for (let [nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2197 to 2224) SpanInfo: {"start":2207,"length":17} + >nameMA = "noName" + >:=> (line 78, col 10) to (line 78, col 27) +78 >for (let [nameMA = "noName", [ + + ~~~ => Pos: (2225 to 2227) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 79, col 4) to (line 79, col 29) +-------------------------------- +79 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2228 to 2258) SpanInfo: {"start":2232,"length":25} + >primarySkillA = "primary" + >:=> (line 79, col 4) to (line 79, col 29) +-------------------------------- +80 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2259 to 2292) SpanInfo: {"start":2263,"length":29} + >secondarySkillA = "secondary" + >:=> (line 80, col 4) to (line 80, col 33) +-------------------------------- +81 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~ => Pos: (2293 to 2293) SpanInfo: {"start":2263,"length":29} + >secondarySkillA = "secondary" + >:=> (line 80, col 4) to (line 80, col 33) +81 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2294 to 2317) SpanInfo: {"start":2226,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 78, col 29) to (line 81, col 24) +81 >] = ["skill1", "skill2"]] of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2318 to 2341) SpanInfo: {"start":2322,"length":16} + >getMultiRobots() + >:=> (line 81, col 29) to (line 81, col 45) +-------------------------------- +82 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2342 to 2366) SpanInfo: {"start":2346,"length":19} + >console.log(nameMA) + >:=> (line 82, col 4) to (line 82, col 23) +-------------------------------- +83 >} + + ~~ => Pos: (2367 to 2368) SpanInfo: {"start":2346,"length":19} + >console.log(nameMA) + >:=> (line 82, col 4) to (line 82, col 23) +-------------------------------- +84 >for (let [nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2369 to 2396) SpanInfo: {"start":2379,"length":17} + >nameMA = "noName" + >:=> (line 84, col 10) to (line 84, col 27) +84 >for (let [nameMA = "noName", [ + + ~~~ => Pos: (2397 to 2399) SpanInfo: {"start":2404,"length":25} + >primarySkillA = "primary" + >:=> (line 85, col 4) to (line 85, col 29) +-------------------------------- +85 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2400 to 2430) SpanInfo: {"start":2404,"length":25} + >primarySkillA = "primary" + >:=> (line 85, col 4) to (line 85, col 29) +-------------------------------- +86 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2431 to 2464) SpanInfo: {"start":2435,"length":29} + >secondarySkillA = "secondary" + >:=> (line 86, col 4) to (line 86, col 33) +-------------------------------- +87 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~ => Pos: (2465 to 2465) SpanInfo: {"start":2435,"length":29} + >secondarySkillA = "secondary" + >:=> (line 86, col 4) to (line 86, col 33) +87 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2466 to 2489) SpanInfo: {"start":2398,"length":91} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"] + >:=> (line 84, col 29) to (line 87, col 24) +87 >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2490 to 2523) SpanInfo: {"start":2494,"length":26} + >[multiRobotA, multiRobotB] + >:=> (line 87, col 29) to (line 87, col 55) +-------------------------------- +88 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2524 to 2548) SpanInfo: {"start":2528,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +89 >} + + ~~ => Pos: (2549 to 2550) SpanInfo: {"start":2528,"length":19} + >console.log(nameMA) + >:=> (line 88, col 4) to (line 88, col 23) +-------------------------------- +90 >for (let [numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2551 to 2574) SpanInfo: {"start":2561,"length":13} + >numberA3 = -1 + >:=> (line 90, col 10) to (line 90, col 23) +90 >for (let [numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~~ => Pos: (2575 to 2589) SpanInfo: {"start":2576,"length":13} + >...robotAInfo + >:=> (line 90, col 25) to (line 90, col 38) +90 >for (let [numberA3 = -1, ...robotAInfo] of robots) { + + ~~~~~~~~~~~~~~=> Pos: (2590 to 2603) SpanInfo: {"start":2594,"length":6} + >robots + >:=> (line 90, col 43) to (line 90, col 49) +-------------------------------- +91 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2604 to 2630) SpanInfo: {"start":2608,"length":21} + >console.log(numberA3) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +92 >} + + ~~ => Pos: (2631 to 2632) SpanInfo: {"start":2608,"length":21} + >console.log(numberA3) + >:=> (line 91, col 4) to (line 91, col 25) +-------------------------------- +93 >for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2633 to 2656) SpanInfo: {"start":2643,"length":13} + >numberA3 = -1 + >:=> (line 93, col 10) to (line 93, col 23) +93 >for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~ => Pos: (2657 to 2671) SpanInfo: {"start":2658,"length":13} + >...robotAInfo + >:=> (line 93, col 25) to (line 93, col 38) +93 >for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (2672 to 2690) SpanInfo: {"start":2676,"length":11} + >getRobots() + >:=> (line 93, col 43) to (line 93, col 54) +-------------------------------- +94 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2691 to 2717) SpanInfo: {"start":2695,"length":21} + >console.log(numberA3) + >:=> (line 94, col 4) to (line 94, col 25) +-------------------------------- +95 >} + + ~~ => Pos: (2718 to 2719) SpanInfo: {"start":2695,"length":21} + >console.log(numberA3) + >:=> (line 94, col 4) to (line 94, col 25) +-------------------------------- +96 >for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2720 to 2743) SpanInfo: {"start":2730,"length":13} + >numberA3 = -1 + >:=> (line 96, col 10) to (line 96, col 23) +96 >for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~ => Pos: (2744 to 2758) SpanInfo: {"start":2745,"length":13} + >...robotAInfo + >:=> (line 96, col 25) to (line 96, col 38) +96 >for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2759 to 2782) SpanInfo: {"start":2763,"length":16} + >[robotA, robotB] + >:=> (line 96, col 43) to (line 96, col 59) +-------------------------------- +97 > console.log(numberA3); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2783 to 2809) SpanInfo: {"start":2787,"length":21} + >console.log(numberA3) + >:=> (line 97, col 4) to (line 97, col 25) +-------------------------------- +98 >} + ~ => Pos: (2810 to 2810) SpanInfo: {"start":2787,"length":21} + >console.log(numberA3) + >:=> (line 97, col 4) to (line 97, col 25) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPattern.baseline new file mode 100644 index 00000000000..14e0d2a2d27 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPattern.baseline @@ -0,0 +1,523 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 186) SpanInfo: undefined +-------------------------------- +12 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (187 to 213) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (214 to 220) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (221 to 222) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (223 to 322) SpanInfo: {"start":223,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (323 to 424) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (425 to 504) SpanInfo: {"start":323,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (505 to 527) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (528 to 546) SpanInfo: {"start":532,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (547 to 548) SpanInfo: {"start":547,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 576) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (577 to 600) SpanInfo: {"start":581,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (601 to 602) SpanInfo: {"start":601,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >for (let {name: nameA } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (603 to 625) SpanInfo: {"start":613,"length":11} + >name: nameA + >:=> (line 24, col 10) to (line 24, col 21) +24 >for (let {name: nameA } of robots) { + + ~~~~~~~~~~~~~~ => Pos: (626 to 639) SpanInfo: {"start":630,"length":6} + >robots + >:=> (line 24, col 27) to (line 24, col 33) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (640 to 663) SpanInfo: {"start":644,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (664 to 665) SpanInfo: {"start":644,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let {name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (666 to 688) SpanInfo: {"start":676,"length":11} + >name: nameA + >:=> (line 27, col 10) to (line 27, col 21) +27 >for (let {name: nameA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (689 to 707) SpanInfo: {"start":693,"length":11} + >getRobots() + >:=> (line 27, col 27) to (line 27, col 38) +-------------------------------- +28 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (708 to 731) SpanInfo: {"start":712,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +29 >} + + ~~ => Pos: (732 to 733) SpanInfo: {"start":712,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +30 >for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (734 to 756) SpanInfo: {"start":744,"length":11} + >name: nameA + >:=> (line 30, col 10) to (line 30, col 21) +30 >for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (757 to 840) SpanInfo: {"start":761,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 30, col 27) to (line 30, col 103) +-------------------------------- +31 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (841 to 864) SpanInfo: {"start":845,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +32 >} + + ~~ => Pos: (865 to 866) SpanInfo: {"start":845,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (867 to 884) SpanInfo: {"start":878,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 33, col 11) to (line 33, col 63) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (885 to 905) SpanInfo: {"start":888,"length":17} + >primary: primaryA + >:=> (line 33, col 21) to (line 33, col 38) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (906 to 929) SpanInfo: {"start":907,"length":21} + >secondary: secondaryA + >:=> (line 33, col 40) to (line 33, col 61) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (930 to 931) SpanInfo: {"start":878,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 33, col 11) to (line 33, col 63) +33 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (932 to 950) SpanInfo: {"start":936,"length":11} + >multiRobots + >:=> (line 33, col 69) to (line 33, col 80) +-------------------------------- +34 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (951 to 977) SpanInfo: {"start":955,"length":21} + >console.log(primaryA) + >:=> (line 34, col 4) to (line 34, col 25) +-------------------------------- +35 >} + + ~~ => Pos: (978 to 979) SpanInfo: {"start":955,"length":21} + >console.log(primaryA) + >:=> (line 34, col 4) to (line 34, col 25) +-------------------------------- +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (980 to 997) SpanInfo: {"start":991,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 36, col 11) to (line 36, col 63) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (998 to 1018) SpanInfo: {"start":1001,"length":17} + >primary: primaryA + >:=> (line 36, col 21) to (line 36, col 38) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1019 to 1042) SpanInfo: {"start":1020,"length":21} + >secondary: secondaryA + >:=> (line 36, col 40) to (line 36, col 61) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (1043 to 1044) SpanInfo: {"start":991,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 36, col 11) to (line 36, col 63) +36 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1045 to 1068) SpanInfo: {"start":1049,"length":16} + >getMultiRobots() + >:=> (line 36, col 69) to (line 36, col 85) +-------------------------------- +37 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1069 to 1095) SpanInfo: {"start":1073,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +38 >} + + ~~ => Pos: (1096 to 1097) SpanInfo: {"start":1073,"length":21} + >console.log(primaryA) + >:=> (line 37, col 4) to (line 37, col 25) +-------------------------------- +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~ => Pos: (1098 to 1115) SpanInfo: {"start":1109,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 39, col 11) to (line 39, col 63) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (1116 to 1136) SpanInfo: {"start":1119,"length":17} + >primary: primaryA + >:=> (line 39, col 21) to (line 39, col 38) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1137 to 1160) SpanInfo: {"start":1138,"length":21} + >secondary: secondaryA + >:=> (line 39, col 40) to (line 39, col 61) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (1161 to 1162) SpanInfo: {"start":1109,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 39, col 11) to (line 39, col 63) +39 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1163 to 1236) SpanInfo: {"start":1167,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 39, col 69) to (line 40, col 78) +-------------------------------- +40 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1237 to 1318) SpanInfo: {"start":1167,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 39, col 69) to (line 40, col 78) +-------------------------------- +41 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1319 to 1345) SpanInfo: {"start":1323,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +42 >} + + ~~ => Pos: (1346 to 1347) SpanInfo: {"start":1323,"length":21} + >console.log(primaryA) + >:=> (line 41, col 4) to (line 41, col 25) +-------------------------------- +43 >for (let {name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1348 to 1369) SpanInfo: {"start":1358,"length":11} + >name: nameA + >:=> (line 43, col 10) to (line 43, col 21) +43 >for (let {name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~~~ => Pos: (1370 to 1385) SpanInfo: {"start":1371,"length":13} + >skill: skillA + >:=> (line 43, col 23) to (line 43, col 36) +43 >for (let {name: nameA, skill: skillA } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1386 to 1399) SpanInfo: {"start":1390,"length":6} + >robots + >:=> (line 43, col 42) to (line 43, col 48) +-------------------------------- +44 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1400 to 1423) SpanInfo: {"start":1404,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +45 >} + + ~~ => Pos: (1424 to 1425) SpanInfo: {"start":1404,"length":18} + >console.log(nameA) + >:=> (line 44, col 4) to (line 44, col 22) +-------------------------------- +46 >for (let {name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1426 to 1447) SpanInfo: {"start":1436,"length":11} + >name: nameA + >:=> (line 46, col 10) to (line 46, col 21) +46 >for (let {name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~ => Pos: (1448 to 1463) SpanInfo: {"start":1449,"length":13} + >skill: skillA + >:=> (line 46, col 23) to (line 46, col 36) +46 >for (let {name: nameA, skill: skillA } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1464 to 1482) SpanInfo: {"start":1468,"length":11} + >getRobots() + >:=> (line 46, col 42) to (line 46, col 53) +-------------------------------- +47 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1483 to 1506) SpanInfo: {"start":1487,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +48 >} + + ~~ => Pos: (1507 to 1508) SpanInfo: {"start":1487,"length":18} + >console.log(nameA) + >:=> (line 47, col 4) to (line 47, col 22) +-------------------------------- +49 >for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1509 to 1530) SpanInfo: {"start":1519,"length":11} + >name: nameA + >:=> (line 49, col 10) to (line 49, col 21) +49 >for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~ => Pos: (1531 to 1546) SpanInfo: {"start":1532,"length":13} + >skill: skillA + >:=> (line 49, col 23) to (line 49, col 36) +49 >for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1547 to 1630) SpanInfo: {"start":1551,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 49, col 42) to (line 49, col 118) +-------------------------------- +50 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1631 to 1654) SpanInfo: {"start":1635,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +51 >} + + ~~ => Pos: (1655 to 1656) SpanInfo: {"start":1635,"length":18} + >console.log(nameA) + >:=> (line 50, col 4) to (line 50, col 22) +-------------------------------- +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1657 to 1678) SpanInfo: {"start":1667,"length":11} + >name: nameA + >:=> (line 52, col 10) to (line 52, col 21) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~ => Pos: (1679 to 1686) SpanInfo: {"start":1680,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1687 to 1707) SpanInfo: {"start":1690,"length":17} + >primary: primaryA + >:=> (line 52, col 33) to (line 52, col 50) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1708 to 1731) SpanInfo: {"start":1709,"length":21} + >secondary: secondaryA + >:=> (line 52, col 52) to (line 52, col 73) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~=> Pos: (1732 to 1733) SpanInfo: {"start":1680,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 52, col 23) to (line 52, col 75) +52 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1734 to 1752) SpanInfo: {"start":1738,"length":11} + >multiRobots + >:=> (line 52, col 81) to (line 52, col 92) +-------------------------------- +53 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1753 to 1776) SpanInfo: {"start":1757,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +54 >} + + ~~ => Pos: (1777 to 1778) SpanInfo: {"start":1757,"length":18} + >console.log(nameA) + >:=> (line 53, col 4) to (line 53, col 22) +-------------------------------- +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1779 to 1800) SpanInfo: {"start":1789,"length":11} + >name: nameA + >:=> (line 55, col 10) to (line 55, col 21) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~ => Pos: (1801 to 1808) SpanInfo: {"start":1802,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1809 to 1829) SpanInfo: {"start":1812,"length":17} + >primary: primaryA + >:=> (line 55, col 33) to (line 55, col 50) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1830 to 1853) SpanInfo: {"start":1831,"length":21} + >secondary: secondaryA + >:=> (line 55, col 52) to (line 55, col 73) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~=> Pos: (1854 to 1855) SpanInfo: {"start":1802,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 55, col 23) to (line 55, col 75) +55 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1856 to 1879) SpanInfo: {"start":1860,"length":16} + >getMultiRobots() + >:=> (line 55, col 81) to (line 55, col 97) +-------------------------------- +56 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1880 to 1903) SpanInfo: {"start":1884,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +57 >} + + ~~ => Pos: (1904 to 1905) SpanInfo: {"start":1884,"length":18} + >console.log(nameA) + >:=> (line 56, col 4) to (line 56, col 22) +-------------------------------- +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1906 to 1927) SpanInfo: {"start":1916,"length":11} + >name: nameA + >:=> (line 58, col 10) to (line 58, col 21) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~ => Pos: (1928 to 1935) SpanInfo: {"start":1929,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (1936 to 1956) SpanInfo: {"start":1939,"length":17} + >primary: primaryA + >:=> (line 58, col 33) to (line 58, col 50) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1957 to 1980) SpanInfo: {"start":1958,"length":21} + >secondary: secondaryA + >:=> (line 58, col 52) to (line 58, col 73) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~=> Pos: (1981 to 1982) SpanInfo: {"start":1929,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 58, col 23) to (line 58, col 75) +58 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1983 to 2056) SpanInfo: {"start":1987,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 58, col 81) to (line 59, col 78) +-------------------------------- +59 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2057 to 2138) SpanInfo: {"start":1987,"length":148} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 58, col 81) to (line 59, col 78) +-------------------------------- +60 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2139 to 2162) SpanInfo: {"start":2143,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) +-------------------------------- +61 >} + ~ => Pos: (2163 to 2163) SpanInfo: {"start":2143,"length":18} + >console.log(nameA) + >:=> (line 60, col 4) to (line 60, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..d2169558daf --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringForOfObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,662 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (50 to 67) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +6 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 104) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (105 to 106) SpanInfo: undefined +-------------------------------- +8 >interface MultiRobot { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 129) SpanInfo: undefined +-------------------------------- +9 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (130 to 147) SpanInfo: undefined +-------------------------------- +10 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: undefined +-------------------------------- +11 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (162 to 187) SpanInfo: undefined +-------------------------------- +12 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (188 to 215) SpanInfo: undefined +-------------------------------- +13 > }; + + ~~~~~~~ => Pos: (216 to 222) SpanInfo: undefined +-------------------------------- +14 >} + + ~~ => Pos: (223 to 224) SpanInfo: undefined +-------------------------------- +15 >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (225 to 324) SpanInfo: {"start":225,"length":98} + >let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 15, col 0) to (line 15, col 98) +-------------------------------- +16 >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (325 to 426) SpanInfo: {"start":325,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +17 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (427 to 506) SpanInfo: {"start":325,"length":180} + >let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 16, col 0) to (line 17, col 78) +-------------------------------- +18 >function getRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (507 to 529) SpanInfo: {"start":534,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +19 > return robots; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (530 to 548) SpanInfo: {"start":534,"length":13} + >return robots + >:=> (line 19, col 4) to (line 19, col 17) +-------------------------------- +20 >} + + ~~ => Pos: (549 to 550) SpanInfo: {"start":549,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function getMultiRobots() { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (551 to 578) SpanInfo: {"start":583,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > return multiRobots; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (579 to 602) SpanInfo: {"start":583,"length":18} + >return multiRobots + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + + ~~ => Pos: (603 to 604) SpanInfo: {"start":603,"length":1} + >} + >:=> (line 23, col 0) to (line 23, col 1) +-------------------------------- +24 >for (let {name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (605 to 638) SpanInfo: {"start":615,"length":22} + >name: nameA = "noName" + >:=> (line 24, col 10) to (line 24, col 32) +24 >for (let {name: nameA = "noName" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (639 to 652) SpanInfo: {"start":643,"length":6} + >robots + >:=> (line 24, col 38) to (line 24, col 44) +-------------------------------- +25 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (653 to 676) SpanInfo: {"start":657,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +26 >} + + ~~ => Pos: (677 to 678) SpanInfo: {"start":657,"length":18} + >console.log(nameA) + >:=> (line 25, col 4) to (line 25, col 22) +-------------------------------- +27 >for (let {name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (679 to 712) SpanInfo: {"start":689,"length":22} + >name: nameA = "noName" + >:=> (line 27, col 10) to (line 27, col 32) +27 >for (let {name: nameA = "noName" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (713 to 731) SpanInfo: {"start":717,"length":11} + >getRobots() + >:=> (line 27, col 38) to (line 27, col 49) +-------------------------------- +28 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (732 to 755) SpanInfo: {"start":736,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +29 >} + + ~~ => Pos: (756 to 757) SpanInfo: {"start":736,"length":18} + >console.log(nameA) + >:=> (line 28, col 4) to (line 28, col 22) +-------------------------------- +30 >for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (758 to 791) SpanInfo: {"start":768,"length":22} + >name: nameA = "noName" + >:=> (line 30, col 10) to (line 30, col 32) +30 >for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (792 to 875) SpanInfo: {"start":796,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 30, col 38) to (line 30, col 114) +-------------------------------- +31 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (876 to 899) SpanInfo: {"start":880,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +32 >} + + ~~ => Pos: (900 to 901) SpanInfo: {"start":880,"length":18} + >console.log(nameA) + >:=> (line 31, col 4) to (line 31, col 22) +-------------------------------- +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (902 to 919) SpanInfo: {"start":913,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 33, col 11) to (line 34, col 48) +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (920 to 952) SpanInfo: {"start":923,"length":29} + >primary: primaryA = "primary" + >:=> (line 33, col 21) to (line 33, col 50) +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (953 to 990) SpanInfo: {"start":954,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 33, col 52) to (line 33, col 87) +33 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~=> Pos: (991 to 993) SpanInfo: {"start":913,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 33, col 11) to (line 34, col 48) +-------------------------------- +34 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (994 to 1043) SpanInfo: {"start":913,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 33, col 11) to (line 34, col 48) +34 > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1044 to 1062) SpanInfo: {"start":1048,"length":11} + >multiRobots + >:=> (line 34, col 54) to (line 34, col 65) +-------------------------------- +35 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1063 to 1089) SpanInfo: {"start":1067,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +36 >} + + ~~ => Pos: (1090 to 1091) SpanInfo: {"start":1067,"length":21} + >console.log(primaryA) + >:=> (line 35, col 4) to (line 35, col 25) +-------------------------------- +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (1092 to 1109) SpanInfo: {"start":1103,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 37, col 11) to (line 38, col 48) +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1110 to 1142) SpanInfo: {"start":1113,"length":29} + >primary: primaryA = "primary" + >:=> (line 37, col 21) to (line 37, col 50) +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1143 to 1180) SpanInfo: {"start":1144,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 37, col 52) to (line 37, col 87) +37 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~=> Pos: (1181 to 1183) SpanInfo: {"start":1103,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 37, col 11) to (line 38, col 48) +-------------------------------- +38 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1184 to 1233) SpanInfo: {"start":1103,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 37, col 11) to (line 38, col 48) +38 > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1234 to 1257) SpanInfo: {"start":1238,"length":16} + >getMultiRobots() + >:=> (line 38, col 54) to (line 38, col 70) +-------------------------------- +39 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1258 to 1284) SpanInfo: {"start":1262,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +40 >} + + ~~ => Pos: (1285 to 1286) SpanInfo: {"start":1262,"length":21} + >console.log(primaryA) + >:=> (line 39, col 4) to (line 39, col 25) +-------------------------------- +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~ => Pos: (1287 to 1304) SpanInfo: {"start":1298,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 41, col 11) to (line 42, col 48) +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1305 to 1337) SpanInfo: {"start":1308,"length":29} + >primary: primaryA = "primary" + >:=> (line 41, col 21) to (line 41, col 50) +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1338 to 1375) SpanInfo: {"start":1339,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 41, col 52) to (line 41, col 87) +41 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + + ~~~=> Pos: (1376 to 1378) SpanInfo: {"start":1298,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 41, col 11) to (line 42, col 48) +-------------------------------- +42 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1379 to 1428) SpanInfo: {"start":1298,"length":129} + >skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } + >:=> (line 41, col 11) to (line 42, col 48) +42 > { primary: "nosKill", secondary: "noSkill" } } of + + ~~~~=> Pos: (1429 to 1432) SpanInfo: {"start":1437,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 43, col 4) to (line 44, col 78) +-------------------------------- +43 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1433 to 1520) SpanInfo: {"start":1437,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 43, col 4) to (line 44, col 78) +-------------------------------- +44 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1521 to 1602) SpanInfo: {"start":1437,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 43, col 4) to (line 44, col 78) +-------------------------------- +45 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1603 to 1629) SpanInfo: {"start":1607,"length":21} + >console.log(primaryA) + >:=> (line 45, col 4) to (line 45, col 25) +-------------------------------- +46 >} + + ~~ => Pos: (1630 to 1631) SpanInfo: {"start":1607,"length":21} + >console.log(primaryA) + >:=> (line 45, col 4) to (line 45, col 25) +-------------------------------- +47 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1632 to 1664) SpanInfo: {"start":1642,"length":22} + >name: nameA = "noName" + >:=> (line 47, col 10) to (line 47, col 32) +47 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1665 to 1692) SpanInfo: {"start":1666,"length":25} + >skill: skillA = "noSkill" + >:=> (line 47, col 34) to (line 47, col 59) +47 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + + ~~~~~~~~~~~~~~=> Pos: (1693 to 1706) SpanInfo: {"start":1697,"length":6} + >robots + >:=> (line 47, col 65) to (line 47, col 71) +-------------------------------- +48 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1707 to 1730) SpanInfo: {"start":1711,"length":18} + >console.log(nameA) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +49 >} + + ~~ => Pos: (1731 to 1732) SpanInfo: {"start":1711,"length":18} + >console.log(nameA) + >:=> (line 48, col 4) to (line 48, col 22) +-------------------------------- +50 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1733 to 1765) SpanInfo: {"start":1743,"length":22} + >name: nameA = "noName" + >:=> (line 50, col 10) to (line 50, col 32) +50 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1766 to 1794) SpanInfo: {"start":1767,"length":25} + >skill: skillA = "noSkill" + >:=> (line 50, col 34) to (line 50, col 59) +50 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + + ~~~~~~~~~~~~~~~~~~~=> Pos: (1795 to 1813) SpanInfo: {"start":1799,"length":11} + >getRobots() + >:=> (line 50, col 66) to (line 50, col 77) +-------------------------------- +51 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1814 to 1837) SpanInfo: {"start":1818,"length":18} + >console.log(nameA) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +52 >} + + ~~ => Pos: (1838 to 1839) SpanInfo: {"start":1818,"length":18} + >console.log(nameA) + >:=> (line 51, col 4) to (line 51, col 22) +-------------------------------- +53 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1840 to 1872) SpanInfo: {"start":1850,"length":22} + >name: nameA = "noName" + >:=> (line 53, col 10) to (line 53, col 32) +53 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1873 to 1901) SpanInfo: {"start":1874,"length":25} + >skill: skillA = "noSkill" + >:=> (line 53, col 34) to (line 53, col 59) +53 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1902 to 1985) SpanInfo: {"start":1906,"length":76} + >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] + >:=> (line 53, col 66) to (line 53, col 142) +-------------------------------- +54 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1986 to 2009) SpanInfo: {"start":1990,"length":18} + >console.log(nameA) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +55 >} + + ~~ => Pos: (2010 to 2011) SpanInfo: {"start":1990,"length":18} + >console.log(nameA) + >:=> (line 54, col 4) to (line 54, col 22) +-------------------------------- +56 >for (let { + + ~~~~~~~~~~~ => Pos: (2012 to 2022) SpanInfo: {"start":2027,"length":22} + >name: nameA = "noName" + >:=> (line 57, col 4) to (line 57, col 26) +-------------------------------- +57 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2023 to 2050) SpanInfo: {"start":2027,"length":22} + >name: nameA = "noName" + >:=> (line 57, col 4) to (line 57, col 26) +-------------------------------- +58 > skills: { + + ~~~~~~~~~~~ => Pos: (2051 to 2061) SpanInfo: {"start":2055,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 58, col 4) to (line 61, col 52) +58 > skills: { + + ~~~ => Pos: (2062 to 2064) SpanInfo: {"start":2073,"length":29} + >primary: primaryA = "primary" + >:=> (line 59, col 8) to (line 59, col 37) +-------------------------------- +59 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2065 to 2103) SpanInfo: {"start":2073,"length":29} + >primary: primaryA = "primary" + >:=> (line 59, col 8) to (line 59, col 37) +-------------------------------- +60 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2104 to 2147) SpanInfo: {"start":2112,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 60, col 8) to (line 60, col 43) +-------------------------------- +61 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (2148 to 2152) SpanInfo: {"start":2112,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 60, col 8) to (line 60, col 43) +61 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2153 to 2200) SpanInfo: {"start":2055,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 58, col 4) to (line 61, col 52) +-------------------------------- +62 >} of multiRobots) { + + ~ => Pos: (2201 to 2201) SpanInfo: {"start":2055,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 58, col 4) to (line 61, col 52) +62 >} of multiRobots) { + + ~~~~~~~~~~~~~~~~~~~ => Pos: (2202 to 2220) SpanInfo: {"start":2206,"length":11} + >multiRobots + >:=> (line 62, col 5) to (line 62, col 16) +-------------------------------- +63 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2221 to 2244) SpanInfo: {"start":2225,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +64 >} + + ~~ => Pos: (2245 to 2246) SpanInfo: {"start":2225,"length":18} + >console.log(nameA) + >:=> (line 63, col 4) to (line 63, col 22) +-------------------------------- +65 >for (let { + + ~~~~~~~~~~~ => Pos: (2247 to 2257) SpanInfo: {"start":2262,"length":22} + >name: nameA = "noName" + >:=> (line 66, col 4) to (line 66, col 26) +-------------------------------- +66 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2258 to 2285) SpanInfo: {"start":2262,"length":22} + >name: nameA = "noName" + >:=> (line 66, col 4) to (line 66, col 26) +-------------------------------- +67 > skills: { + + ~~~~~~~~~~~ => Pos: (2286 to 2296) SpanInfo: {"start":2290,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +67 > skills: { + + ~~~ => Pos: (2297 to 2299) SpanInfo: {"start":2308,"length":29} + >primary: primaryA = "primary" + >:=> (line 68, col 8) to (line 68, col 37) +-------------------------------- +68 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2300 to 2338) SpanInfo: {"start":2308,"length":29} + >primary: primaryA = "primary" + >:=> (line 68, col 8) to (line 68, col 37) +-------------------------------- +69 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2339 to 2382) SpanInfo: {"start":2347,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 69, col 8) to (line 69, col 43) +-------------------------------- +70 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (2383 to 2387) SpanInfo: {"start":2347,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 69, col 8) to (line 69, col 43) +70 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2388 to 2435) SpanInfo: {"start":2290,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +-------------------------------- +71 >} of getMultiRobots()) { + + ~ => Pos: (2436 to 2436) SpanInfo: {"start":2290,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 67, col 4) to (line 70, col 52) +71 >} of getMultiRobots()) { + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2437 to 2460) SpanInfo: {"start":2441,"length":16} + >getMultiRobots() + >:=> (line 71, col 5) to (line 71, col 21) +-------------------------------- +72 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2461 to 2484) SpanInfo: {"start":2465,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +73 >} + + ~~ => Pos: (2485 to 2486) SpanInfo: {"start":2465,"length":18} + >console.log(nameA) + >:=> (line 72, col 4) to (line 72, col 22) +-------------------------------- +74 >for (let { + + ~~~~~~~~~~~ => Pos: (2487 to 2497) SpanInfo: {"start":2502,"length":22} + >name: nameA = "noName" + >:=> (line 75, col 4) to (line 75, col 26) +-------------------------------- +75 > name: nameA = "noName", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2498 to 2525) SpanInfo: {"start":2502,"length":22} + >name: nameA = "noName" + >:=> (line 75, col 4) to (line 75, col 26) +-------------------------------- +76 > skills: { + + ~~~~~~~~~~~ => Pos: (2526 to 2536) SpanInfo: {"start":2530,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 76, col 4) to (line 79, col 52) +76 > skills: { + + ~~~ => Pos: (2537 to 2539) SpanInfo: {"start":2548,"length":29} + >primary: primaryA = "primary" + >:=> (line 77, col 8) to (line 77, col 37) +-------------------------------- +77 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2540 to 2578) SpanInfo: {"start":2548,"length":29} + >primary: primaryA = "primary" + >:=> (line 77, col 8) to (line 77, col 37) +-------------------------------- +78 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2579 to 2622) SpanInfo: {"start":2587,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 78, col 8) to (line 78, col 43) +-------------------------------- +79 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (2623 to 2627) SpanInfo: {"start":2587,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 78, col 8) to (line 78, col 43) +79 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2628 to 2675) SpanInfo: {"start":2530,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 76, col 4) to (line 79, col 52) +-------------------------------- +80 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~ => Pos: (2676 to 2676) SpanInfo: {"start":2530,"length":145} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 76, col 4) to (line 79, col 52) +80 >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2677 to 2764) SpanInfo: {"start":2681,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 80, col 5) to (line 81, col 78) +-------------------------------- +81 > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (2765 to 2846) SpanInfo: {"start":2681,"length":162} + >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] + >:=> (line 80, col 5) to (line 81, col 78) +-------------------------------- +82 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (2847 to 2870) SpanInfo: {"start":2851,"length":18} + >console.log(nameA) + >:=> (line 82, col 4) to (line 82, col 22) +-------------------------------- +83 >} + ~ => Pos: (2871 to 2871) SpanInfo: {"start":2851,"length":18} + >console.log(nameA) + >:=> (line 82, col 4) to (line 82, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline new file mode 100644 index 00000000000..03f0ee87356 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline @@ -0,0 +1,196 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 132) SpanInfo: {"start":89,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >function foo1([, nameA]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (133 to 146) SpanInfo: {"start":171,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +6 >function foo1([, nameA]: Robot) { + + ~~~~~~~~~~~~~~~~~ => Pos: (147 to 163) SpanInfo: {"start":150,"length":5} + >nameA + >:=> (line 6, col 17) to (line 6, col 22) +6 >function foo1([, nameA]: Robot) { + + ~~~ => Pos: (164 to 166) SpanInfo: {"start":171,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +7 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (167 to 190) SpanInfo: {"start":171,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +8 >} + + ~~ => Pos: (191 to 192) SpanInfo: {"start":191,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([numberB]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (193 to 206) SpanInfo: {"start":231,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +9 >function foo2([numberB]: Robot) { + + ~~~~~~~~~~~~~~~~~ => Pos: (207 to 223) SpanInfo: {"start":208,"length":7} + >numberB + >:=> (line 9, col 15) to (line 9, col 22) +9 >function foo2([numberB]: Robot) { + + ~~~ => Pos: (224 to 226) SpanInfo: {"start":231,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +10 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (227 to 252) SpanInfo: {"start":231,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +11 >} + + ~~ => Pos: (253 to 254) SpanInfo: {"start":253,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (255 to 268) SpanInfo: {"start":311,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~~~ => Pos: (269 to 278) SpanInfo: {"start":270,"length":8} + >numberA2 + >:=> (line 12, col 15) to (line 12, col 23) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~ => Pos: (279 to 286) SpanInfo: {"start":280,"length":6} + >nameA2 + >:=> (line 12, col 25) to (line 12, col 31) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~~~~~~~~~~~~~~~=> Pos: (287 to 303) SpanInfo: {"start":288,"length":7} + >skillA2 + >:=> (line 12, col 33) to (line 12, col 40) +12 >function foo3([numberA2, nameA2, skillA2]: Robot) { + + ~~~=> Pos: (304 to 306) SpanInfo: {"start":311,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +13 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (307 to 331) SpanInfo: {"start":311,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +14 >} + + ~~ => Pos: (332 to 333) SpanInfo: {"start":332,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (334 to 347) SpanInfo: {"start":388,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~~~~~~~~ => Pos: (348 to 357) SpanInfo: {"start":349,"length":8} + >numberA3 + >:=> (line 15, col 15) to (line 15, col 23) +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (358 to 380) SpanInfo: {"start":359,"length":13} + >...robotAInfo + >:=> (line 15, col 25) to (line 15, col 38) +15 >function foo4([numberA3, ...robotAInfo]: Robot) { + + ~~~=> Pos: (381 to 383) SpanInfo: {"start":388,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +16 > console.log(robotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (384 to 412) SpanInfo: {"start":388,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +17 >} + + ~~ => Pos: (413 to 414) SpanInfo: {"start":413,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (415 to 428) SpanInfo: {"start":415,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (429 to 462) SpanInfo: {"start":429,"length":32} + >foo1([2, "trimmer", "trimming"]) + >:=> (line 19, col 0) to (line 19, col 32) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (463 to 476) SpanInfo: {"start":463,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (477 to 510) SpanInfo: {"start":477,"length":32} + >foo2([2, "trimmer", "trimming"]) + >:=> (line 21, col 0) to (line 21, col 32) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (511 to 524) SpanInfo: {"start":511,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 558) SpanInfo: {"start":525,"length":32} + >foo3([2, "trimmer", "trimming"]) + >:=> (line 23, col 0) to (line 23, col 32) +-------------------------------- +24 >foo4(robotA); + + ~~~~~~~~~~~~~~ => Pos: (559 to 572) SpanInfo: {"start":559,"length":12} + >foo4(robotA) + >:=> (line 24, col 0) to (line 24, col 12) +-------------------------------- +25 >foo4([2, "trimmer", "trimming"]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (573 to 605) SpanInfo: {"start":573,"length":32} + >foo4([2, "trimmer", "trimming"]) + >:=> (line 25, col 0) to (line 25, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline new file mode 100644 index 00000000000..cb9088c99ef --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline @@ -0,0 +1,196 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 90) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (91 to 147) SpanInfo: {"start":91,"length":55} + >var robotA: Robot = ["trimmer", ["trimming", "edging"]] + >:=> (line 5, col 0) to (line 5, col 55) +-------------------------------- +6 >function foo1([, skillA]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (148 to 161) SpanInfo: {"start":187,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +6 >function foo1([, skillA]: Robot) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (162 to 179) SpanInfo: {"start":165,"length":6} + >skillA + >:=> (line 6, col 17) to (line 6, col 23) +6 >function foo1([, skillA]: Robot) { + + ~~~ => Pos: (180 to 182) SpanInfo: {"start":187,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +7 > console.log(skillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (183 to 207) SpanInfo: {"start":187,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +8 >} + + ~~ => Pos: (208 to 209) SpanInfo: {"start":208,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([nameMB]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (210 to 223) SpanInfo: {"start":247,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +9 >function foo2([nameMB]: Robot) { + + ~~~~~~~~~~~~~~~~ => Pos: (224 to 239) SpanInfo: {"start":225,"length":6} + >nameMB + >:=> (line 9, col 15) to (line 9, col 21) +9 >function foo2([nameMB]: Robot) { + + ~~~ => Pos: (240 to 242) SpanInfo: {"start":247,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +10 > console.log(nameMB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (243 to 267) SpanInfo: {"start":247,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +11 >} + + ~~ => Pos: (268 to 269) SpanInfo: {"start":268,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (270 to 283) SpanInfo: {"start":341,"length":19} + >console.log(nameMA) + >:=> (line 13, col 4) to (line 13, col 23) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~ => Pos: (284 to 291) SpanInfo: {"start":285,"length":6} + >nameMA + >:=> (line 12, col 15) to (line 12, col 21) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~~~~~~~~ => Pos: (292 to 307) SpanInfo: {"start":294,"length":13} + >primarySkillA + >:=> (line 12, col 24) to (line 12, col 37) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~~~~~~~~~=> Pos: (308 to 324) SpanInfo: {"start":309,"length":15} + >secondarySkillA + >:=> (line 12, col 39) to (line 12, col 54) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~~~~~~~=> Pos: (325 to 333) SpanInfo: {"start":293,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 12, col 23) to (line 12, col 55) +12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + + ~~~=> Pos: (334 to 336) SpanInfo: {"start":341,"length":19} + >console.log(nameMA) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +13 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (337 to 361) SpanInfo: {"start":341,"length":19} + >console.log(nameMA) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +14 >} + + ~~ => Pos: (362 to 363) SpanInfo: {"start":362,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo4([...multiRobotAInfo]: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (364 to 377) SpanInfo: {"start":413,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 16, col 4) to (line 16, col 32) +15 >function foo4([...multiRobotAInfo]: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 405) SpanInfo: {"start":379,"length":18} + >...multiRobotAInfo + >:=> (line 15, col 15) to (line 15, col 33) +15 >function foo4([...multiRobotAInfo]: Robot) { + + ~~~ => Pos: (406 to 408) SpanInfo: {"start":413,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 16, col 4) to (line 16, col 32) +-------------------------------- +16 > console.log(multiRobotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (409 to 442) SpanInfo: {"start":413,"length":28} + >console.log(multiRobotAInfo) + >:=> (line 16, col 4) to (line 16, col 32) +-------------------------------- +17 >} + + ~~ => Pos: (443 to 444) SpanInfo: {"start":443,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (445 to 458) SpanInfo: {"start":445,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (459 to 499) SpanInfo: {"start":459,"length":39} + >foo1(["roomba", ["vaccum", "mopping"]]) + >:=> (line 19, col 0) to (line 19, col 39) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (500 to 513) SpanInfo: {"start":500,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (514 to 554) SpanInfo: {"start":514,"length":39} + >foo2(["roomba", ["vaccum", "mopping"]]) + >:=> (line 21, col 0) to (line 21, col 39) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (555 to 568) SpanInfo: {"start":555,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (569 to 609) SpanInfo: {"start":569,"length":39} + >foo3(["roomba", ["vaccum", "mopping"]]) + >:=> (line 23, col 0) to (line 23, col 39) +-------------------------------- +24 >foo4(robotA); + + ~~~~~~~~~~~~~~ => Pos: (610 to 623) SpanInfo: {"start":610,"length":12} + >foo4(robotA) + >:=> (line 24, col 0) to (line 24, col 12) +-------------------------------- +25 >foo4(["roomba", ["vaccum", "mopping"]]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (624 to 663) SpanInfo: {"start":624,"length":39} + >foo4(["roomba", ["vaccum", "mopping"]]) + >:=> (line 25, col 0) to (line 25, col 39) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..d071692b0f2 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,196 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 88) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (89 to 132) SpanInfo: {"start":89,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (133 to 146) SpanInfo: {"start":206,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (147 to 198) SpanInfo: {"start":150,"length":16} + >nameA = "noName" + >:=> (line 6, col 17) to (line 6, col 33) +6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (199 to 201) SpanInfo: {"start":206,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +7 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (202 to 225) SpanInfo: {"start":206,"length":18} + >console.log(nameA) + >:=> (line 7, col 4) to (line 7, col 22) +-------------------------------- +8 >} + + ~~ => Pos: (226 to 227) SpanInfo: {"start":226,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (228 to 241) SpanInfo: {"start":295,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (242 to 287) SpanInfo: {"start":243,"length":12} + >numberB = -1 + >:=> (line 9, col 15) to (line 9, col 27) +9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (288 to 290) SpanInfo: {"start":295,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +10 > console.log(numberB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (291 to 316) SpanInfo: {"start":295,"length":20} + >console.log(numberB) + >:=> (line 10, col 4) to (line 10, col 24) +-------------------------------- +11 >} + + ~~ => Pos: (317 to 318) SpanInfo: {"start":317,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (319 to 332) SpanInfo: {"start":423,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~ => Pos: (333 to 347) SpanInfo: {"start":334,"length":13} + >numberA2 = -1 + >:=> (line 12, col 15) to (line 12, col 28) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~=> Pos: (348 to 364) SpanInfo: {"start":349,"length":15} + >nameA2 = "name" + >:=> (line 12, col 30) to (line 12, col 45) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (365 to 415) SpanInfo: {"start":366,"length":17} + >skillA2 = "skill" + >:=> (line 12, col 47) to (line 12, col 64) +12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (416 to 418) SpanInfo: {"start":423,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +13 > console.log(nameA2); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (419 to 443) SpanInfo: {"start":423,"length":19} + >console.log(nameA2) + >:=> (line 13, col 4) to (line 13, col 23) +-------------------------------- +14 >} + + ~~ => Pos: (444 to 445) SpanInfo: {"start":444,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~ => Pos: (446 to 459) SpanInfo: {"start":529,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~ => Pos: (460 to 474) SpanInfo: {"start":461,"length":13} + >numberA3 = -1 + >:=> (line 15, col 15) to (line 15, col 28) +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (475 to 521) SpanInfo: {"start":476,"length":13} + >...robotAInfo + >:=> (line 15, col 30) to (line 15, col 43) +15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + + ~~~=> Pos: (522 to 524) SpanInfo: {"start":529,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +16 > console.log(robotAInfo); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 553) SpanInfo: {"start":529,"length":23} + >console.log(robotAInfo) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +17 >} + + ~~ => Pos: (554 to 555) SpanInfo: {"start":554,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (556 to 569) SpanInfo: {"start":556,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (570 to 603) SpanInfo: {"start":570,"length":32} + >foo1([2, "trimmer", "trimming"]) + >:=> (line 19, col 0) to (line 19, col 32) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (604 to 617) SpanInfo: {"start":604,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (618 to 651) SpanInfo: {"start":618,"length":32} + >foo2([2, "trimmer", "trimming"]) + >:=> (line 21, col 0) to (line 21, col 32) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (652 to 665) SpanInfo: {"start":652,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3([2, "trimmer", "trimming"]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (666 to 699) SpanInfo: {"start":666,"length":32} + >foo3([2, "trimmer", "trimming"]) + >:=> (line 23, col 0) to (line 23, col 32) +-------------------------------- +24 >foo4(robotA); + + ~~~~~~~~~~~~~~ => Pos: (700 to 713) SpanInfo: {"start":700,"length":12} + >foo4(robotA) + >:=> (line 24, col 0) to (line 24, col 12) +-------------------------------- +25 >foo4([2, "trimmer", "trimming"]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (714 to 746) SpanInfo: {"start":714,"length":32} + >foo4([2, "trimmer", "trimming"]) + >:=> (line 25, col 0) to (line 25, col 32) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline new file mode 100644 index 00000000000..34b41cc1218 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline @@ -0,0 +1,172 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: any): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 47) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (48 to 49) SpanInfo: undefined +-------------------------------- +4 >type Robot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 82) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (83 to 139) SpanInfo: {"start":83,"length":55} + >var robotA: Robot = ["trimmer", ["trimming", "edging"]] + >:=> (line 5, col 0) to (line 5, col 55) +-------------------------------- +6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~ => Pos: (140 to 153) SpanInfo: {"start":236,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (154 to 228) SpanInfo: {"start":157,"length":31} + >skillA = ["noSkill", "noSkill"] + >:=> (line 6, col 17) to (line 6, col 48) +6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + + ~~~=> Pos: (229 to 231) SpanInfo: {"start":236,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +7 > console.log(skillA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (232 to 256) SpanInfo: {"start":236,"length":19} + >console.log(skillA) + >:=> (line 7, col 4) to (line 7, col 23) +-------------------------------- +8 >} + + ~~ => Pos: (257 to 258) SpanInfo: {"start":257,"length":1} + >} + >:=> (line 8, col 0) to (line 8, col 1) +-------------------------------- +9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~ => Pos: (259 to 272) SpanInfo: {"start":340,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (273 to 332) SpanInfo: {"start":274,"length":17} + >nameMB = "noName" + >:=> (line 9, col 15) to (line 9, col 32) +9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + + ~~~=> Pos: (333 to 335) SpanInfo: {"start":340,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +10 > console.log(nameMB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (336 to 360) SpanInfo: {"start":340,"length":19} + >console.log(nameMB) + >:=> (line 10, col 4) to (line 10, col 23) +-------------------------------- +11 >} + + ~~ => Pos: (361 to 362) SpanInfo: {"start":361,"length":1} + >} + >:=> (line 11, col 0) to (line 11, col 1) +-------------------------------- +12 >function foo3([nameMA = "noName", [ + + ~~~~~~~~~~~~~~ => Pos: (363 to 376) SpanInfo: {"start":506,"length":19} + >console.log(nameMA) + >:=> (line 16, col 4) to (line 16, col 23) +12 >function foo3([nameMA = "noName", [ + + ~~~~~~~~~~~~~~~~~~~ => Pos: (377 to 395) SpanInfo: {"start":378,"length":17} + >nameMA = "noName" + >:=> (line 12, col 15) to (line 12, col 32) +12 >function foo3([nameMA = "noName", [ + + ~~~ => Pos: (396 to 398) SpanInfo: {"start":403,"length":25} + >primarySkillA = "primary" + >:=> (line 13, col 4) to (line 13, col 29) +-------------------------------- +13 > primarySkillA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (399 to 429) SpanInfo: {"start":403,"length":25} + >primarySkillA = "primary" + >:=> (line 13, col 4) to (line 13, col 29) +-------------------------------- +14 > secondarySkillA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (430 to 463) SpanInfo: {"start":434,"length":29} + >secondarySkillA = "secondary" + >:=> (line 14, col 4) to (line 14, col 33) +-------------------------------- +15 >] = ["noSkill", "noSkill"]]: Robot) { + + ~ => Pos: (464 to 464) SpanInfo: {"start":434,"length":29} + >secondarySkillA = "secondary" + >:=> (line 14, col 4) to (line 14, col 33) +15 >] = ["noSkill", "noSkill"]]: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (465 to 498) SpanInfo: {"start":397,"length":93} + >[ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["noSkill", "noSkill"] + >:=> (line 12, col 34) to (line 15, col 26) +15 >] = ["noSkill", "noSkill"]]: Robot) { + + ~~~ => Pos: (499 to 501) SpanInfo: {"start":506,"length":19} + >console.log(nameMA) + >:=> (line 16, col 4) to (line 16, col 23) +-------------------------------- +16 > console.log(nameMA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (502 to 526) SpanInfo: {"start":506,"length":19} + >console.log(nameMA) + >:=> (line 16, col 4) to (line 16, col 23) +-------------------------------- +17 >} + + ~~ => Pos: (527 to 528) SpanInfo: {"start":527,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (529 to 542) SpanInfo: {"start":529,"length":12} + >foo1(robotA) + >:=> (line 18, col 0) to (line 18, col 12) +-------------------------------- +19 >foo1(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (543 to 583) SpanInfo: {"start":543,"length":39} + >foo1(["roomba", ["vaccum", "mopping"]]) + >:=> (line 19, col 0) to (line 19, col 39) +-------------------------------- +20 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (584 to 597) SpanInfo: {"start":584,"length":12} + >foo2(robotA) + >:=> (line 20, col 0) to (line 20, col 12) +-------------------------------- +21 >foo2(["roomba", ["vaccum", "mopping"]]); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (598 to 638) SpanInfo: {"start":598,"length":39} + >foo2(["roomba", ["vaccum", "mopping"]]) + >:=> (line 21, col 0) to (line 21, col 39) +-------------------------------- +22 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (639 to 652) SpanInfo: {"start":639,"length":12} + >foo3(robotA) + >:=> (line 22, col 0) to (line 22, col 12) +-------------------------------- +23 >foo3(["roomba", ["vaccum", "mopping"]]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (653 to 692) SpanInfo: {"start":653,"length":39} + >foo3(["roomba", ["vaccum", "mopping"]]) + >:=> (line 23, col 0) to (line 23, col 39) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline new file mode 100644 index 00000000000..be773df4530 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline @@ -0,0 +1,200 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 127) SpanInfo: undefined +-------------------------------- +8 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (128 to 154) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (155 to 161) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (162 to 163) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (164 to 252) SpanInfo: {"start":164,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (253 to 266) SpanInfo: {"start":338,"length":21} + >console.log(primaryA) + >:=> (line 13, col 4) to (line 13, col 25) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~ => Pos: (267 to 275) SpanInfo: {"start":269,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 12, col 16) to (line 12, col 68) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (276 to 296) SpanInfo: {"start":279,"length":17} + >primary: primaryA + >:=> (line 12, col 26) to (line 12, col 43) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (297 to 320) SpanInfo: {"start":298,"length":21} + >secondary: secondaryA + >:=> (line 12, col 45) to (line 12, col 66) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~~~~~~~~=> Pos: (321 to 330) SpanInfo: {"start":269,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 12, col 16) to (line 12, col 68) +12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + + ~~~=> Pos: (331 to 333) SpanInfo: {"start":338,"length":21} + >console.log(primaryA) + >:=> (line 13, col 4) to (line 13, col 25) +-------------------------------- +13 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (334 to 360) SpanInfo: {"start":338,"length":21} + >console.log(primaryA) + >:=> (line 13, col 4) to (line 13, col 25) +-------------------------------- +14 >} + + ~~ => Pos: (361 to 362) SpanInfo: {"start":361,"length":1} + >} + >:=> (line 14, col 0) to (line 14, col 1) +-------------------------------- +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (363 to 376) SpanInfo: {"start":461,"length":23} + >console.log(secondaryB) + >:=> (line 16, col 4) to (line 16, col 27) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (377 to 390) SpanInfo: {"start":379,"length":11} + >name: nameC + >:=> (line 15, col 16) to (line 15, col 27) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~ => Pos: (391 to 398) SpanInfo: {"start":392,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 29) to (line 15, col 81) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (399 to 419) SpanInfo: {"start":402,"length":17} + >primary: primaryB + >:=> (line 15, col 39) to (line 15, col 56) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (420 to 443) SpanInfo: {"start":421,"length":21} + >secondary: secondaryB + >:=> (line 15, col 58) to (line 15, col 79) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~~~~~~~~=> Pos: (444 to 453) SpanInfo: {"start":392,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 29) to (line 15, col 81) +15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + + ~~~=> Pos: (454 to 456) SpanInfo: {"start":461,"length":23} + >console.log(secondaryB) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +16 > console.log(secondaryB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (457 to 485) SpanInfo: {"start":461,"length":23} + >console.log(secondaryB) + >:=> (line 16, col 4) to (line 16, col 27) +-------------------------------- +17 >} + + ~~ => Pos: (486 to 487) SpanInfo: {"start":486,"length":1} + >} + >:=> (line 17, col 0) to (line 17, col 1) +-------------------------------- +18 >function foo3({ skills }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (488 to 501) SpanInfo: {"start":527,"length":27} + >console.log(skills.primary) + >:=> (line 19, col 4) to (line 19, col 31) +18 >function foo3({ skills }: Robot) { + + ~~~~~~~~~~~~~~~~~~ => Pos: (502 to 519) SpanInfo: {"start":504,"length":6} + >skills + >:=> (line 18, col 16) to (line 18, col 22) +18 >function foo3({ skills }: Robot) { + + ~~~ => Pos: (520 to 522) SpanInfo: {"start":527,"length":27} + >console.log(skills.primary) + >:=> (line 19, col 4) to (line 19, col 31) +-------------------------------- +19 > console.log(skills.primary); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (523 to 555) SpanInfo: {"start":527,"length":27} + >console.log(skills.primary) + >:=> (line 19, col 4) to (line 19, col 31) +-------------------------------- +20 >} + + ~~ => Pos: (556 to 557) SpanInfo: {"start":556,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (558 to 571) SpanInfo: {"start":558,"length":12} + >foo1(robotA) + >:=> (line 21, col 0) to (line 21, col 12) +-------------------------------- +22 >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (572 to 657) SpanInfo: {"start":572,"length":84} + >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 22, col 0) to (line 22, col 84) +-------------------------------- +23 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (658 to 671) SpanInfo: {"start":658,"length":12} + >foo2(robotA) + >:=> (line 23, col 0) to (line 23, col 12) +-------------------------------- +24 >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (672 to 757) SpanInfo: {"start":672,"length":84} + >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 24, col 0) to (line 24, col 84) +-------------------------------- +25 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (758 to 771) SpanInfo: {"start":758,"length":12} + >foo3(robotA) + >:=> (line 25, col 0) to (line 25, col 12) +-------------------------------- +26 >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (772 to 856) SpanInfo: {"start":772,"length":84} + >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 26, col 0) to (line 26, col 84) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..c06c9b56fe5 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,274 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 128) SpanInfo: undefined +-------------------------------- +8 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (129 to 156) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (157 to 163) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (164 to 165) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (166 to 254) SpanInfo: {"start":166,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >function foo1( + + ~~~~~~~~~~~~~~~ => Pos: (255 to 269) SpanInfo: {"start":475,"length":21} + >console.log(primaryA) + >:=> (line 19, col 4) to (line 19, col 25) +-------------------------------- +13 > { + + ~~~~~~ => Pos: (270 to 275) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +-------------------------------- +14 > skills: { + + ~~~~~~~~~~~~~~~ => Pos: (276 to 290) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +14 > skills: { + + ~~~ => Pos: (291 to 293) SpanInfo: {"start":306,"length":29} + >primary: primaryA = "primary" + >:=> (line 15, col 12) to (line 15, col 41) +-------------------------------- +15 > primary: primaryA = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (294 to 336) SpanInfo: {"start":306,"length":29} + >primary: primaryA = "primary" + >:=> (line 15, col 12) to (line 15, col 41) +-------------------------------- +16 > secondary: secondaryA = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (337 to 384) SpanInfo: {"start":349,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 16, col 12) to (line 16, col 47) +-------------------------------- +17 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~ => Pos: (385 to 393) SpanInfo: {"start":349,"length":35} + >secondary: secondaryA = "secondary" + >:=> (line 16, col 12) to (line 16, col 47) +17 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (394 to 445) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +-------------------------------- +18 > }: Robot = robotA) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (446 to 467) SpanInfo: {"start":284,"length":161} + >skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 14, col 8) to (line 17, col 60) +18 > }: Robot = robotA) { + + ~~~ => Pos: (468 to 470) SpanInfo: {"start":475,"length":21} + >console.log(primaryA) + >:=> (line 19, col 4) to (line 19, col 25) +-------------------------------- +19 > console.log(primaryA); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (471 to 497) SpanInfo: {"start":475,"length":21} + >console.log(primaryA) + >:=> (line 19, col 4) to (line 19, col 25) +-------------------------------- +20 >} + + ~~ => Pos: (498 to 499) SpanInfo: {"start":498,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) +-------------------------------- +21 >function foo2( + + ~~~~~~~~~~~~~~~ => Pos: (500 to 514) SpanInfo: {"start":750,"length":23} + >console.log(secondaryB) + >:=> (line 29, col 4) to (line 29, col 27) +-------------------------------- +22 > { + + ~~~~~~ => Pos: (515 to 520) SpanInfo: {"start":529,"length":20} + >name: nameC = "name" + >:=> (line 23, col 8) to (line 23, col 28) +-------------------------------- +23 > name: nameC = "name", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (521 to 550) SpanInfo: {"start":529,"length":20} + >name: nameC = "name" + >:=> (line 23, col 8) to (line 23, col 28) +-------------------------------- +24 > skills: { + + ~~~~~~~~~~~~~~~ => Pos: (551 to 565) SpanInfo: {"start":559,"length":161} + >skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 24, col 8) to (line 27, col 60) +24 > skills: { + + ~~~ => Pos: (566 to 568) SpanInfo: {"start":581,"length":29} + >primary: primaryB = "primary" + >:=> (line 25, col 12) to (line 25, col 41) +-------------------------------- +25 > primary: primaryB = "primary", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (569 to 611) SpanInfo: {"start":581,"length":29} + >primary: primaryB = "primary" + >:=> (line 25, col 12) to (line 25, col 41) +-------------------------------- +26 > secondary: secondaryB = "secondary" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (612 to 659) SpanInfo: {"start":624,"length":35} + >secondary: secondaryB = "secondary" + >:=> (line 26, col 12) to (line 26, col 47) +-------------------------------- +27 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~ => Pos: (660 to 668) SpanInfo: {"start":624,"length":35} + >secondary: secondaryB = "secondary" + >:=> (line 26, col 12) to (line 26, col 47) +27 > } = { primary: "SomeSkill", secondary: "someSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (669 to 720) SpanInfo: {"start":559,"length":161} + >skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 24, col 8) to (line 27, col 60) +-------------------------------- +28 > }: Robot = robotA) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (721 to 742) SpanInfo: {"start":559,"length":161} + >skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 24, col 8) to (line 27, col 60) +28 > }: Robot = robotA) { + + ~~~ => Pos: (743 to 745) SpanInfo: {"start":750,"length":23} + >console.log(secondaryB) + >:=> (line 29, col 4) to (line 29, col 27) +-------------------------------- +29 > console.log(secondaryB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (746 to 774) SpanInfo: {"start":750,"length":23} + >console.log(secondaryB) + >:=> (line 29, col 4) to (line 29, col 27) +-------------------------------- +30 >} + + ~~ => Pos: (775 to 776) SpanInfo: {"start":775,"length":1} + >} + >:=> (line 30, col 0) to (line 30, col 1) +-------------------------------- +31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + + ~~~~~~~~~~~~~~ => Pos: (777 to 790) SpanInfo: {"start":877,"length":27} + >console.log(skills.primary) + >:=> (line 32, col 4) to (line 32, col 31) +31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (791 to 869) SpanInfo: {"start":793,"length":57} + >skills = { primary: "SomeSkill", secondary: "someSkill" } + >:=> (line 31, col 16) to (line 31, col 73) +31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + + ~~~=> Pos: (870 to 872) SpanInfo: {"start":877,"length":27} + >console.log(skills.primary) + >:=> (line 32, col 4) to (line 32, col 31) +-------------------------------- +32 > console.log(skills.primary); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (873 to 905) SpanInfo: {"start":877,"length":27} + >console.log(skills.primary) + >:=> (line 32, col 4) to (line 32, col 31) +-------------------------------- +33 >} + + ~~ => Pos: (906 to 907) SpanInfo: {"start":906,"length":1} + >} + >:=> (line 33, col 0) to (line 33, col 1) +-------------------------------- +34 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (908 to 921) SpanInfo: {"start":908,"length":12} + >foo1(robotA) + >:=> (line 34, col 0) to (line 34, col 12) +-------------------------------- +35 >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (922 to 1007) SpanInfo: {"start":922,"length":84} + >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 35, col 0) to (line 35, col 84) +-------------------------------- +36 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (1008 to 1021) SpanInfo: {"start":1008,"length":12} + >foo2(robotA) + >:=> (line 36, col 0) to (line 36, col 12) +-------------------------------- +37 >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1022 to 1107) SpanInfo: {"start":1022,"length":84} + >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 37, col 0) to (line 37, col 84) +-------------------------------- +38 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (1108 to 1121) SpanInfo: {"start":1108,"length":12} + >foo3(robotA) + >:=> (line 38, col 0) to (line 38, col 12) +-------------------------------- +39 >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (1122 to 1206) SpanInfo: {"start":1122,"length":84} + >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) + >:=> (line 39, col 0) to (line 39, col 84) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline new file mode 100644 index 00000000000..21f11f320ab --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline @@ -0,0 +1,164 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >function foo1({ name: nameA }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (187 to 200) SpanInfo: {"start":231,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +10 >function foo1({ name: nameA }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (201 to 223) SpanInfo: {"start":203,"length":11} + >name: nameA + >:=> (line 10, col 16) to (line 10, col 27) +10 >function foo1({ name: nameA }: Robot) { + + ~~~ => Pos: (224 to 226) SpanInfo: {"start":231,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +11 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (227 to 250) SpanInfo: {"start":231,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +12 >} + + ~~ => Pos: (251 to 252) SpanInfo: {"start":251,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) +-------------------------------- +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (253 to 266) SpanInfo: {"start":312,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (267 to 280) SpanInfo: {"start":269,"length":11} + >name: nameB + >:=> (line 13, col 16) to (line 13, col 27) +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (281 to 304) SpanInfo: {"start":282,"length":13} + >skill: skillB + >:=> (line 13, col 29) to (line 13, col 42) +13 >function foo2({ name: nameB, skill: skillB }: Robot) { + + ~~~=> Pos: (305 to 307) SpanInfo: {"start":312,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +14 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (308 to 331) SpanInfo: {"start":312,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +15 >} + + ~~ => Pos: (332 to 333) SpanInfo: {"start":332,"length":1} + >} + >:=> (line 15, col 0) to (line 15, col 1) +-------------------------------- +16 >function foo3({ name }: Robot) { + + ~~~~~~~~~~~~~~ => Pos: (334 to 347) SpanInfo: {"start":371,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +16 >function foo3({ name }: Robot) { + + ~~~~~~~~~~~~~~~~ => Pos: (348 to 363) SpanInfo: {"start":350,"length":4} + >name + >:=> (line 16, col 16) to (line 16, col 20) +16 >function foo3({ name }: Robot) { + + ~~~ => Pos: (364 to 366) SpanInfo: {"start":371,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +17 > console.log(name); + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (367 to 389) SpanInfo: {"start":371,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +18 >} + + ~~ => Pos: (390 to 391) SpanInfo: {"start":390,"length":1} + >} + >:=> (line 18, col 0) to (line 18, col 1) +-------------------------------- +19 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (392 to 405) SpanInfo: {"start":392,"length":12} + >foo1(robotA) + >:=> (line 19, col 0) to (line 19, col 12) +-------------------------------- +20 >foo1({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (406 to 454) SpanInfo: {"start":406,"length":47} + >foo1({ name: "Edger", skill: "cutting edges" }) + >:=> (line 20, col 0) to (line 20, col 47) +-------------------------------- +21 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (455 to 468) SpanInfo: {"start":455,"length":12} + >foo2(robotA) + >:=> (line 21, col 0) to (line 21, col 12) +-------------------------------- +22 >foo2({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (469 to 517) SpanInfo: {"start":469,"length":47} + >foo2({ name: "Edger", skill: "cutting edges" }) + >:=> (line 22, col 0) to (line 22, col 47) +-------------------------------- +23 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (518 to 531) SpanInfo: {"start":518,"length":12} + >foo3(robotA) + >:=> (line 23, col 0) to (line 23, col 12) +-------------------------------- +24 >foo3({ name: "Edger", skill: "cutting edges" }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (532 to 579) SpanInfo: {"start":532,"length":47} + >foo3({ name: "Edger", skill: "cutting edges" }) + >:=> (line 24, col 0) to (line 24, col 47) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..6cb9b39c0d3 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline @@ -0,0 +1,164 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name?: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (18 to 36) SpanInfo: undefined +-------------------------------- +3 > skill?: string; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (37 to 56) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (57 to 58) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (59 to 81) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (82 to 109) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (110 to 111) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (112 to 132) SpanInfo: {"start":112,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (133 to 188) SpanInfo: {"start":133,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >function foo1({ name: nameA = "" }: Robot = { }) { + + ~~~~~~~~~~~~~~ => Pos: (189 to 202) SpanInfo: {"start":252,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +10 >function foo1({ name: nameA = "" }: Robot = { }) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (203 to 244) SpanInfo: {"start":205,"length":24} + >name: nameA = "" + >:=> (line 10, col 16) to (line 10, col 40) +10 >function foo1({ name: nameA = "" }: Robot = { }) { + + ~~~=> Pos: (245 to 247) SpanInfo: {"start":252,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +11 > console.log(nameA); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (248 to 271) SpanInfo: {"start":252,"length":18} + >console.log(nameA) + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +12 >} + + ~~ => Pos: (272 to 273) SpanInfo: {"start":272,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) +-------------------------------- +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~~~~~~~~~~~~ => Pos: (274 to 287) SpanInfo: {"start":363,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (288 to 314) SpanInfo: {"start":290,"length":24} + >name: nameB = "" + >:=> (line 13, col 16) to (line 13, col 40) +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (315 to 355) SpanInfo: {"start":316,"length":25} + >skill: skillB = "noSkill" + >:=> (line 13, col 42) to (line 13, col 67) +13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + + ~~~=> Pos: (356 to 358) SpanInfo: {"start":363,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +14 > console.log(nameB); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (359 to 382) SpanInfo: {"start":363,"length":18} + >console.log(nameB) + >:=> (line 14, col 4) to (line 14, col 22) +-------------------------------- +15 >} + + ~~ => Pos: (383 to 384) SpanInfo: {"start":383,"length":1} + >} + >:=> (line 15, col 0) to (line 15, col 1) +-------------------------------- +16 >function foo3({ name = "" }: Robot = {}) { + + ~~~~~~~~~~~~~~ => Pos: (385 to 398) SpanInfo: {"start":440,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +16 >function foo3({ name = "" }: Robot = {}) { + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (399 to 432) SpanInfo: {"start":401,"length":17} + >name = "" + >:=> (line 16, col 16) to (line 16, col 33) +16 >function foo3({ name = "" }: Robot = {}) { + + ~~~=> Pos: (433 to 435) SpanInfo: {"start":440,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +17 > console.log(name); + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (436 to 458) SpanInfo: {"start":440,"length":17} + >console.log(name) + >:=> (line 17, col 4) to (line 17, col 21) +-------------------------------- +18 >} + + ~~ => Pos: (459 to 460) SpanInfo: {"start":459,"length":1} + >} + >:=> (line 18, col 0) to (line 18, col 1) +-------------------------------- +19 >foo1(robotA); + + ~~~~~~~~~~~~~~ => Pos: (461 to 474) SpanInfo: {"start":461,"length":12} + >foo1(robotA) + >:=> (line 19, col 0) to (line 19, col 12) +-------------------------------- +20 >foo1({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (475 to 523) SpanInfo: {"start":475,"length":47} + >foo1({ name: "Edger", skill: "cutting edges" }) + >:=> (line 20, col 0) to (line 20, col 47) +-------------------------------- +21 >foo2(robotA); + + ~~~~~~~~~~~~~~ => Pos: (524 to 537) SpanInfo: {"start":524,"length":12} + >foo2(robotA) + >:=> (line 21, col 0) to (line 21, col 12) +-------------------------------- +22 >foo2({ name: "Edger", skill: "cutting edges" }); + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (538 to 586) SpanInfo: {"start":538,"length":47} + >foo2({ name: "Edger", skill: "cutting edges" }) + >:=> (line 22, col 0) to (line 22, col 47) +-------------------------------- +23 >foo3(robotA); + + ~~~~~~~~~~~~~~ => Pos: (587 to 600) SpanInfo: {"start":587,"length":12} + >foo3(robotA) + >:=> (line 23, col 0) to (line 23, col 12) +-------------------------------- +24 >foo3({ name: "Edger", skill: "cutting edges" }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (601 to 648) SpanInfo: {"start":601,"length":47} + >foo3({ name: "Edger", skill: "cutting edges" }) + >:=> (line 24, col 0) to (line 24, col 47) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatement.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatement.baseline new file mode 100644 index 00000000000..3939c66c56e --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatement.baseline @@ -0,0 +1,109 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >var robotB: Robot = { name: "trimmer", skill: "trimming" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 246) SpanInfo: {"start":187,"length":58} + >var robotB: Robot = { name: "trimmer", skill: "trimming" } + >:=> (line 10, col 0) to (line 10, col 58) +-------------------------------- +11 >var { name: nameA } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (247 to 276) SpanInfo: {"start":253,"length":11} + >name: nameA + >:=> (line 11, col 6) to (line 11, col 17) +-------------------------------- +12 >var { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~~~~ => Pos: (277 to 294) SpanInfo: {"start":283,"length":11} + >name: nameB + >:=> (line 12, col 6) to (line 12, col 17) +12 >var { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (295 to 321) SpanInfo: {"start":296,"length":13} + >skill: skillB + >:=> (line 12, col 19) to (line 12, col 32) +-------------------------------- +13 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~ => Pos: (322 to 339) SpanInfo: {"start":328,"length":11} + >name: nameC + >:=> (line 13, col 6) to (line 13, col 17) +13 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (340 to 401) SpanInfo: {"start":341,"length":13} + >skill: skillC + >:=> (line 13, col 19) to (line 13, col 32) +-------------------------------- +14 >if (nameA == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (402 to 423) SpanInfo: {"start":402,"length":19} + >if (nameA == nameB) + >:=> (line 14, col 0) to (line 14, col 19) +-------------------------------- +15 > console.log(skillB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (424 to 448) SpanInfo: {"start":428,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +16 >} + + ~~ => Pos: (449 to 450) SpanInfo: {"start":428,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +17 >else { + + ~~~~~~~ => Pos: (451 to 457) SpanInfo: {"start":462,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +18 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (458 to 481) SpanInfo: {"start":462,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +19 >} + ~ => Pos: (482 to 482) SpanInfo: {"start":462,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatement1.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatement1.baseline new file mode 100644 index 00000000000..ce1edbb0ee9 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatement1.baseline @@ -0,0 +1,227 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >var robotB: Robot = { name: "trimmer", skill: "trimming" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 246) SpanInfo: {"start":187,"length":58} + >var robotB: Robot = { name: "trimmer", skill: "trimming" } + >:=> (line 10, col 0) to (line 10, col 58) +-------------------------------- +11 >var a: string, { name: nameA } = robotA; + + ~~~~~~~~~~~~~~ => Pos: (247 to 260) SpanInfo: undefined +11 >var a: string, { name: nameA } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (261 to 287) SpanInfo: {"start":264,"length":11} + >name: nameA + >:=> (line 11, col 17) to (line 11, col 28) +-------------------------------- +12 >var b: string, { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~ => Pos: (288 to 301) SpanInfo: undefined +12 >var b: string, { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~ => Pos: (302 to 316) SpanInfo: {"start":305,"length":11} + >name: nameB + >:=> (line 12, col 17) to (line 12, col 28) +12 >var b: string, { name: nameB, skill: skillB } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (317 to 343) SpanInfo: {"start":318,"length":13} + >skill: skillB + >:=> (line 12, col 30) to (line 12, col 43) +-------------------------------- +13 >var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~ => Pos: (344 to 357) SpanInfo: undefined +13 >var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~ => Pos: (358 to 372) SpanInfo: {"start":361,"length":11} + >name: nameC + >:=> (line 13, col 17) to (line 13, col 28) +13 >var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (373 to 434) SpanInfo: {"start":374,"length":13} + >skill: skillC + >:=> (line 13, col 30) to (line 13, col 43) +-------------------------------- +14 > + + ~ => Pos: (435 to 435) SpanInfo: undefined +-------------------------------- +15 >var { name: nameA } = robotA, a = hello; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (436 to 464) SpanInfo: {"start":442,"length":11} + >name: nameA + >:=> (line 15, col 6) to (line 15, col 17) +15 >var { name: nameA } = robotA, a = hello; + + ~~~~~~~~~~~~ => Pos: (465 to 476) SpanInfo: {"start":466,"length":9} + >a = hello + >:=> (line 15, col 30) to (line 15, col 39) +-------------------------------- +16 >var { name: nameB, skill: skillB } = robotB, b = " hello"; + + ~~~~~~~~~~~~~~~~~~ => Pos: (477 to 494) SpanInfo: {"start":483,"length":11} + >name: nameB + >:=> (line 16, col 6) to (line 16, col 17) +16 >var { name: nameB, skill: skillB } = robotB, b = " hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (495 to 520) SpanInfo: {"start":496,"length":13} + >skill: skillB + >:=> (line 16, col 19) to (line 16, col 32) +16 >var { name: nameB, skill: skillB } = robotB, b = " hello"; + + ~~~~~~~~~~~~~~~=> Pos: (521 to 535) SpanInfo: {"start":522,"length":12} + >b = " hello" + >:=> (line 16, col 45) to (line 16, col 57) +-------------------------------- +17 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + + ~~~~~~~~~~~~~~~~~~ => Pos: (536 to 553) SpanInfo: {"start":542,"length":11} + >name: nameC + >:=> (line 17, col 6) to (line 17, col 17) +17 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (554 to 614) SpanInfo: {"start":555,"length":13} + >skill: skillC + >:=> (line 17, col 19) to (line 17, col 32) +17 >var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + + ~~~~~~~~~~~~=> Pos: (615 to 626) SpanInfo: {"start":616,"length":9} + >c = hello + >:=> (line 17, col 80) to (line 17, col 89) +-------------------------------- +18 > + + ~ => Pos: (627 to 627) SpanInfo: undefined +-------------------------------- +19 >var a = hello, { name: nameA } = robotA, a1= "hello"; + + ~~~~~~~~~~~~~~ => Pos: (628 to 641) SpanInfo: {"start":628,"length":13} + >var a = hello + >:=> (line 19, col 0) to (line 19, col 13) +19 >var a = hello, { name: nameA } = robotA, a1= "hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (642 to 667) SpanInfo: {"start":645,"length":11} + >name: nameA + >:=> (line 19, col 17) to (line 19, col 28) +19 >var a = hello, { name: nameA } = robotA, a1= "hello"; + + ~~~~~~~~~~~~~~=> Pos: (668 to 681) SpanInfo: {"start":669,"length":11} + >a1= "hello" + >:=> (line 19, col 41) to (line 19, col 52) +-------------------------------- +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~ => Pos: (682 to 695) SpanInfo: {"start":682,"length":13} + >var b = hello + >:=> (line 20, col 0) to (line 20, col 13) +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~~ => Pos: (696 to 710) SpanInfo: {"start":699,"length":11} + >name: nameB + >:=> (line 20, col 17) to (line 20, col 28) +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (711 to 736) SpanInfo: {"start":712,"length":13} + >skill: skillB + >:=> (line 20, col 30) to (line 20, col 43) +20 >var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; + + ~~~~~~~~~~~~~~~=> Pos: (737 to 751) SpanInfo: {"start":738,"length":12} + >b1 = "hello" + >:=> (line 20, col 56) to (line 20, col 68) +-------------------------------- +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~~ => Pos: (752 to 765) SpanInfo: {"start":752,"length":13} + >var c = hello + >:=> (line 21, col 0) to (line 21, col 13) +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~~~ => Pos: (766 to 780) SpanInfo: {"start":769,"length":11} + >name: nameC + >:=> (line 21, col 17) to (line 21, col 28) +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (781 to 841) SpanInfo: {"start":782,"length":13} + >skill: skillC + >:=> (line 21, col 30) to (line 21, col 43) +21 >var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; + + ~~~~~~~~~~~~~=> Pos: (842 to 854) SpanInfo: {"start":843,"length":10} + >c1 = hello + >:=> (line 21, col 91) to (line 21, col 101) +-------------------------------- +22 >if (nameA == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (855 to 876) SpanInfo: {"start":855,"length":19} + >if (nameA == nameB) + >:=> (line 22, col 0) to (line 22, col 19) +-------------------------------- +23 > console.log(skillB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (877 to 901) SpanInfo: {"start":881,"length":19} + >console.log(skillB) + >:=> (line 23, col 4) to (line 23, col 23) +-------------------------------- +24 >} + + ~~ => Pos: (902 to 903) SpanInfo: {"start":881,"length":19} + >console.log(skillB) + >:=> (line 23, col 4) to (line 23, col 23) +-------------------------------- +25 >else { + + ~~~~~~~ => Pos: (904 to 910) SpanInfo: {"start":915,"length":18} + >console.log(nameC) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +26 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (911 to 934) SpanInfo: {"start":915,"length":18} + >console.log(nameC) + >:=> (line 26, col 4) to (line 26, col 22) +-------------------------------- +27 >} + ~ => Pos: (935 to 935) SpanInfo: {"start":915,"length":18} + >console.log(nameC) + >:=> (line 26, col 4) to (line 26, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern.baseline new file mode 100644 index 00000000000..0639ca49c9d --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern.baseline @@ -0,0 +1,87 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (53 to 91) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (92 to 135) SpanInfo: {"start":92,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (136 to 183) SpanInfo: {"start":136,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 6, col 0) to (line 6, col 46) +-------------------------------- +7 >let [, nameA] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (184 to 207) SpanInfo: {"start":191,"length":5} + >nameA + >:=> (line 7, col 7) to (line 7, col 12) +-------------------------------- +8 >let [numberB] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (208 to 231) SpanInfo: {"start":213,"length":7} + >numberB + >:=> (line 8, col 5) to (line 8, col 12) +-------------------------------- +9 >let [numberA2, nameA2, skillA2] = robotA; + + ~~~~~~~~~~~~~~ => Pos: (232 to 245) SpanInfo: {"start":237,"length":8} + >numberA2 + >:=> (line 9, col 5) to (line 9, col 13) +9 >let [numberA2, nameA2, skillA2] = robotA; + + ~~~~~~~~ => Pos: (246 to 253) SpanInfo: {"start":247,"length":6} + >nameA2 + >:=> (line 9, col 15) to (line 9, col 21) +9 >let [numberA2, nameA2, skillA2] = robotA; + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (254 to 273) SpanInfo: {"start":255,"length":7} + >skillA2 + >:=> (line 9, col 23) to (line 9, col 30) +-------------------------------- +10 >let [numberC2] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (274 to 323) SpanInfo: {"start":279,"length":8} + >numberC2 + >:=> (line 10, col 5) to (line 10, col 13) +-------------------------------- +11 >let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~ => Pos: (324 to 336) SpanInfo: {"start":329,"length":7} + >numberC + >:=> (line 11, col 5) to (line 11, col 12) +11 >let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + + ~~~~~~~ => Pos: (337 to 343) SpanInfo: {"start":338,"length":5} + >nameC + >:=> (line 11, col 14) to (line 11, col 19) +11 >let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (344 to 387) SpanInfo: {"start":345,"length":6} + >skillC + >:=> (line 11, col 21) to (line 11, col 27) +-------------------------------- +12 >let [numberA3, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~ => Pos: (388 to 401) SpanInfo: {"start":393,"length":8} + >numberA3 + >:=> (line 12, col 5) to (line 12, col 13) +12 >let [numberA3, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (402 to 426) SpanInfo: {"start":403,"length":13} + >...robotAInfo + >:=> (line 12, col 15) to (line 12, col 28) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern2.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern2.baseline new file mode 100644 index 00000000000..cb980a37c74 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPattern2.baseline @@ -0,0 +1,105 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type MultiSkilledRobot = [string, [string, string]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (53 to 105) SpanInfo: undefined +-------------------------------- +5 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (106 to 169) SpanInfo: {"start":106,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 5, col 0) to (line 5, col 62) +-------------------------------- +6 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (170 to 243) SpanInfo: {"start":170,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 6, col 0) to (line 6, col 72) +-------------------------------- +7 > + + ~ => Pos: (244 to 244) SpanInfo: undefined +-------------------------------- +8 >let [, skillA] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (245 to 274) SpanInfo: {"start":252,"length":6} + >skillA + >:=> (line 8, col 7) to (line 8, col 13) +-------------------------------- +9 >let [nameMB] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (275 to 302) SpanInfo: {"start":280,"length":6} + >nameMB + >:=> (line 9, col 5) to (line 9, col 11) +-------------------------------- +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~ => Pos: (303 to 314) SpanInfo: {"start":308,"length":6} + >nameMA + >:=> (line 10, col 5) to (line 10, col 11) +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~~~~~ => Pos: (315 to 330) SpanInfo: {"start":317,"length":13} + >primarySkillA + >:=> (line 10, col 14) to (line 10, col 27) +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~ => Pos: (331 to 347) SpanInfo: {"start":332,"length":15} + >secondarySkillA + >:=> (line 10, col 29) to (line 10, col 44) +10 >let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~=> Pos: (348 to 364) SpanInfo: {"start":316,"length":32} + >[primarySkillA, secondarySkillA] + >:=> (line 10, col 13) to (line 10, col 45) +-------------------------------- +11 > + + ~ => Pos: (365 to 365) SpanInfo: undefined +-------------------------------- +12 >let [nameMC] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (366 to 415) SpanInfo: {"start":371,"length":6} + >nameMC + >:=> (line 12, col 5) to (line 12, col 11) +-------------------------------- +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~ => Pos: (416 to 428) SpanInfo: {"start":421,"length":7} + >nameMC2 + >:=> (line 13, col 5) to (line 13, col 12) +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~ => Pos: (429 to 444) SpanInfo: {"start":431,"length":13} + >primarySkillC + >:=> (line 13, col 15) to (line 13, col 28) +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~=> Pos: (445 to 461) SpanInfo: {"start":446,"length":15} + >secondarySkillC + >:=> (line 13, col 30) to (line 13, col 45) +13 >let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (462 to 500) SpanInfo: {"start":430,"length":32} + >[primarySkillC, secondarySkillC] + >:=> (line 13, col 14) to (line 13, col 46) +-------------------------------- +14 > + + ~ => Pos: (501 to 501) SpanInfo: undefined +-------------------------------- +15 >let [...multiRobotAInfo] = multiRobotA; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (502 to 540) SpanInfo: {"start":507,"length":18} + >...multiRobotAInfo + >:=> (line 15, col 5) to (line 15, col 23) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues.baseline new file mode 100644 index 00000000000..e3b43164563 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues.baseline @@ -0,0 +1,87 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type Robot = [number, string, string]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (53 to 91) SpanInfo: undefined +-------------------------------- +5 >var robotA: Robot = [1, "mower", "mowing"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (92 to 135) SpanInfo: {"start":92,"length":42} + >var robotA: Robot = [1, "mower", "mowing"] + >:=> (line 5, col 0) to (line 5, col 42) +-------------------------------- +6 >var robotB: Robot = [2, "trimmer", "trimming"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (136 to 183) SpanInfo: {"start":136,"length":46} + >var robotB: Robot = [2, "trimmer", "trimming"] + >:=> (line 6, col 0) to (line 6, col 46) +-------------------------------- +7 >let [, nameA = "noName"] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (184 to 218) SpanInfo: {"start":191,"length":16} + >nameA = "noName" + >:=> (line 7, col 7) to (line 7, col 23) +-------------------------------- +8 >let [numberB = -1] = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (219 to 247) SpanInfo: {"start":224,"length":12} + >numberB = -1 + >:=> (line 8, col 5) to (line 8, col 17) +-------------------------------- +9 >let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (248 to 266) SpanInfo: {"start":253,"length":13} + >numberA2 = -1 + >:=> (line 9, col 5) to (line 9, col 18) +9 >let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (267 to 285) SpanInfo: {"start":268,"length":17} + >nameA2 = "noName" + >:=> (line 9, col 20) to (line 9, col 37) +9 >let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (286 to 317) SpanInfo: {"start":287,"length":19} + >skillA2 = "noSkill" + >:=> (line 9, col 39) to (line 9, col 58) +-------------------------------- +10 >let [numberC2 = -1] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (318 to 372) SpanInfo: {"start":323,"length":13} + >numberC2 = -1 + >:=> (line 10, col 5) to (line 10, col 18) +-------------------------------- +11 >let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~ => Pos: (373 to 390) SpanInfo: {"start":378,"length":12} + >numberC = -1 + >:=> (line 11, col 5) to (line 11, col 17) +11 >let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~ => Pos: (391 to 408) SpanInfo: {"start":392,"length":16} + >nameC = "noName" + >:=> (line 11, col 19) to (line 11, col 35) +11 >let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (409 to 464) SpanInfo: {"start":410,"length":18} + >skillC = "noSkill" + >:=> (line 11, col 37) to (line 11, col 55) +-------------------------------- +12 >let [numberA3 = -1, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~~~~~~ => Pos: (465 to 483) SpanInfo: {"start":470,"length":13} + >numberA3 = -1 + >:=> (line 12, col 5) to (line 12, col 18) +12 >let [numberA3 = -1, ...robotAInfo] = robotA; + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (484 to 508) SpanInfo: {"start":485,"length":13} + >...robotAInfo + >:=> (line 12, col 20) to (line 12, col 33) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues2.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues2.baseline new file mode 100644 index 00000000000..ddbfdd29268 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementArrayBindingPatternDefaultValues2.baseline @@ -0,0 +1,84 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >type MultiSkilledRobot = [string, string[]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (53 to 97) SpanInfo: undefined +-------------------------------- +5 >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (98 to 161) SpanInfo: {"start":98,"length":62} + >var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]] + >:=> (line 5, col 0) to (line 5, col 62) +-------------------------------- +6 >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (162 to 235) SpanInfo: {"start":162,"length":72} + >var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]] + >:=> (line 6, col 0) to (line 6, col 72) +-------------------------------- +7 >let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (236 to 290) SpanInfo: {"start":243,"length":31} + >skillA = ["noSkill", "noSkill"] + >:=> (line 7, col 7) to (line 7, col 38) +-------------------------------- +8 >let [nameMB = "noName" ] = multiRobotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (291 to 330) SpanInfo: {"start":296,"length":17} + >nameMB = "noName" + >:=> (line 8, col 5) to (line 8, col 22) +-------------------------------- +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (331 to 353) SpanInfo: {"start":336,"length":17} + >nameMA = "noName" + >:=> (line 9, col 5) to (line 9, col 22) +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (354 to 381) SpanInfo: {"start":356,"length":25} + >primarySkillA = "noSkill" + >:=> (line 9, col 25) to (line 9, col 50) +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (382 to 410) SpanInfo: {"start":383,"length":27} + >secondarySkillA = "noSkill" + >:=> (line 9, col 52) to (line 9, col 79) +9 >let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (411 to 452) SpanInfo: {"start":355,"length":81} + >[primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"] + >:=> (line 9, col 24) to (line 9, col 105) +-------------------------------- +10 >let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (453 to 514) SpanInfo: {"start":458,"length":17} + >nameMC = "noName" + >:=> (line 10, col 5) to (line 10, col 22) +-------------------------------- +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (515 to 538) SpanInfo: {"start":520,"length":18} + >nameMC2 = "noName" + >:=> (line 11, col 5) to (line 11, col 23) +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (539 to 566) SpanInfo: {"start":541,"length":25} + >primarySkillC = "noSkill" + >:=> (line 11, col 26) to (line 11, col 51) +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (567 to 595) SpanInfo: {"start":568,"length":27} + >secondarySkillC = "noSkill" + >:=> (line 11, col 53) to (line 11, col 80) +11 >let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (596 to 658) SpanInfo: {"start":540,"length":81} + >[primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"] + >:=> (line 11, col 25) to (line 11, col 106) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementDefaultValues.baseline new file mode 100644 index 00000000000..60ee5897d48 --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementDefaultValues.baseline @@ -0,0 +1,109 @@ + +1 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: undefined +-------------------------------- +2 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (18 to 35) SpanInfo: undefined +-------------------------------- +3 > skill: string; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 54) SpanInfo: undefined +-------------------------------- +4 >} + + ~~ => Pos: (55 to 56) SpanInfo: undefined +-------------------------------- +5 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (57 to 79) SpanInfo: undefined +-------------------------------- +6 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (80 to 107) SpanInfo: undefined +-------------------------------- +7 >} + + ~~ => Pos: (108 to 109) SpanInfo: undefined +-------------------------------- +8 >var hello = "hello"; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 130) SpanInfo: {"start":110,"length":19} + >var hello = "hello" + >:=> (line 8, col 0) to (line 8, col 19) +-------------------------------- +9 >var robotA: Robot = { name: "mower", skill: "mowing" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (131 to 186) SpanInfo: {"start":131,"length":54} + >var robotA: Robot = { name: "mower", skill: "mowing" } + >:=> (line 9, col 0) to (line 9, col 54) +-------------------------------- +10 >var robotB: Robot = { name: "trimmer", skill: "trimming" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (187 to 246) SpanInfo: {"start":187,"length":58} + >var robotB: Robot = { name: "trimmer", skill: "trimming" } + >:=> (line 10, col 0) to (line 10, col 58) +-------------------------------- +11 >var { name: nameA = "" } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (247 to 289) SpanInfo: {"start":253,"length":24} + >name: nameA = "" + >:=> (line 11, col 6) to (line 11, col 30) +-------------------------------- +12 >var { name: nameB = "", skill: skillB = "" } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (290 to 320) SpanInfo: {"start":296,"length":24} + >name: nameB = "" + >:=> (line 12, col 6) to (line 12, col 30) +12 >var { name: nameB = "", skill: skillB = "" } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (321 to 370) SpanInfo: {"start":322,"length":36} + >skill: skillB = "" + >:=> (line 12, col 32) to (line 12, col 68) +-------------------------------- +13 >var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (371 to 401) SpanInfo: {"start":377,"length":24} + >name: nameC = "" + >:=> (line 13, col 6) to (line 13, col 30) +13 >var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (402 to 486) SpanInfo: {"start":403,"length":36} + >skill: skillC = "" + >:=> (line 13, col 32) to (line 13, col 68) +-------------------------------- +14 >if (nameA == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (487 to 508) SpanInfo: {"start":487,"length":19} + >if (nameA == nameB) + >:=> (line 14, col 0) to (line 14, col 19) +-------------------------------- +15 > console.log(skillB); + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (509 to 533) SpanInfo: {"start":513,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +16 >} + + ~~ => Pos: (534 to 535) SpanInfo: {"start":513,"length":19} + >console.log(skillB) + >:=> (line 15, col 4) to (line 15, col 23) +-------------------------------- +17 >else { + + ~~~~~~~ => Pos: (536 to 542) SpanInfo: {"start":547,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +18 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (543 to 566) SpanInfo: {"start":547,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) +-------------------------------- +19 >} + ~ => Pos: (567 to 567) SpanInfo: {"start":547,"length":18} + >console.log(nameC) + >:=> (line 18, col 4) to (line 18, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPattern.baseline new file mode 100644 index 00000000000..66f814ada9c --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPattern.baseline @@ -0,0 +1,168 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 127) SpanInfo: undefined +-------------------------------- +8 > secondary: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (128 to 154) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (155 to 161) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (162 to 163) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (164 to 252) SpanInfo: {"start":164,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (253 to 347) SpanInfo: {"start":253,"length":93} + >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } + >:=> (line 12, col 0) to (line 12, col 93) +-------------------------------- +13 > + + ~ => Pos: (348 to 348) SpanInfo: undefined +-------------------------------- +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~ => Pos: (349 to 361) SpanInfo: {"start":355,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 14, col 6) to (line 14, col 58) +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (362 to 382) SpanInfo: {"start":365,"length":17} + >primary: primaryA + >:=> (line 14, col 16) to (line 14, col 33) +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (383 to 406) SpanInfo: {"start":384,"length":21} + >secondary: secondaryA + >:=> (line 14, col 35) to (line 14, col 56) +14 >var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; + + ~~~~~~~~~~~~~=> Pos: (407 to 419) SpanInfo: {"start":355,"length":52} + >skills: { primary: primaryA, secondary: secondaryA } + >:=> (line 14, col 6) to (line 14, col 58) +-------------------------------- +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~~~~~~ => Pos: (420 to 437) SpanInfo: {"start":426,"length":11} + >name: nameB + >:=> (line 15, col 6) to (line 15, col 17) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~ => Pos: (438 to 445) SpanInfo: {"start":439,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 19) to (line 15, col 71) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (446 to 466) SpanInfo: {"start":449,"length":17} + >primary: primaryB + >:=> (line 15, col 29) to (line 15, col 46) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (467 to 490) SpanInfo: {"start":468,"length":21} + >secondary: secondaryB + >:=> (line 15, col 48) to (line 15, col 69) +15 >var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; + + ~~~~~~~~~~~~~=> Pos: (491 to 503) SpanInfo: {"start":439,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 15, col 19) to (line 15, col 71) +-------------------------------- +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~ => Pos: (504 to 521) SpanInfo: {"start":510,"length":11} + >name: nameC + >:=> (line 16, col 6) to (line 16, col 17) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~ => Pos: (522 to 529) SpanInfo: {"start":523,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 16, col 19) to (line 16, col 71) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~=> Pos: (530 to 550) SpanInfo: {"start":533,"length":17} + >primary: primaryB + >:=> (line 16, col 29) to (line 16, col 46) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (551 to 574) SpanInfo: {"start":552,"length":21} + >secondary: secondaryB + >:=> (line 16, col 48) to (line 16, col 69) +16 >var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (575 to 659) SpanInfo: {"start":523,"length":52} + >skills: { primary: primaryB, secondary: secondaryB } + >:=> (line 16, col 19) to (line 16, col 71) +-------------------------------- +17 > + + ~ => Pos: (660 to 660) SpanInfo: undefined +-------------------------------- +18 >if (nameB == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (661 to 682) SpanInfo: {"start":661,"length":19} + >if (nameB == nameB) + >:=> (line 18, col 0) to (line 18, col 19) +-------------------------------- +19 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (683 to 706) SpanInfo: {"start":687,"length":18} + >console.log(nameC) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +20 >} + + ~~ => Pos: (707 to 708) SpanInfo: {"start":687,"length":18} + >console.log(nameC) + >:=> (line 19, col 4) to (line 19, col 22) +-------------------------------- +21 >else { + + ~~~~~~~ => Pos: (709 to 715) SpanInfo: {"start":720,"length":18} + >console.log(nameC) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +22 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (716 to 739) SpanInfo: {"start":720,"length":18} + >console.log(nameC) + >:=> (line 22, col 4) to (line 22, col 22) +-------------------------------- +23 >} + ~ => Pos: (740 to 740) SpanInfo: {"start":720,"length":18} + >console.log(nameC) + >:=> (line 22, col 4) to (line 22, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.baseline new file mode 100644 index 00000000000..75b37a0231e --- /dev/null +++ b/tests/baselines/reference/bpSpanDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.baseline @@ -0,0 +1,275 @@ + +1 >declare var console: { + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (0 to 22) SpanInfo: undefined +-------------------------------- +2 > log(msg: string): void; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (23 to 50) SpanInfo: undefined +-------------------------------- +3 >} + + ~~ => Pos: (51 to 52) SpanInfo: undefined +-------------------------------- +4 >interface Robot { + + ~~~~~~~~~~~~~~~~~~ => Pos: (53 to 70) SpanInfo: undefined +-------------------------------- +5 > name: string; + + ~~~~~~~~~~~~~~~~~~ => Pos: (71 to 88) SpanInfo: undefined +-------------------------------- +6 > skills: { + + ~~~~~~~~~~~~~~ => Pos: (89 to 102) SpanInfo: undefined +-------------------------------- +7 > primary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (103 to 128) SpanInfo: undefined +-------------------------------- +8 > secondary?: string; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (129 to 156) SpanInfo: undefined +-------------------------------- +9 > }; + + ~~~~~~~ => Pos: (157 to 163) SpanInfo: undefined +-------------------------------- +10 >} + + ~~ => Pos: (164 to 165) SpanInfo: undefined +-------------------------------- +11 >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (166 to 254) SpanInfo: {"start":166,"length":87} + >var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } } + >:=> (line 11, col 0) to (line 11, col 87) +-------------------------------- +12 >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (255 to 349) SpanInfo: {"start":255,"length":93} + >var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } + >:=> (line 12, col 0) to (line 12, col 93) +-------------------------------- +13 > + + ~ => Pos: (350 to 350) SpanInfo: undefined +-------------------------------- +14 >var { + + ~~~~~~ => Pos: (351 to 356) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +-------------------------------- +15 > skills: { + + ~~~~~~~~~~~ => Pos: (357 to 367) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +15 > skills: { + + ~~~ => Pos: (368 to 370) SpanInfo: {"start":379,"length":29} + >primary: primaryA = "noSkill" + >:=> (line 16, col 8) to (line 16, col 37) +-------------------------------- +16 > primary: primaryA = "noSkill", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (371 to 409) SpanInfo: {"start":379,"length":29} + >primary: primaryA = "noSkill" + >:=> (line 16, col 8) to (line 16, col 37) +-------------------------------- +17 > secondary: secondaryA = "noSkill" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (410 to 451) SpanInfo: {"start":418,"length":33} + >secondary: secondaryA = "noSkill" + >:=> (line 17, col 8) to (line 17, col 41) +-------------------------------- +18 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (452 to 456) SpanInfo: {"start":418,"length":33} + >secondary: secondaryA = "noSkill" + >:=> (line 17, col 8) to (line 17, col 41) +18 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (457 to 504) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +-------------------------------- +19 >} = robotA; + + ~~~~~~~~~~~~ => Pos: (505 to 516) SpanInfo: {"start":361,"length":143} + >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 15, col 4) to (line 18, col 52) +-------------------------------- +20 >var { + + ~~~~~~ => Pos: (517 to 522) SpanInfo: {"start":527,"length":31} + >name: nameB = "noNameSpecified" + >:=> (line 21, col 4) to (line 21, col 35) +-------------------------------- +21 > name: nameB = "noNameSpecified", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (523 to 559) SpanInfo: {"start":527,"length":31} + >name: nameB = "noNameSpecified" + >:=> (line 21, col 4) to (line 21, col 35) +-------------------------------- +22 > skills: { + + ~~~~~~~~~~~ => Pos: (560 to 570) SpanInfo: {"start":564,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 22, col 4) to (line 25, col 52) +22 > skills: { + + ~~~ => Pos: (571 to 573) SpanInfo: {"start":582,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 23, col 8) to (line 23, col 37) +-------------------------------- +23 > primary: primaryB = "noSkill", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (574 to 612) SpanInfo: {"start":582,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 23, col 8) to (line 23, col 37) +-------------------------------- +24 > secondary: secondaryB = "noSkill" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (613 to 654) SpanInfo: {"start":621,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 24, col 8) to (line 24, col 41) +-------------------------------- +25 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (655 to 659) SpanInfo: {"start":621,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 24, col 8) to (line 24, col 41) +25 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (660 to 707) SpanInfo: {"start":564,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 22, col 4) to (line 25, col 52) +-------------------------------- +26 >} = robotB; + + ~~~~~~~~~~~~ => Pos: (708 to 719) SpanInfo: {"start":564,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 22, col 4) to (line 25, col 52) +-------------------------------- +27 >var { + + ~~~~~~ => Pos: (720 to 725) SpanInfo: {"start":730,"length":31} + >name: nameC = "noNameSpecified" + >:=> (line 28, col 4) to (line 28, col 35) +-------------------------------- +28 > name: nameC = "noNameSpecified", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (726 to 762) SpanInfo: {"start":730,"length":31} + >name: nameC = "noNameSpecified" + >:=> (line 28, col 4) to (line 28, col 35) +-------------------------------- +29 > skills: { + + ~~~~~~~~~~~ => Pos: (763 to 773) SpanInfo: {"start":767,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 29, col 4) to (line 32, col 52) +29 > skills: { + + ~~~ => Pos: (774 to 776) SpanInfo: {"start":785,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 30, col 8) to (line 30, col 37) +-------------------------------- +30 > primary: primaryB = "noSkill", + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (777 to 815) SpanInfo: {"start":785,"length":29} + >primary: primaryB = "noSkill" + >:=> (line 30, col 8) to (line 30, col 37) +-------------------------------- +31 > secondary: secondaryB = "noSkill" + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (816 to 857) SpanInfo: {"start":824,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 31, col 8) to (line 31, col 41) +-------------------------------- +32 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~ => Pos: (858 to 862) SpanInfo: {"start":824,"length":33} + >secondary: secondaryB = "noSkill" + >:=> (line 31, col 8) to (line 31, col 41) +32 > } = { primary: "noSkill", secondary: "noSkill" } + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (863 to 910) SpanInfo: {"start":767,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 29, col 4) to (line 32, col 52) +-------------------------------- +33 >} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (911 to 1001) SpanInfo: {"start":767,"length":143} + >skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + >:=> (line 29, col 4) to (line 32, col 52) +-------------------------------- +34 > + + ~ => Pos: (1002 to 1002) SpanInfo: undefined +-------------------------------- +35 >if (nameB == nameB) { + + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1003 to 1024) SpanInfo: {"start":1003,"length":19} + >if (nameB == nameB) + >:=> (line 35, col 0) to (line 35, col 19) +-------------------------------- +36 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1025 to 1048) SpanInfo: {"start":1029,"length":18} + >console.log(nameC) + >:=> (line 36, col 4) to (line 36, col 22) +-------------------------------- +37 >} + + ~~ => Pos: (1049 to 1050) SpanInfo: {"start":1029,"length":18} + >console.log(nameC) + >:=> (line 36, col 4) to (line 36, col 22) +-------------------------------- +38 >else { + + ~~~~~~~ => Pos: (1051 to 1057) SpanInfo: {"start":1062,"length":18} + >console.log(nameC) + >:=> (line 39, col 4) to (line 39, col 22) +-------------------------------- +39 > console.log(nameC); + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (1058 to 1081) SpanInfo: {"start":1062,"length":18} + >console.log(nameC) + >:=> (line 39, col 4) to (line 39, col 22) +-------------------------------- +40 >} + ~ => Pos: (1082 to 1082) SpanInfo: {"start":1062,"length":18} + >console.log(nameC) + >:=> (line 39, col 4) to (line 39, col 22) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline b/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline index d8bfbc84aa0..aa39897be0f 100644 --- a/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline +++ b/tests/baselines/reference/bpSpan_arrayLiteralExpressions.baseline @@ -25,26 +25,14 @@ -------------------------------- 5 >a = [foo(30), (function () { - ~~~~~ => Pos: (64 to 68) SpanInfo: {"start":64,"length":49} + ~~~~~~~~~~~~~ => Pos: (64 to 76) SpanInfo: {"start":64,"length":49} >a = [foo(30), (function () { > return 30; >})()] >:=> (line 5, col 0) to (line 7, col 5) 5 >a = [foo(30), (function () { - ~~~~~~~~ => Pos: (69 to 76) SpanInfo: {"start":69,"length":7} - >foo(30) - >:=> (line 5, col 5) to (line 5, col 12) -5 >a = [foo(30), (function () { - - ~~ => Pos: (77 to 78) SpanInfo: {"start":78,"length":34} - >(function () { - > return 30; - >})() - >:=> (line 5, col 14) to (line 7, col 4) -5 >a = [foo(30), (function () { - - ~~~~~~~~~~~~~~ => Pos: (79 to 92) SpanInfo: {"start":97,"length":9} + ~~~~~~~~~~~~~~~~ => Pos: (77 to 92) SpanInfo: {"start":97,"length":9} >return 30 >:=> (line 6, col 4) to (line 6, col 13) -------------------------------- @@ -56,18 +44,11 @@ -------------------------------- 7 >})()]; - ~ => Pos: (108 to 108) SpanInfo: {"start":108,"length":1} + ~~~~ => Pos: (108 to 111) SpanInfo: {"start":108,"length":1} >} >:=> (line 7, col 0) to (line 7, col 1) 7 >})()]; - ~~~ => Pos: (109 to 111) SpanInfo: {"start":78,"length":34} - >(function () { - > return 30; - >})() - >:=> (line 5, col 14) to (line 7, col 4) -7 >})()]; - ~~~ => Pos: (112 to 114) SpanInfo: {"start":64,"length":49} >a = [foo(30), (function () { > return 30; @@ -94,17 +75,7 @@ -------------------------------- 11 >var x = bar()[0]; - ~~~~~~~ => Pos: (148 to 154) SpanInfo: {"start":148,"length":16} - >var x = bar()[0] - >:=> (line 11, col 0) to (line 11, col 16) -11 >var x = bar()[0]; - - ~~~~~~ => Pos: (155 to 160) SpanInfo: {"start":156,"length":5} - >bar() - >:=> (line 11, col 8) to (line 11, col 13) -11 >var x = bar()[0]; - - ~~~~~ => Pos: (161 to 165) SpanInfo: {"start":148,"length":16} + ~~~~~~~~~~~~~~~~~~ => Pos: (148 to 165) SpanInfo: {"start":148,"length":16} >var x = bar()[0] >:=> (line 11, col 0) to (line 11, col 16) -------------------------------- @@ -117,14 +88,7 @@ >:=> (line 12, col 0) to (line 14, col 7) 12 >x = (function () { - ~~ => Pos: (169 to 170) SpanInfo: {"start":170,"length":33} - >(function () { - > return a; - >})() - >:=> (line 12, col 4) to (line 14, col 4) -12 >x = (function () { - - ~~~~~~~~~~~~~~ => Pos: (171 to 184) SpanInfo: {"start":189,"length":8} + ~~~~~~~~~~~~~~~~ => Pos: (169 to 184) SpanInfo: {"start":189,"length":8} >return a >:=> (line 13, col 4) to (line 13, col 12) -------------------------------- @@ -136,18 +100,11 @@ -------------------------------- 14 >})()[x]; - ~ => Pos: (199 to 199) SpanInfo: {"start":199,"length":1} + ~~~~ => Pos: (199 to 202) SpanInfo: {"start":199,"length":1} >} >:=> (line 14, col 0) to (line 14, col 1) 14 >})()[x]; - ~~~ => Pos: (200 to 202) SpanInfo: {"start":170,"length":33} - >(function () { - > return a; - >})() - >:=> (line 12, col 4) to (line 14, col 4) -14 >})()[x]; - ~~~~~ => Pos: (203 to 207) SpanInfo: {"start":166,"length":40} >x = (function () { > return a; @@ -163,14 +120,7 @@ >:=> (line 15, col 0) to (line 17, col 5) 15 >a[(function () { - ~ => Pos: (210 to 210) SpanInfo: {"start":210,"length":33} - >(function () { - > return x; - >})() - >:=> (line 15, col 2) to (line 17, col 4) -15 >a[(function () { - - ~~~~~~~~~~~~~~ => Pos: (211 to 224) SpanInfo: {"start":229,"length":8} + ~~~~~~~~~~~~~~~ => Pos: (210 to 224) SpanInfo: {"start":229,"length":8} >return x >:=> (line 16, col 4) to (line 16, col 12) -------------------------------- @@ -181,15 +131,9 @@ >:=> (line 16, col 4) to (line 16, col 12) -------------------------------- 17 >})()]; - ~ => Pos: (239 to 239) SpanInfo: {"start":239,"length":1} + ~~~~ => Pos: (239 to 242) SpanInfo: {"start":239,"length":1} >} >:=> (line 17, col 0) to (line 17, col 1) -17 >})()]; - ~~~ => Pos: (240 to 242) SpanInfo: {"start":210,"length":33} - >(function () { - > return x; - >})() - >:=> (line 15, col 2) to (line 17, col 4) 17 >})()]; ~~ => Pos: (243 to 244) SpanInfo: {"start":208,"length":36} >a[(function () { diff --git a/tests/baselines/reference/bpSpan_binaryExpressions.baseline b/tests/baselines/reference/bpSpan_binaryExpressions.baseline index 370fec39a25..93f6b97005b 100644 --- a/tests/baselines/reference/bpSpan_binaryExpressions.baseline +++ b/tests/baselines/reference/bpSpan_binaryExpressions.baseline @@ -38,14 +38,7 @@ >:=> (line 6, col 0) to (line 8, col 8) 6 >x = (function foo() { - ~~ => Pos: (55 to 56) SpanInfo: {"start":56,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 6, col 4) to (line 8, col 4) -6 >x = (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (57 to 73) SpanInfo: {"start":78,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (55 to 73) SpanInfo: {"start":78,"length":8} >return y >:=> (line 7, col 4) to (line 7, col 12) -------------------------------- @@ -57,18 +50,11 @@ -------------------------------- 8 >})() + y; - ~ => Pos: (88 to 88) SpanInfo: {"start":88,"length":1} + ~~~~ => Pos: (88 to 91) SpanInfo: {"start":88,"length":1} >} >:=> (line 8, col 0) to (line 8, col 1) 8 >})() + y; - ~~~ => Pos: (89 to 91) SpanInfo: {"start":56,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 6, col 4) to (line 8, col 4) -8 >})() + y; - ~~~~~~ => Pos: (92 to 97) SpanInfo: {"start":52,"length":44} >x = (function foo() { > return y; @@ -84,14 +70,7 @@ >:=> (line 9, col 0) to (line 11, col 9) 9 >x = y + 30 + (function foo() { - ~~ => Pos: (110 to 111) SpanInfo: {"start":111,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 9, col 13) to (line 11, col 4) -9 >x = y + 30 + (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (112 to 128) SpanInfo: {"start":133,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (110 to 128) SpanInfo: {"start":133,"length":8} >return y >:=> (line 10, col 4) to (line 10, col 12) -------------------------------- @@ -102,15 +81,9 @@ >:=> (line 10, col 4) to (line 10, col 12) -------------------------------- 11 >})() * 40; - ~ => Pos: (143 to 143) SpanInfo: {"start":143,"length":1} + ~~~~ => Pos: (143 to 146) SpanInfo: {"start":143,"length":1} >} >:=> (line 11, col 0) to (line 11, col 1) -11 >})() * 40; - ~~~ => Pos: (144 to 146) SpanInfo: {"start":111,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 9, col 13) to (line 11, col 4) 11 >})() * 40; ~~~~~~ => Pos: (147 to 152) SpanInfo: {"start":98,"length":54} >x = y + 30 + (function foo() { diff --git a/tests/baselines/reference/bpSpan_classes.baseline b/tests/baselines/reference/bpSpan_classes.baseline index 811109af835..ecba5c8706a 100644 --- a/tests/baselines/reference/bpSpan_classes.baseline +++ b/tests/baselines/reference/bpSpan_classes.baseline @@ -171,14 +171,9 @@ -------------------------------- 15 > return new Greeter(greeting); - ~~~~~~~~~~~~~~ => Pos: (249 to 262) SpanInfo: {"start":257,"length":28} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (249 to 286) SpanInfo: {"start":257,"length":28} >return new Greeter(greeting) >:=> (line 15, col 8) to (line 15, col 36) -15 > return new Greeter(greeting); - - ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (263 to 286) SpanInfo: {"start":264,"length":21} - >new Greeter(greeting) - >:=> (line 15, col 15) to (line 15, col 36) -------------------------------- 16 > } @@ -192,25 +187,15 @@ -------------------------------- 18 > var greeter = new Greeter("Hello, world!"); - ~~~~~~~~~~~~~~~~~ => Pos: (294 to 310) SpanInfo: {"start":298,"length":42} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (294 to 341) SpanInfo: {"start":298,"length":42} >var greeter = new Greeter("Hello, world!") >:=> (line 18, col 4) to (line 18, col 46) -18 > var greeter = new Greeter("Hello, world!"); - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (311 to 341) SpanInfo: {"start":312,"length":28} - >new Greeter("Hello, world!") - >:=> (line 18, col 18) to (line 18, col 46) -------------------------------- 19 > var str = greeter.greet(); - ~~~~~~~~~~~~~ => Pos: (342 to 354) SpanInfo: {"start":346,"length":25} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (342 to 372) SpanInfo: {"start":346,"length":25} >var str = greeter.greet() >:=> (line 19, col 4) to (line 19, col 29) -19 > var str = greeter.greet(); - - ~~~~~~~~~~~~~~~~~~ => Pos: (355 to 372) SpanInfo: {"start":356,"length":15} - >greeter.greet() - >:=> (line 19, col 14) to (line 19, col 29) -------------------------------- 20 > @@ -240,14 +225,9 @@ -------------------------------- 23 > greeters[0] = new Greeter(greeting); - ~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 545) SpanInfo: {"start":533,"length":35} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (525 to 569) SpanInfo: {"start":533,"length":35} >greeters[0] = new Greeter(greeting) >:=> (line 23, col 8) to (line 23, col 43) -23 > greeters[0] = new Greeter(greeting); - - ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (546 to 569) SpanInfo: {"start":547,"length":21} - >new Greeter(greeting) - >:=> (line 23, col 22) to (line 23, col 43) -------------------------------- 24 > for (var i = 0; i < restGreetings.length; i++) { @@ -267,17 +247,7 @@ -------------------------------- 25 > greeters.push(new Greeter(restGreetings[i])); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (627 to 652) SpanInfo: {"start":639,"length":44} - >greeters.push(new Greeter(restGreetings[i])) - >:=> (line 25, col 12) to (line 25, col 56) -25 > greeters.push(new Greeter(restGreetings[i])); - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (653 to 681) SpanInfo: {"start":653,"length":29} - >new Greeter(restGreetings[i]) - >:=> (line 25, col 26) to (line 25, col 55) -25 > greeters.push(new Greeter(restGreetings[i])); - - ~~~=> Pos: (682 to 684) SpanInfo: {"start":639,"length":44} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (627 to 684) SpanInfo: {"start":639,"length":44} >greeters.push(new Greeter(restGreetings[i])) >:=> (line 25, col 12) to (line 25, col 56) -------------------------------- @@ -309,14 +279,9 @@ -------------------------------- 31 > var b = foo2("Hello", "World", "!"); - ~~~~~~~~~~~ => Pos: (728 to 738) SpanInfo: {"start":732,"length":35} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (728 to 768) SpanInfo: {"start":732,"length":35} >var b = foo2("Hello", "World", "!") >:=> (line 31, col 4) to (line 31, col 39) -31 > var b = foo2("Hello", "World", "!"); - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (739 to 768) SpanInfo: {"start":740,"length":27} - >foo2("Hello", "World", "!") - >:=> (line 31, col 12) to (line 31, col 39) -------------------------------- 32 > // This is simple signle line comment diff --git a/tests/baselines/reference/bpSpan_conditionalExpressions.baseline b/tests/baselines/reference/bpSpan_conditionalExpressions.baseline index 5abd49d50cf..17432ee5439 100644 --- a/tests/baselines/reference/bpSpan_conditionalExpressions.baseline +++ b/tests/baselines/reference/bpSpan_conditionalExpressions.baseline @@ -22,14 +22,7 @@ >:=> (line 3, col 0) to (line 7, col 4) 3 >var z = (function foo() { - ~~ => Pos: (44 to 45) SpanInfo: {"start":45,"length":36} - >(function foo() { - > return x; - >})() - >:=> (line 3, col 8) to (line 5, col 4) -3 >var z = (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (46 to 62) SpanInfo: {"start":67,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (44 to 62) SpanInfo: {"start":67,"length":8} >return x >:=> (line 4, col 4) to (line 4, col 12) -------------------------------- @@ -41,18 +34,11 @@ -------------------------------- 5 >})() ? y : function bar() { - ~ => Pos: (77 to 77) SpanInfo: {"start":77,"length":1} + ~~~~ => Pos: (77 to 80) SpanInfo: {"start":77,"length":1} >} >:=> (line 5, col 0) to (line 5, col 1) 5 >})() ? y : function bar() { - ~~~ => Pos: (78 to 80) SpanInfo: {"start":45,"length":36} - >(function foo() { - > return x; - >})() - >:=> (line 3, col 8) to (line 5, col 4) -5 >})() ? y : function bar() { - ~~~~~~ => Pos: (81 to 86) SpanInfo: {"start":37,"length":90} >var z = (function foo() { > return x; @@ -74,16 +60,9 @@ -------------------------------- 7 >} (); - ~ => Pos: (123 to 123) SpanInfo: {"start":123,"length":1} + ~~~~~~ => Pos: (123 to 128) SpanInfo: {"start":123,"length":1} >} >:=> (line 7, col 0) to (line 7, col 1) -7 >} (); - - ~~~~~ => Pos: (124 to 128) SpanInfo: {"start":88,"length":39} - >function bar() { - > return x; - >} () - >:=> (line 5, col 11) to (line 7, col 4) -------------------------------- 8 >x = y ? (function () { @@ -94,14 +73,7 @@ >:=> (line 8, col 0) to (line 10, col 10) 8 >x = y ? (function () { - ~~ => Pos: (136 to 137) SpanInfo: {"start":137,"length":33} - >(function () { - > return z; - >})() - >:=> (line 8, col 8) to (line 10, col 4) -8 >x = y ? (function () { - - ~~~~~~~~~~~~~~ => Pos: (138 to 151) SpanInfo: {"start":156,"length":8} + ~~~~~~~~~~~~~~~~ => Pos: (136 to 151) SpanInfo: {"start":156,"length":8} >return z >:=> (line 9, col 4) to (line 9, col 12) -------------------------------- @@ -112,15 +84,9 @@ >:=> (line 9, col 4) to (line 9, col 12) -------------------------------- 10 >})() : 10; - ~ => Pos: (166 to 166) SpanInfo: {"start":166,"length":1} + ~~~~ => Pos: (166 to 169) SpanInfo: {"start":166,"length":1} >} >:=> (line 10, col 0) to (line 10, col 1) -10 >})() : 10; - ~~~ => Pos: (167 to 169) SpanInfo: {"start":137,"length":33} - >(function () { - > return z; - >})() - >:=> (line 8, col 8) to (line 10, col 4) 10 >})() : 10; ~~~~~~~ => Pos: (170 to 176) SpanInfo: {"start":129,"length":47} >x = y ? (function () { diff --git a/tests/baselines/reference/bpSpan_do.baseline b/tests/baselines/reference/bpSpan_do.baseline index 3ff287c2046..602ec5b16c7 100644 --- a/tests/baselines/reference/bpSpan_do.baseline +++ b/tests/baselines/reference/bpSpan_do.baseline @@ -107,14 +107,7 @@ >:=> (line 15, col 2) to (line 17, col 15) 15 >} while ((function () { - ~ => Pos: (131 to 131) SpanInfo: {"start":131,"length":46} - >(function () { - > return 30 * i; - > })() - >:=> (line 15, col 9) to (line 17, col 8) -15 >} while ((function () { - - ~~~~~~~~~~~~~~ => Pos: (132 to 145) SpanInfo: {"start":154,"length":13} + ~~~~~~~~~~~~~~~ => Pos: (131 to 145) SpanInfo: {"start":154,"length":13} >return 30 * i >:=> (line 16, col 8) to (line 16, col 21) -------------------------------- @@ -125,15 +118,9 @@ >:=> (line 16, col 8) to (line 16, col 21) -------------------------------- 17 > })() !== i); - ~~~~~ => Pos: (169 to 173) SpanInfo: {"start":173,"length":1} + ~~~~~~~~ => Pos: (169 to 176) SpanInfo: {"start":173,"length":1} >} >:=> (line 17, col 4) to (line 17, col 5) -17 > })() !== i); - ~~~ => Pos: (174 to 176) SpanInfo: {"start":131,"length":46} - >(function () { - > return 30 * i; - > })() - >:=> (line 15, col 9) to (line 17, col 8) 17 > })() !== i); ~~~~~~~~~ => Pos: (177 to 185) SpanInfo: {"start":124,"length":60} >while ((function () { diff --git a/tests/baselines/reference/bpSpan_for.baseline b/tests/baselines/reference/bpSpan_for.baseline index 7fd6ba4c858..46214f6e3b1 100644 --- a/tests/baselines/reference/bpSpan_for.baseline +++ b/tests/baselines/reference/bpSpan_for.baseline @@ -220,12 +220,7 @@ -------------------------------- 32 >for (i = 0, j = 20; j < 20, i < 20; j++) { - ~~~~~ => Pos: (351 to 355) SpanInfo: {"start":356,"length":13} - >i = 0, j = 20 - >:=> (line 32, col 5) to (line 32, col 18) -32 >for (i = 0, j = 20; j < 20, i < 20; j++) { - - ~~~~~~ => Pos: (356 to 361) SpanInfo: {"start":356,"length":5} + ~~~~~~~~~~~ => Pos: (351 to 361) SpanInfo: {"start":356,"length":5} >i = 0 >:=> (line 32, col 5) to (line 32, col 10) 32 >for (i = 0, j = 20; j < 20, i < 20; j++) { diff --git a/tests/baselines/reference/bpSpan_forIn.baseline b/tests/baselines/reference/bpSpan_forIn.baseline index c2b72df5b12..1c46a83e3b4 100644 --- a/tests/baselines/reference/bpSpan_forIn.baseline +++ b/tests/baselines/reference/bpSpan_forIn.baseline @@ -104,14 +104,9 @@ -------------------------------- 17 > return new String(); - ~~~~~~~~~~ => Pos: (221 to 230) SpanInfo: {"start":225,"length":19} + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (221 to 245) SpanInfo: {"start":225,"length":19} >return new String() >:=> (line 17, col 4) to (line 17, col 23) -17 > return new String(); - - ~~~~~~~~~~~~~~~ => Pos: (231 to 245) SpanInfo: {"start":232,"length":12} - >new String() - >:=> (line 17, col 11) to (line 17, col 23) -------------------------------- 18 >}) { diff --git a/tests/baselines/reference/bpSpan_functionExpressions.baseline b/tests/baselines/reference/bpSpan_functionExpressions.baseline index 135edff9418..f75bde15f07 100644 --- a/tests/baselines/reference/bpSpan_functionExpressions.baseline +++ b/tests/baselines/reference/bpSpan_functionExpressions.baseline @@ -80,14 +80,9 @@ -------------------------------- 10 > return greet(msg); - ~~~~~~~~~~ => Pos: (235 to 244) SpanInfo: {"start":239,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (235 to 257) SpanInfo: {"start":239,"length":17} >return greet(msg) >:=> (line 10, col 4) to (line 10, col 21) -10 > return greet(msg); - - ~~~~~~~~~~~~~ => Pos: (245 to 257) SpanInfo: {"start":246,"length":10} - >greet(msg) - >:=> (line 10, col 11) to (line 10, col 21) -------------------------------- 11 >}; @@ -132,17 +127,7 @@ -------------------------------- 15 > if (!a()) { - ~~~~~~~~~ => Pos: (322 to 330) SpanInfo: {"start":326,"length":9} - >if (!a()) - >:=> (line 15, col 4) to (line 15, col 13) -15 > if (!a()) { - - ~~~ => Pos: (331 to 333) SpanInfo: {"start":331,"length":3} - >a() - >:=> (line 15, col 9) to (line 15, col 12) -15 > if (!a()) { - - ~~~~ => Pos: (334 to 337) SpanInfo: {"start":326,"length":9} + ~~~~~~~~~~~~~~~~ => Pos: (322 to 337) SpanInfo: {"start":326,"length":9} >if (!a()) >:=> (line 15, col 4) to (line 15, col 13) -------------------------------- diff --git a/tests/baselines/reference/bpSpan_ifElse.baseline b/tests/baselines/reference/bpSpan_ifElse.baseline index b66316d3392..fc9e5f6758a 100644 --- a/tests/baselines/reference/bpSpan_ifElse.baseline +++ b/tests/baselines/reference/bpSpan_ifElse.baseline @@ -131,18 +131,11 @@ -------------------------------- 20 >} ()) { - ~ => Pos: (193 to 193) SpanInfo: {"start":193,"length":1} + ~~~~ => Pos: (193 to 196) SpanInfo: {"start":193,"length":1} >} >:=> (line 20, col 0) to (line 20, col 1) 20 >} ()) { - ~~~ => Pos: (194 to 196) SpanInfo: {"start":161,"length":36} - >function foo() { - > return 30; - >} () - >:=> (line 18, col 4) to (line 20, col 4) -20 >} ()) { - ~ => Pos: (197 to 197) SpanInfo: {"start":157,"length":41} >if (function foo() { > return 30; diff --git a/tests/baselines/reference/bpSpan_import.baseline b/tests/baselines/reference/bpSpan_import.baseline index 26279b48f26..af0f959c57c 100644 --- a/tests/baselines/reference/bpSpan_import.baseline +++ b/tests/baselines/reference/bpSpan_import.baseline @@ -41,20 +41,11 @@ -------------------------------- 7 >var x = new a(); - ~~~~~~~ => Pos: (72 to 78) SpanInfo: {"start":72,"length":15} + ~~~~~~~~~~~~~~~~~ => Pos: (72 to 88) SpanInfo: {"start":72,"length":15} >var x = new a() >:=> (line 7, col 0) to (line 7, col 15) -7 >var x = new a(); - - ~~~~~~~~~~ => Pos: (79 to 88) SpanInfo: {"start":80,"length":7} - >new a() - >:=> (line 7, col 8) to (line 7, col 15) -------------------------------- 8 >var y = new b(); - ~~~~~~~ => Pos: (89 to 95) SpanInfo: {"start":89,"length":15} + ~~~~~~~~~~~~~~~~ => Pos: (89 to 104) SpanInfo: {"start":89,"length":15} >var y = new b() - >:=> (line 8, col 0) to (line 8, col 15) -8 >var y = new b(); - ~~~~~~~~~ => Pos: (96 to 104) SpanInfo: {"start":97,"length":7} - >new b() - >:=> (line 8, col 8) to (line 8, col 15) \ No newline at end of file + >:=> (line 8, col 0) to (line 8, col 15) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline b/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline index 47c932640f9..bcc2326c1f3 100644 --- a/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline +++ b/tests/baselines/reference/bpSpan_parenCallOrNewExpressions.baseline @@ -26,105 +26,46 @@ >:=> (line 4, col 0) to (line 6, col 5) 4 >foo((function bar() { - ~ => Pos: (46 to 46) SpanInfo: {"start":46,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 4, col 4) to (line 6, col 4) -4 >foo((function bar() { - - ~~~~~~~~~~~~~~~~~ => Pos: (47 to 63) SpanInfo: {"start":68,"length":14} + ~~~~~~~~~~~~~~~~~~ => Pos: (46 to 63) SpanInfo: {"start":68,"length":14} >return foo(40) >:=> (line 5, col 4) to (line 5, col 18) -------------------------------- 5 > return foo(40); - ~~~~~~~~~~ => Pos: (64 to 73) SpanInfo: {"start":68,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (64 to 83) SpanInfo: {"start":68,"length":14} >return foo(40) >:=> (line 5, col 4) to (line 5, col 18) -5 > return foo(40); - - ~~~~~~~~~~ => Pos: (74 to 83) SpanInfo: {"start":75,"length":7} - >foo(40) - >:=> (line 5, col 11) to (line 5, col 18) -------------------------------- 6 >})()); - ~ => Pos: (84 to 84) SpanInfo: {"start":84,"length":1} + ~~~~~~~ => Pos: (84 to 90) SpanInfo: {"start":84,"length":1} >} >:=> (line 6, col 0) to (line 6, col 1) -6 >})()); - - ~~~ => Pos: (85 to 87) SpanInfo: {"start":46,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 4, col 4) to (line 6, col 4) -6 >})()); - - ~~~ => Pos: (88 to 90) SpanInfo: {"start":42,"length":47} - >foo((function bar() { - > return foo(40); - >})()) - >:=> (line 4, col 0) to (line 6, col 5) -------------------------------- 7 >var y = foo((function () { - ~~~~~~~ => Pos: (91 to 97) SpanInfo: {"start":91,"length":52} + ~~~~~~~~~~~~ => Pos: (91 to 102) SpanInfo: {"start":91,"length":52} >var y = foo((function () { > return foo(40); >})()) >:=> (line 7, col 0) to (line 9, col 5) 7 >var y = foo((function () { - ~~~~~ => Pos: (98 to 102) SpanInfo: {"start":99,"length":44} - >foo((function () { - > return foo(40); - >})()) - >:=> (line 7, col 8) to (line 9, col 5) -7 >var y = foo((function () { - - ~ => Pos: (103 to 103) SpanInfo: {"start":103,"length":39} - >(function () { - > return foo(40); - >})() - >:=> (line 7, col 12) to (line 9, col 4) -7 >var y = foo((function () { - - ~~~~~~~~~~~~~~ => Pos: (104 to 117) SpanInfo: {"start":122,"length":14} + ~~~~~~~~~~~~~~~ => Pos: (103 to 117) SpanInfo: {"start":122,"length":14} >return foo(40) >:=> (line 8, col 4) to (line 8, col 18) -------------------------------- 8 > return foo(40); - ~~~~~~~~~~ => Pos: (118 to 127) SpanInfo: {"start":122,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (118 to 137) SpanInfo: {"start":122,"length":14} >return foo(40) >:=> (line 8, col 4) to (line 8, col 18) -8 > return foo(40); - - ~~~~~~~~~~ => Pos: (128 to 137) SpanInfo: {"start":129,"length":7} - >foo(40) - >:=> (line 8, col 11) to (line 8, col 18) -------------------------------- 9 >})());; - ~ => Pos: (138 to 138) SpanInfo: {"start":138,"length":1} + ~~~~~~~~ => Pos: (138 to 145) SpanInfo: {"start":138,"length":1} >} >:=> (line 9, col 0) to (line 9, col 1) -9 >})());; - - ~~~ => Pos: (139 to 141) SpanInfo: {"start":103,"length":39} - >(function () { - > return foo(40); - >})() - >:=> (line 7, col 12) to (line 9, col 4) -9 >})());; - - ~~~~ => Pos: (142 to 145) SpanInfo: {"start":99,"length":44} - >foo((function () { - > return foo(40); - >})()) - >:=> (line 7, col 8) to (line 9, col 5) -------------------------------- 10 >class greeter { @@ -167,25 +108,15 @@ -------------------------------- 16 >y = foo(30); - ~~~ => Pos: (221 to 223) SpanInfo: {"start":221,"length":11} + ~~~~~~~~~~~~~ => Pos: (221 to 233) SpanInfo: {"start":221,"length":11} >y = foo(30) >:=> (line 16, col 0) to (line 16, col 11) -16 >y = foo(30); - - ~~~~~~~~~~ => Pos: (224 to 233) SpanInfo: {"start":225,"length":7} - >foo(30) - >:=> (line 16, col 4) to (line 16, col 11) -------------------------------- 17 >y = foo(500 + y); - ~~~ => Pos: (234 to 236) SpanInfo: {"start":234,"length":16} + ~~~~~~~~~~~~~~~~~~ => Pos: (234 to 251) SpanInfo: {"start":234,"length":16} >y = foo(500 + y) >:=> (line 17, col 0) to (line 17, col 16) -17 >y = foo(500 + y); - - ~~~~~~~~~~~~~~~ => Pos: (237 to 251) SpanInfo: {"start":238,"length":12} - >foo(500 + y) - >:=> (line 17, col 4) to (line 17, col 16) -------------------------------- 18 >new greeter((function bar() { @@ -196,127 +127,58 @@ >:=> (line 18, col 0) to (line 20, col 5) 18 >new greeter((function bar() { - ~ => Pos: (264 to 264) SpanInfo: {"start":264,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 18, col 12) to (line 20, col 4) -18 >new greeter((function bar() { - - ~~~~~~~~~~~~~~~~~ => Pos: (265 to 281) SpanInfo: {"start":286,"length":14} + ~~~~~~~~~~~~~~~~~~ => Pos: (264 to 281) SpanInfo: {"start":286,"length":14} >return foo(40) >:=> (line 19, col 4) to (line 19, col 18) -------------------------------- 19 > return foo(40); - ~~~~~~~~~~ => Pos: (282 to 291) SpanInfo: {"start":286,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (282 to 301) SpanInfo: {"start":286,"length":14} >return foo(40) >:=> (line 19, col 4) to (line 19, col 18) -19 > return foo(40); - - ~~~~~~~~~~ => Pos: (292 to 301) SpanInfo: {"start":293,"length":7} - >foo(40) - >:=> (line 19, col 11) to (line 19, col 18) -------------------------------- 20 >})()); - ~ => Pos: (302 to 302) SpanInfo: {"start":302,"length":1} + ~~~~~~~ => Pos: (302 to 308) SpanInfo: {"start":302,"length":1} >} >:=> (line 20, col 0) to (line 20, col 1) -20 >})()); - - ~~~ => Pos: (303 to 305) SpanInfo: {"start":264,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 18, col 12) to (line 20, col 4) -20 >})()); - - ~~~ => Pos: (306 to 308) SpanInfo: {"start":252,"length":55} - >new greeter((function bar() { - > return foo(40); - >})()) - >:=> (line 18, col 0) to (line 20, col 5) -------------------------------- 21 >var anotherGreeter = new greeter((function bar() { - ~~~~~~~~~~~~~~~~~~~~ => Pos: (309 to 328) SpanInfo: {"start":309,"length":76} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (309 to 341) SpanInfo: {"start":309,"length":76} >var anotherGreeter = new greeter((function bar() { > return foo(40); >})()) >:=> (line 21, col 0) to (line 23, col 5) 21 >var anotherGreeter = new greeter((function bar() { - ~~~~~~~~~~~~~ => Pos: (329 to 341) SpanInfo: {"start":330,"length":55} - >new greeter((function bar() { - > return foo(40); - >})()) - >:=> (line 21, col 21) to (line 23, col 5) -21 >var anotherGreeter = new greeter((function bar() { - - ~ => Pos: (342 to 342) SpanInfo: {"start":342,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 21, col 33) to (line 23, col 4) -21 >var anotherGreeter = new greeter((function bar() { - - ~~~~~~~~~~~~~~~~~=> Pos: (343 to 359) SpanInfo: {"start":364,"length":14} + ~~~~~~~~~~~~~~~~~~=> Pos: (342 to 359) SpanInfo: {"start":364,"length":14} >return foo(40) >:=> (line 22, col 4) to (line 22, col 18) -------------------------------- 22 > return foo(40); - ~~~~~~~~~~ => Pos: (360 to 369) SpanInfo: {"start":364,"length":14} + ~~~~~~~~~~~~~~~~~~~~ => Pos: (360 to 379) SpanInfo: {"start":364,"length":14} >return foo(40) >:=> (line 22, col 4) to (line 22, col 18) -22 > return foo(40); - - ~~~~~~~~~~ => Pos: (370 to 379) SpanInfo: {"start":371,"length":7} - >foo(40) - >:=> (line 22, col 11) to (line 22, col 18) -------------------------------- 23 >})()); - ~ => Pos: (380 to 380) SpanInfo: {"start":380,"length":1} + ~~~~~~~ => Pos: (380 to 386) SpanInfo: {"start":380,"length":1} >} >:=> (line 23, col 0) to (line 23, col 1) -23 >})()); - - ~~~ => Pos: (381 to 383) SpanInfo: {"start":342,"length":42} - >(function bar() { - > return foo(40); - >})() - >:=> (line 21, col 33) to (line 23, col 4) -23 >})()); - - ~~~ => Pos: (384 to 386) SpanInfo: {"start":330,"length":55} - >new greeter((function bar() { - > return foo(40); - >})()) - >:=> (line 21, col 21) to (line 23, col 5) -------------------------------- 24 >anotherGreeter = new greeter(30); - ~~~~~~~~~~~~~~~~ => Pos: (387 to 402) SpanInfo: {"start":387,"length":32} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (387 to 420) SpanInfo: {"start":387,"length":32} >anotherGreeter = new greeter(30) >:=> (line 24, col 0) to (line 24, col 32) -24 >anotherGreeter = new greeter(30); - - ~~~~~~~~~~~~~~~~~~ => Pos: (403 to 420) SpanInfo: {"start":404,"length":15} - >new greeter(30) - >:=> (line 24, col 17) to (line 24, col 32) -------------------------------- 25 >anotherGreeter = new greeter(40 + y); - ~~~~~~~~~~~~~~~~ => Pos: (421 to 436) SpanInfo: {"start":421,"length":36} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (421 to 458) SpanInfo: {"start":421,"length":36} >anotherGreeter = new greeter(40 + y) >:=> (line 25, col 0) to (line 25, col 36) -25 >anotherGreeter = new greeter(40 + y); - - ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (437 to 458) SpanInfo: {"start":438,"length":19} - >new greeter(40 + y) - >:=> (line 25, col 17) to (line 25, col 36) -------------------------------- 26 >new greeter(30); @@ -343,22 +205,6 @@ >:=> (line 29, col 0) to (line 29, col 1) -------------------------------- 30 >foo2(foo(30), foo(40).toString()); - ~~~~~ => Pos: (537 to 541) SpanInfo: {"start":537,"length":33} - >foo2(foo(30), foo(40).toString()) - >:=> (line 30, col 0) to (line 30, col 33) -30 >foo2(foo(30), foo(40).toString()); - ~~~~~~~~ => Pos: (542 to 549) SpanInfo: {"start":542,"length":7} - >foo(30) - >:=> (line 30, col 5) to (line 30, col 12) -30 >foo2(foo(30), foo(40).toString()); - ~~~~~~~~ => Pos: (550 to 557) SpanInfo: {"start":551,"length":7} - >foo(40) - >:=> (line 30, col 14) to (line 30, col 21) -30 >foo2(foo(30), foo(40).toString()); - ~~~~~~~~~~~ => Pos: (558 to 568) SpanInfo: {"start":551,"length":18} - >foo(40).toString() - >:=> (line 30, col 14) to (line 30, col 32) -30 >foo2(foo(30), foo(40).toString()); - ~~ => Pos: (569 to 570) SpanInfo: {"start":537,"length":33} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (537 to 570) SpanInfo: {"start":537,"length":33} >foo2(foo(30), foo(40).toString()) >:=> (line 30, col 0) to (line 30, col 33) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_stmts.baseline b/tests/baselines/reference/bpSpan_stmts.baseline index 7f6bf21b40b..b818c9c9e30 100644 --- a/tests/baselines/reference/bpSpan_stmts.baseline +++ b/tests/baselines/reference/bpSpan_stmts.baseline @@ -278,14 +278,9 @@ -------------------------------- 37 > throw new Error(); - ~~~~~~~~~~~~~ => Pos: (549 to 561) SpanInfo: {"start":557,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (549 to 575) SpanInfo: {"start":557,"length":17} >throw new Error() >:=> (line 37, col 8) to (line 37, col 25) -37 > throw new Error(); - - ~~~~~~~~~~~~~~ => Pos: (562 to 575) SpanInfo: {"start":563,"length":11} - >new Error() - >:=> (line 37, col 14) to (line 37, col 25) -------------------------------- 38 > } catch (e1) { diff --git a/tests/baselines/reference/bpSpan_switch.baseline b/tests/baselines/reference/bpSpan_switch.baseline index c0e2259784d..7fde6067ed0 100644 --- a/tests/baselines/reference/bpSpan_switch.baseline +++ b/tests/baselines/reference/bpSpan_switch.baseline @@ -176,14 +176,7 @@ >:=> (line 29, col 0) to (line 31, col 5) 29 >switch ((function foo() { - ~ => Pos: (357 to 357) SpanInfo: {"start":357,"length":41} - >(function foo() { - > return x * 30; - >})() - >:=> (line 29, col 8) to (line 31, col 4) -29 >switch ((function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (358 to 374) SpanInfo: {"start":379,"length":13} + ~~~~~~~~~~~~~~~~~~ => Pos: (357 to 374) SpanInfo: {"start":379,"length":13} >return x * 30 >:=> (line 30, col 4) to (line 30, col 17) -------------------------------- @@ -195,18 +188,11 @@ -------------------------------- 31 >})()) { - ~ => Pos: (394 to 394) SpanInfo: {"start":394,"length":1} + ~~~~ => Pos: (394 to 397) SpanInfo: {"start":394,"length":1} >} >:=> (line 31, col 0) to (line 31, col 1) 31 >})()) { - ~~~ => Pos: (395 to 397) SpanInfo: {"start":357,"length":41} - >(function foo() { - > return x * 30; - >})() - >:=> (line 29, col 8) to (line 31, col 4) -31 >})()) { - ~ => Pos: (398 to 398) SpanInfo: {"start":349,"length":50} >switch ((function foo() { > return x * 30; @@ -225,14 +211,7 @@ >:=> (line 35, col 8) to (line 35, col 11) 32 > case (function bar() { - ~~ => Pos: (410 to 411) SpanInfo: {"start":411,"length":45} - >(function bar() { - > return 30; - > })() - >:=> (line 32, col 9) to (line 34, col 8) -32 > case (function bar() { - - ~~~~~~~~~~~~~~~~~ => Pos: (412 to 428) SpanInfo: {"start":437,"length":9} + ~~~~~~~~~~~~~~~~~~~ => Pos: (410 to 428) SpanInfo: {"start":437,"length":9} >return 30 >:=> (line 33, col 8) to (line 33, col 17) -------------------------------- @@ -244,18 +223,11 @@ -------------------------------- 34 > })(): - ~~~~~ => Pos: (448 to 452) SpanInfo: {"start":452,"length":1} + ~~~~~~~~ => Pos: (448 to 455) SpanInfo: {"start":452,"length":1} >} >:=> (line 34, col 4) to (line 34, col 5) 34 > })(): - ~~~ => Pos: (453 to 455) SpanInfo: {"start":411,"length":45} - >(function bar() { - > return 30; - > })() - >:=> (line 32, col 9) to (line 34, col 8) -34 > })(): - ~~ => Pos: (456 to 457) SpanInfo: {"start":466,"length":3} >x++ >:=> (line 35, col 8) to (line 35, col 11) diff --git a/tests/baselines/reference/bpSpan_tryCatchFinally.baseline b/tests/baselines/reference/bpSpan_tryCatchFinally.baseline index e5465b8812c..c35683b6e53 100644 --- a/tests/baselines/reference/bpSpan_tryCatchFinally.baseline +++ b/tests/baselines/reference/bpSpan_tryCatchFinally.baseline @@ -85,14 +85,9 @@ -------------------------------- 12 > throw new Error(); - ~~~~~~~~~ => Pos: (113 to 121) SpanInfo: {"start":117,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (113 to 135) SpanInfo: {"start":117,"length":17} >throw new Error() >:=> (line 12, col 4) to (line 12, col 21) -12 > throw new Error(); - - ~~~~~~~~~~~~~~ => Pos: (122 to 135) SpanInfo: {"start":123,"length":11} - >new Error() - >:=> (line 12, col 10) to (line 12, col 21) -------------------------------- 13 >} @@ -173,45 +168,21 @@ >:=> (line 23, col 4) to (line 25, col 8) 23 > throw (function foo() { - ~~ => Pos: (210 to 211) SpanInfo: {"start":211,"length":59} - >(function foo() { - > new Error(x.toString()); - > })() - >:=> (line 23, col 10) to (line 25, col 8) -23 > throw (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (212 to 228) SpanInfo: {"start":237,"length":23} + ~~~~~~~~~~~~~~~~~~~ => Pos: (210 to 228) SpanInfo: {"start":237,"length":23} >new Error(x.toString()) >:=> (line 24, col 8) to (line 24, col 31) -------------------------------- 24 > new Error(x.toString()); - ~~~~~~~~~~~~~~~~~~ => Pos: (229 to 246) SpanInfo: {"start":237,"length":23} - >new Error(x.toString()) - >:=> (line 24, col 8) to (line 24, col 31) -24 > new Error(x.toString()); - - ~~~~~~~~~~~~ => Pos: (247 to 258) SpanInfo: {"start":247,"length":12} - >x.toString() - >:=> (line 24, col 18) to (line 24, col 30) -24 > new Error(x.toString()); - - ~~~ => Pos: (259 to 261) SpanInfo: {"start":237,"length":23} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (229 to 261) SpanInfo: {"start":237,"length":23} >new Error(x.toString()) >:=> (line 24, col 8) to (line 24, col 31) -------------------------------- 25 > })(); - ~~~~~ => Pos: (262 to 266) SpanInfo: {"start":266,"length":1} + ~~~~~~~~~~ => Pos: (262 to 271) SpanInfo: {"start":266,"length":1} >} >:=> (line 25, col 4) to (line 25, col 5) -25 > })(); - - ~~~~~ => Pos: (267 to 271) SpanInfo: {"start":211,"length":59} - >(function foo() { - > new Error(x.toString()); - > })() - >:=> (line 23, col 10) to (line 25, col 8) -------------------------------- 26 >} diff --git a/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline b/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline index c04ddb8503b..9a15f782081 100644 --- a/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline +++ b/tests/baselines/reference/bpSpan_typeAssertionExpressions.baseline @@ -14,28 +14,13 @@ -------------------------------- 3 >var a = new Greeter(); - ~~~~~~~ => Pos: (18 to 24) SpanInfo: {"start":18,"length":30} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (18 to 49) SpanInfo: {"start":18,"length":30} >var a = new Greeter() >:=> (line 3, col 0) to (line 3, col 30) -3 >var a = new Greeter(); - - ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (25 to 49) SpanInfo: {"start":35,"length":13} - >new Greeter() - >:=> (line 3, col 17) to (line 3, col 30) -------------------------------- 4 >a = ( new Greeter()); - ~~~~~ => Pos: (50 to 54) SpanInfo: {"start":50,"length":29} - >a = ( new Greeter()) - >:=> (line 4, col 0) to (line 4, col 29) -4 >a = ( new Greeter()); - - ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (55 to 77) SpanInfo: {"start":65,"length":13} - >new Greeter() - >:=> (line 4, col 15) to (line 4, col 28) -4 >a = ( new Greeter()); - - ~~~ => Pos: (78 to 80) SpanInfo: {"start":50,"length":29} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (50 to 80) SpanInfo: {"start":50,"length":29} >a = ( new Greeter()) >:=> (line 4, col 0) to (line 4, col 29) -------------------------------- @@ -48,35 +33,17 @@ >:=> (line 5, col 0) to (line 7, col 4) 5 >a = (function foo() { - ~~~~~~~~~~~ => Pos: (84 to 94) SpanInfo: {"start":94,"length":48} - >(function foo() { - > return new Greeter(); - >})() - >:=> (line 5, col 13) to (line 7, col 4) -5 >a = (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (95 to 111) SpanInfo: {"start":116,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (84 to 111) SpanInfo: {"start":116,"length":20} >return new Greeter() >:=> (line 6, col 4) to (line 6, col 24) -------------------------------- 6 > return new Greeter(); - ~~~~~~~~~~ => Pos: (112 to 121) SpanInfo: {"start":116,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (112 to 137) SpanInfo: {"start":116,"length":20} >return new Greeter() >:=> (line 6, col 4) to (line 6, col 24) -6 > return new Greeter(); - - ~~~~~~~~~~~~~~~~ => Pos: (122 to 137) SpanInfo: {"start":123,"length":13} - >new Greeter() - >:=> (line 6, col 11) to (line 6, col 24) -------------------------------- 7 >})(); - ~ => Pos: (138 to 138) SpanInfo: {"start":138,"length":1} + ~~~~~ => Pos: (138 to 142) SpanInfo: {"start":138,"length":1} >} - >:=> (line 7, col 0) to (line 7, col 1) -7 >})(); - ~~~~ => Pos: (139 to 142) SpanInfo: {"start":94,"length":48} - >(function foo() { - > return new Greeter(); - >})() - >:=> (line 5, col 13) to (line 7, col 4) \ No newline at end of file + >:=> (line 7, col 0) to (line 7, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_typealias.baseline b/tests/baselines/reference/bpSpan_typealias.baseline index 88e60b55e47..80e654ad2f3 100644 --- a/tests/baselines/reference/bpSpan_typealias.baseline +++ b/tests/baselines/reference/bpSpan_typealias.baseline @@ -52,25 +52,15 @@ -------------------------------- 8 > var x: a = new m.c(); - ~~~~~~~~~~~~~~ => Pos: (111 to 124) SpanInfo: {"start":115,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (111 to 136) SpanInfo: {"start":115,"length":20} >var x: a = new m.c() >:=> (line 8, col 4) to (line 8, col 24) -8 > var x: a = new m.c(); - - ~~~~~~~~~~~~ => Pos: (125 to 136) SpanInfo: {"start":126,"length":9} - >new m.c() - >:=> (line 8, col 15) to (line 8, col 24) -------------------------------- 9 > var y: b = new m.c(); - ~~~~~~~~~~~~~~ => Pos: (137 to 150) SpanInfo: {"start":141,"length":20} + ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (137 to 162) SpanInfo: {"start":141,"length":20} >var y: b = new m.c() >:=> (line 9, col 4) to (line 9, col 24) -9 > var y: b = new m.c(); - - ~~~~~~~~~~~~ => Pos: (151 to 162) SpanInfo: {"start":152,"length":9} - >new m.c() - >:=> (line 9, col 15) to (line 9, col 24) -------------------------------- 10 >} ~ => Pos: (163 to 163) SpanInfo: {"start":163,"length":1} diff --git a/tests/baselines/reference/bpSpan_unaryExpressions.baseline b/tests/baselines/reference/bpSpan_unaryExpressions.baseline index 2ad1191cf95..e0433bf5fad 100644 --- a/tests/baselines/reference/bpSpan_unaryExpressions.baseline +++ b/tests/baselines/reference/bpSpan_unaryExpressions.baseline @@ -32,14 +32,7 @@ >:=> (line 5, col 0) to (line 7, col 4) 5 >typeof (function foo() { - ~~ => Pos: (40 to 41) SpanInfo: {"start":41,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 5, col 7) to (line 7, col 4) -5 >typeof (function foo() { - - ~~~~~~~~~~~~~~~~~ => Pos: (42 to 58) SpanInfo: {"start":63,"length":8} + ~~~~~~~~~~~~~~~~~~~ => Pos: (40 to 58) SpanInfo: {"start":63,"length":8} >return y >:=> (line 6, col 4) to (line 6, col 12) -------------------------------- @@ -51,16 +44,9 @@ -------------------------------- 7 >})(); - ~ => Pos: (73 to 73) SpanInfo: {"start":73,"length":1} + ~~~~~~ => Pos: (73 to 78) SpanInfo: {"start":73,"length":1} >} >:=> (line 7, col 0) to (line 7, col 1) -7 >})(); - - ~~~~~ => Pos: (74 to 78) SpanInfo: {"start":41,"length":36} - >(function foo() { - > return y; - >})() - >:=> (line 5, col 7) to (line 7, col 4) -------------------------------- 8 >++x; diff --git a/tests/baselines/reference/bpSpan_while.baseline b/tests/baselines/reference/bpSpan_while.baseline index 91632b78009..464a736447a 100644 --- a/tests/baselines/reference/bpSpan_while.baseline +++ b/tests/baselines/reference/bpSpan_while.baseline @@ -79,14 +79,7 @@ >:=> (line 12, col 0) to (line 14, col 11) 12 >while ((function () { - ~ => Pos: (126 to 126) SpanInfo: {"start":126,"length":38} - >(function () { - > return 30 * a; - >})() - >:=> (line 12, col 7) to (line 14, col 4) -12 >while ((function () { - - ~~~~~~~~~~~~~~ => Pos: (127 to 140) SpanInfo: {"start":145,"length":13} + ~~~~~~~~~~~~~~~ => Pos: (126 to 140) SpanInfo: {"start":145,"length":13} >return 30 * a >:=> (line 13, col 4) to (line 13, col 17) -------------------------------- @@ -98,18 +91,11 @@ -------------------------------- 14 >})() !== a) { - ~ => Pos: (160 to 160) SpanInfo: {"start":160,"length":1} + ~~~~ => Pos: (160 to 163) SpanInfo: {"start":160,"length":1} >} >:=> (line 14, col 0) to (line 14, col 1) 14 >})() !== a) { - ~~~ => Pos: (161 to 163) SpanInfo: {"start":126,"length":38} - >(function () { - > return 30 * a; - >})() - >:=> (line 12, col 7) to (line 14, col 4) -14 >})() !== a) { - ~~~~~~~ => Pos: (164 to 170) SpanInfo: {"start":119,"length":52} >while ((function () { > return 30 * a; diff --git a/tests/baselines/reference/capturedLetConstInLoop11.js b/tests/baselines/reference/capturedLetConstInLoop11.js new file mode 100644 index 00000000000..fa295739d02 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop11.js @@ -0,0 +1,35 @@ +//// [capturedLetConstInLoop11.ts] +for (;;) { + let x = 1; + () => x; +} + +function foo() { + for (;;) { + const a = 0; + switch(a) { + case 0: return () => a; + } + } +} + +//// [capturedLetConstInLoop11.js] +var _loop_1 = function() { + var x = 1; + (function () { return x; }); +}; +for (;;) { + _loop_1(); +} +function foo() { + var _loop_2 = function() { + var a = 0; + switch (a) { + case 0: return { value: function () { return a; } }; + } + }; + for (;;) { + var state_2 = _loop_2(); + if (typeof state_2 === "object") return state_2.value + } +} diff --git a/tests/baselines/reference/capturedLetConstInLoop11.symbols b/tests/baselines/reference/capturedLetConstInLoop11.symbols new file mode 100644 index 00000000000..2e242906b73 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop11.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/capturedLetConstInLoop11.ts === +for (;;) { + let x = 1; +>x : Symbol(x, Decl(capturedLetConstInLoop11.ts, 1, 7)) + + () => x; +>x : Symbol(x, Decl(capturedLetConstInLoop11.ts, 1, 7)) +} + +function foo() { +>foo : Symbol(foo, Decl(capturedLetConstInLoop11.ts, 3, 1)) + + for (;;) { + const a = 0; +>a : Symbol(a, Decl(capturedLetConstInLoop11.ts, 7, 13)) + + switch(a) { +>a : Symbol(a, Decl(capturedLetConstInLoop11.ts, 7, 13)) + + case 0: return () => a; +>a : Symbol(a, Decl(capturedLetConstInLoop11.ts, 7, 13)) + } + } +} diff --git a/tests/baselines/reference/capturedLetConstInLoop11.types b/tests/baselines/reference/capturedLetConstInLoop11.types new file mode 100644 index 00000000000..93e18f2cb27 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop11.types @@ -0,0 +1,29 @@ +=== tests/cases/compiler/capturedLetConstInLoop11.ts === +for (;;) { + let x = 1; +>x : number +>1 : number + + () => x; +>() => x : () => number +>x : number +} + +function foo() { +>foo : () => () => number + + for (;;) { + const a = 0; +>a : number +>0 : number + + switch(a) { +>a : number + + case 0: return () => a; +>0 : number +>() => a : () => number +>a : number + } + } +} diff --git a/tests/baselines/reference/capturedLetConstInLoop11_ES6.js b/tests/baselines/reference/capturedLetConstInLoop11_ES6.js new file mode 100644 index 00000000000..49f6e9f5214 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop11_ES6.js @@ -0,0 +1,28 @@ +//// [capturedLetConstInLoop11_ES6.ts] +for (;;) { + let x = 1; + () => x; +} + +function foo() { + for (;;) { + const a = 0; + switch(a) { + case 0: return () => a; + } + } +} + +//// [capturedLetConstInLoop11_ES6.js] +for (;;) { + let x = 1; + (() => x); +} +function foo() { + for (;;) { + const a = 0; + switch (a) { + case 0: return () => a; + } + } +} diff --git a/tests/baselines/reference/capturedLetConstInLoop11_ES6.symbols b/tests/baselines/reference/capturedLetConstInLoop11_ES6.symbols new file mode 100644 index 00000000000..6079bf490a3 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop11_ES6.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/capturedLetConstInLoop11_ES6.ts === +for (;;) { + let x = 1; +>x : Symbol(x, Decl(capturedLetConstInLoop11_ES6.ts, 1, 7)) + + () => x; +>x : Symbol(x, Decl(capturedLetConstInLoop11_ES6.ts, 1, 7)) +} + +function foo() { +>foo : Symbol(foo, Decl(capturedLetConstInLoop11_ES6.ts, 3, 1)) + + for (;;) { + const a = 0; +>a : Symbol(a, Decl(capturedLetConstInLoop11_ES6.ts, 7, 13)) + + switch(a) { +>a : Symbol(a, Decl(capturedLetConstInLoop11_ES6.ts, 7, 13)) + + case 0: return () => a; +>a : Symbol(a, Decl(capturedLetConstInLoop11_ES6.ts, 7, 13)) + } + } +} diff --git a/tests/baselines/reference/capturedLetConstInLoop11_ES6.types b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types new file mode 100644 index 00000000000..de75d5d1511 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types @@ -0,0 +1,29 @@ +=== tests/cases/compiler/capturedLetConstInLoop11_ES6.ts === +for (;;) { + let x = 1; +>x : number +>1 : number + + () => x; +>() => x : () => number +>x : number +} + +function foo() { +>foo : () => () => number + + for (;;) { + const a = 0; +>a : number +>0 : number + + switch(a) { +>a : number + + case 0: return () => a; +>0 : number +>() => a : () => number +>a : number + } + } +} diff --git a/tests/baselines/reference/classExtendsAcrossFiles.js b/tests/baselines/reference/classExtendsAcrossFiles.js new file mode 100644 index 00000000000..b533b880036 --- /dev/null +++ b/tests/baselines/reference/classExtendsAcrossFiles.js @@ -0,0 +1,71 @@ +//// [tests/cases/compiler/classExtendsAcrossFiles.ts] //// + +//// [a.ts] +import { b } from './b'; +export const a = { + f: () => { + class A { } + class B extends A { } + b.f(); + } +}; +//// [b.ts] +import { a } from './a'; +export const b = { + f: () => { + class A { } + class B extends A { } + a.f(); + } +}; + +//// [b.js] +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var a_1 = require('./a'); +exports.b = { + f: function () { + var A = (function () { + function A() { + } + return A; + }()); + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + }(A)); + a_1.a.f(); + } +}; +//// [a.js] +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var b_1 = require('./b'); +exports.a = { + f: function () { + var A = (function () { + function A() { + } + return A; + }()); + var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; + }(A)); + b_1.b.f(); + } +}; diff --git a/tests/baselines/reference/classExtendsAcrossFiles.symbols b/tests/baselines/reference/classExtendsAcrossFiles.symbols new file mode 100644 index 00000000000..cf81c923912 --- /dev/null +++ b/tests/baselines/reference/classExtendsAcrossFiles.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/a.ts === +import { b } from './b'; +>b : Symbol(b, Decl(a.ts, 0, 8)) + +export const a = { +>a : Symbol(a, Decl(a.ts, 1, 12)) + + f: () => { +>f : Symbol(f, Decl(a.ts, 1, 18)) + + class A { } +>A : Symbol(A, Decl(a.ts, 2, 14)) + + class B extends A { } +>B : Symbol(B, Decl(a.ts, 3, 19)) +>A : Symbol(A, Decl(a.ts, 2, 14)) + + b.f(); +>b.f : Symbol(f, Decl(b.ts, 1, 18)) +>b : Symbol(b, Decl(a.ts, 0, 8)) +>f : Symbol(f, Decl(b.ts, 1, 18)) + } +}; +=== tests/cases/compiler/b.ts === +import { a } from './a'; +>a : Symbol(a, Decl(b.ts, 0, 8)) + +export const b = { +>b : Symbol(b, Decl(b.ts, 1, 12)) + + f: () => { +>f : Symbol(f, Decl(b.ts, 1, 18)) + + class A { } +>A : Symbol(A, Decl(b.ts, 2, 14)) + + class B extends A { } +>B : Symbol(B, Decl(b.ts, 3, 19)) +>A : Symbol(A, Decl(b.ts, 2, 14)) + + a.f(); +>a.f : Symbol(f, Decl(a.ts, 1, 18)) +>a : Symbol(a, Decl(b.ts, 0, 8)) +>f : Symbol(f, Decl(a.ts, 1, 18)) + } +}; diff --git a/tests/baselines/reference/classExtendsAcrossFiles.types b/tests/baselines/reference/classExtendsAcrossFiles.types new file mode 100644 index 00000000000..fe3427ba043 --- /dev/null +++ b/tests/baselines/reference/classExtendsAcrossFiles.types @@ -0,0 +1,52 @@ +=== tests/cases/compiler/a.ts === +import { b } from './b'; +>b : { f: () => void; } + +export const a = { +>a : { f: () => void; } +>{ f: () => { class A { } class B extends A { } b.f(); }} : { f: () => void; } + + f: () => { +>f : () => void +>() => { class A { } class B extends A { } b.f(); } : () => void + + class A { } +>A : A + + class B extends A { } +>B : B +>A : A + + b.f(); +>b.f() : void +>b.f : () => void +>b : { f: () => void; } +>f : () => void + } +}; +=== tests/cases/compiler/b.ts === +import { a } from './a'; +>a : { f: () => void; } + +export const b = { +>b : { f: () => void; } +>{ f: () => { class A { } class B extends A { } a.f(); }} : { f: () => void; } + + f: () => { +>f : () => void +>() => { class A { } class B extends A { } a.f(); } : () => void + + class A { } +>A : A + + class B extends A { } +>B : B +>A : A + + a.f(); +>a.f() : void +>a.f : () => void +>a : { f: () => void; } +>f : () => void + } +}; diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt index 535e4eb1a30..6bbebeb6ec7 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt @@ -2,7 +2,6 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2322: Type 'string' is not assignable to type 'E'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }'. - Property 'a' is missing in type 'String'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2322: Type 'string' is not assignable to type 'void'. @@ -29,7 +28,6 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen x4 += ''; ~~ !!! error TS2322: Type 'string' is not assignable to type '{ a: string; }'. -!!! error TS2322: Property 'a' is missing in type 'String'. var x5: void; x5 += ''; diff --git a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt index a8fe1de4700..3b9a84fea98 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt +++ b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2322: Type 'number' is not assignable to type 'X'. - Property 'foo' is missing in type 'Number'. tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class @@ -9,7 +8,6 @@ tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Retur return 1; ~ !!! error TS2322: Type 'number' is not assignable to type 'X'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index 1f7d7133bd7..421e629c113 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2322: Type 'number' is not assignable to type 'D'. - Property 'x' is missing in type 'Number'. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,16): error TS2322: Type '{ x: number; }' is not assignable to type 'F'. Types of property 'x' are incompatible. @@ -22,7 +21,6 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl return 1; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'D'. -!!! error TS2322: Property 'x' is missing in type 'Number'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt index 362ead49ad3..db6ecd32b97 100644 --- a/tests/baselines/reference/contextualTyping21.errors.txt +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'. Type '{ id: number; } | number' is not assignable to type '{ id: number; }'. Type 'number' is not assignable to type '{ id: number; }'. - Property 'id' is missing in type 'Number'. ==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== @@ -9,5 +8,4 @@ tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '({ id: num ~~~ !!! error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'. !!! error TS2322: Type '{ id: number; } | number' is not assignable to type '{ id: number; }'. -!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. -!!! error TS2322: Property 'id' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping33.errors.txt b/tests/baselines/reference/contextualTyping33.errors.txt index 4ed0787bde3..16c975391a3 100644 --- a/tests/baselines/reference/contextualTyping33.errors.txt +++ b/tests/baselines/reference/contextualTyping33.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping33.ts (1 errors) ==== @@ -8,4 +9,5 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. !!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. -!!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file +!!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt index a1bfaf56336..698a8e789f0 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt @@ -2,7 +2,6 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ Index signatures are incompatible. Type 'Date | number' is not assignable to type 'Date'. Type 'number' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'Number'. ==== tests/cases/compiler/contextualTypingOfArrayLiterals1.ts (1 errors) ==== @@ -16,7 +15,6 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Date | number' is not assignable to type 'Date'. !!! error TS2322: Type 'number' is not assignable to type 'Date'. -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var r2 = x3[1]; r2.getDate(); \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt index 08fe22c08e0..be49b7b5249 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -2,7 +2,6 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS Type '(b: number) => void' is not assignable to type '(a: A) => void'. Types of parameters 'b' and 'a' are incompatible. Type 'number' is not assignable to type 'A'. - Property 'foo' is missing in type 'Number'. ==== tests/cases/compiler/contextualTypingOfConditionalExpression2.ts (1 errors) ==== @@ -22,5 +21,4 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS !!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void'. !!! error TS2322: Types of parameters 'b' and 'a' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'A'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt index a11f0009016..c7b15e8efef 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(16,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. Type 'string' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'String'. tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. Type 'string' is not assignable to type 'Date'. @@ -25,7 +24,6 @@ tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): ~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. !!! error TS2345: Type 'string' is not assignable to type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. var r6 = _.forEach(c2, (x) => { return x.toFixed() }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. diff --git a/tests/baselines/reference/declarationEmit_UnknownImport.errors.txt b/tests/baselines/reference/declarationEmit_UnknownImport.errors.txt new file mode 100644 index 00000000000..2ae0b6a160d --- /dev/null +++ b/tests/baselines/reference/declarationEmit_UnknownImport.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/declarationEmit_UnknownImport.ts(2,1): error TS2304: Cannot find name 'SomeNonExistingName'. +tests/cases/compiler/declarationEmit_UnknownImport.ts(2,14): error TS2503: Cannot find namespace 'SomeNonExistingName'. +tests/cases/compiler/declarationEmit_UnknownImport.ts(2,14): error TS4000: Import declaration 'Foo' is using private name 'SomeNonExistingName'. + + +==== tests/cases/compiler/declarationEmit_UnknownImport.ts (3 errors) ==== + + import Foo = SomeNonExistingName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'SomeNonExistingName'. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2503: Cannot find namespace 'SomeNonExistingName'. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS4000: Import declaration 'Foo' is using private name 'SomeNonExistingName'. + export {Foo} \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_UnknownImport.js b/tests/baselines/reference/declarationEmit_UnknownImport.js new file mode 100644 index 00000000000..601d2a92c88 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_UnknownImport.js @@ -0,0 +1,7 @@ +//// [declarationEmit_UnknownImport.ts] + +import Foo = SomeNonExistingName +export {Foo} + +//// [declarationEmit_UnknownImport.js] +"use strict"; diff --git a/tests/baselines/reference/declarationEmit_UnknownImport2.errors.txt b/tests/baselines/reference/declarationEmit_UnknownImport2.errors.txt new file mode 100644 index 00000000000..0e0bf6690e4 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_UnknownImport2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/declarationEmit_UnknownImport2.ts(2,1): error TS2304: Cannot find name 'From'. +tests/cases/compiler/declarationEmit_UnknownImport2.ts(2,12): error TS1005: '=' expected. +tests/cases/compiler/declarationEmit_UnknownImport2.ts(2,12): error TS2503: Cannot find namespace 'From'. +tests/cases/compiler/declarationEmit_UnknownImport2.ts(2,12): error TS4000: Import declaration 'Foo' is using private name 'From'. +tests/cases/compiler/declarationEmit_UnknownImport2.ts(2,17): error TS1005: ';' expected. + + +==== tests/cases/compiler/declarationEmit_UnknownImport2.ts (5 errors) ==== + + import Foo From './Foo'; // Syntax error + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'From'. + ~~~~ +!!! error TS1005: '=' expected. + ~~~~ +!!! error TS2503: Cannot find namespace 'From'. + ~~~~ +!!! error TS4000: Import declaration 'Foo' is using private name 'From'. + ~~~~~~~ +!!! error TS1005: ';' expected. + export default Foo \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_UnknownImport2.js b/tests/baselines/reference/declarationEmit_UnknownImport2.js new file mode 100644 index 00000000000..213b4fc7369 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_UnknownImport2.js @@ -0,0 +1,8 @@ +//// [declarationEmit_UnknownImport2.ts] + +import Foo From './Foo'; // Syntax error +export default Foo + +//// [declarationEmit_UnknownImport2.js] +"use strict"; +'./Foo'; // Syntax error diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 91405285973..3348effe822 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -5,7 +5,6 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss Types of property '1' are incompatible. Type 'number' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(17,6): error TS2322: Type 'string' is not assignable to type 'Number'. - Property 'toFixed' is missing in type 'String'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -43,7 +42,6 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [b3 = "string", b4, b5] = bar(); // Error ~~ !!! error TS2322: Type 'string' is not assignable to type 'Number'. -!!! error TS2322: Property 'toFixed' is missing in type 'String'. // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, // S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt index c8037255a32..8c0781571e4 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt @@ -8,7 +8,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. Type 'string' is not assignable to type 'number | string[][]'. Type 'string' is not assignable to type 'string[][]'. - Property 'push' is missing in type 'String'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,16): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(23,14): error TS2345: Argument of type '{ x: string; y: boolean; }' is not assignable to parameter of type '{ x: number; y: any; }'. @@ -34,7 +33,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(39,4): error TS2345: Argument of type '[number, number, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Types of property '2' are incompatible. Type 'boolean' is not assignable to type '[[any]]'. - Property '0' is missing in type 'Boolean'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(40,4): error TS2345: Argument of type '[number, number, [[string]]]' is not assignable to parameter of type '[any, any, [[number]]]'. Types of property '2' are incompatible. Type '[[string]]' is not assignable to type '[[number]]'. @@ -78,7 +76,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( !!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. !!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'. !!! error TS2345: Type 'string' is not assignable to type 'string[][]'. -!!! error TS2345: Property 'push' is missing in type 'String'. // If the declaration includes an initializer expression (which is permitted only @@ -146,7 +143,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( !!! error TS2345: Argument of type '[number, number, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. !!! error TS2345: Types of property '2' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type '[[any]]'. -!!! error TS2345: Property '0' is missing in type 'Boolean'. c6([1, 2, [["string"]]]); // Error, implied type is [any, any, [[number]]] // Use initializer ~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[number, number, [[string]]]' is not assignable to parameter of type '[any, any, [[number]]]'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index 7e71a2cd753..b08c5b942d8 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -6,7 +6,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(22,4): error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Types of property '2' are incompatible. Type 'string' is not assignable to type '[[any]]'. - Property '0' is missing in type 'String'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(23,4): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]]]'. Property '2' is missing in type '[number, number]'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(24,4): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'. @@ -53,7 +52,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( !!! error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. !!! error TS2345: Types of property '2' are incompatible. !!! error TS2345: Type 'string' is not assignable to type '[[any]]'. -!!! error TS2345: Property '0' is missing in type 'String'. a5([1, 2]); // Error, parameter type is [any, any, [[any]]] ~~~~~~ !!! error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]]]'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt index c60e2b75c37..2afb25502c7 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts(47,4): error TS2345: Argument of type '{ y: Class; }' is not assignable to parameter of type '{ y: D; }'. Types of property 'y' are incompatible. Type 'Class' is not assignable to type 'D'. + Property 'foo' is missing in type 'Class'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts(48,4): error TS2345: Argument of type '{}' is not assignable to parameter of type '{ y: D; }'. Property 'y' is missing in type '{}'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts(49,4): error TS2345: Argument of type '{ y: number; }' is not assignable to parameter of type '{ y: D; }'. @@ -63,6 +64,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts( !!! error TS2345: Argument of type '{ y: Class; }' is not assignable to parameter of type '{ y: D; }'. !!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'Class' is not assignable to type 'D'. +!!! error TS2345: Property 'foo' is missing in type 'Class'. d3({}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type '{ y: D; }'. diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index c13a6b5fe2a..d53571cc4a8 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. @@ -8,7 +7,6 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Exp var f: { ~ !!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. x: number; <- ~ diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 1316727076f..bfabb5eae88 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -3,23 +3,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2322: Type 'E' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2322: Type 'E' is not assignable to type 'boolean'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2322: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2322: Type 'E' is not assignable to type '() => {}'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function'. - Property 'apply' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2322: Type 'E' is not assignable to type '(x: number) => string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2322: Type 'E' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '(x: T) => T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'. - Property 'charAt' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2322: Type 'E' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2322: Type 'E' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2322: Type 'E' is not assignable to type 'V'. @@ -69,7 +62,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var ee: Date = e; ~~ !!! error TS2322: Type 'E' is not assignable to type 'Date'. -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var f: any = e; // ok var g: void = e; ~ @@ -82,26 +74,21 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var k: Function = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'Function'. -!!! error TS2322: Property 'apply' is missing in type 'Number'. var l: (x: number) => string = e; ~ !!! error TS2322: Type 'E' is not assignable to type '(x: number) => string'. ac = e; ~~ !!! error TS2322: Type 'E' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. ai = e; ~~ !!! error TS2322: Type 'E' is not assignable to type 'I'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. var m: number[] = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. var n: { foo: string } = e; ~ !!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. var o: (x: T) => T = e; ~ !!! error TS2322: Type 'E' is not assignable to type '(x: T) => T'. @@ -109,7 +96,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var q: String = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'String'. -!!! error TS2322: Property 'charAt' is missing in type 'Number'. function foo(x: T, y: U, z: V) { x = e; diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index 3cddaf45966..f1a01247146 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. - Property 'D' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. @@ -40,7 +38,6 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' var b: typeof W = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'typeof W'. -!!! error TS2322: Property 'D' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ @@ -49,7 +46,6 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' var f: WStatic = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'WStatic'. -!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'WStatic'. diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index d87d6acf6a0..4e0660eaae3 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. @@ -39,7 +37,6 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' var b: typeof W = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'typeof W'. -!!! error TS2322: Property 'a' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ @@ -48,7 +45,6 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' var f: WStatic = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'WStatic'. -!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'WStatic'. diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js index d7dfe29208d..4bff2abf82d 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js @@ -31,16 +31,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = {}; //// [es6ImportDefaultBindingFollowedWithNamedImport_1.js] "use strict"; -var es6ImportDefaultBindingFollowedWithNamedImport_0_1 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); +const es6ImportDefaultBindingFollowedWithNamedImport_0_1 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); var x1 = es6ImportDefaultBindingFollowedWithNamedImport_0_1.a; -var es6ImportDefaultBindingFollowedWithNamedImport_0_2 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); +const es6ImportDefaultBindingFollowedWithNamedImport_0_2 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); var x1 = es6ImportDefaultBindingFollowedWithNamedImport_0_2.a; -var es6ImportDefaultBindingFollowedWithNamedImport_0_3 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); +const es6ImportDefaultBindingFollowedWithNamedImport_0_3 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); var x1 = es6ImportDefaultBindingFollowedWithNamedImport_0_3.x; var x1 = es6ImportDefaultBindingFollowedWithNamedImport_0_3.a; -var es6ImportDefaultBindingFollowedWithNamedImport_0_4 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); +const es6ImportDefaultBindingFollowedWithNamedImport_0_4 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); var x1 = es6ImportDefaultBindingFollowedWithNamedImport_0_4.x; -var es6ImportDefaultBindingFollowedWithNamedImport_0_5 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); +const es6ImportDefaultBindingFollowedWithNamedImport_0_5 = require("./es6ImportDefaultBindingFollowedWithNamedImport_0"); var x1 = es6ImportDefaultBindingFollowedWithNamedImport_0_5.m; diff --git a/tests/baselines/reference/es6ImportNameSpaceImport.js b/tests/baselines/reference/es6ImportNameSpaceImport.js index 685e1cf643c..8e109779f45 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImport.js +++ b/tests/baselines/reference/es6ImportNameSpaceImport.js @@ -15,7 +15,7 @@ import * as nameSpaceBinding2 from "./es6ImportNameSpaceImport_0"; // elide this exports.a = 10; //// [es6ImportNameSpaceImport_1.js] "use strict"; -var nameSpaceBinding = require("./es6ImportNameSpaceImport_0"); +const nameSpaceBinding = require("./es6ImportNameSpaceImport_0"); var x = nameSpaceBinding.a; diff --git a/tests/baselines/reference/es6ImportNamedImport.js b/tests/baselines/reference/es6ImportNamedImport.js index 73fe8f4ec1b..8dbdf7ce6f1 100644 --- a/tests/baselines/reference/es6ImportNamedImport.js +++ b/tests/baselines/reference/es6ImportNamedImport.js @@ -53,26 +53,26 @@ exports.z2 = 10; exports.aaaa = 10; //// [es6ImportNamedImport_1.js] "use strict"; -var es6ImportNamedImport_0_1 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_1 = require("./es6ImportNamedImport_0"); var xxxx = es6ImportNamedImport_0_1.a; -var es6ImportNamedImport_0_2 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_2 = require("./es6ImportNamedImport_0"); var xxxx = es6ImportNamedImport_0_2.a; -var es6ImportNamedImport_0_3 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_3 = require("./es6ImportNamedImport_0"); var xxxx = es6ImportNamedImport_0_3.x; var xxxx = es6ImportNamedImport_0_3.a; -var es6ImportNamedImport_0_4 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_4 = require("./es6ImportNamedImport_0"); var xxxx = es6ImportNamedImport_0_4.x; -var es6ImportNamedImport_0_5 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_5 = require("./es6ImportNamedImport_0"); var xxxx = es6ImportNamedImport_0_5.m; -var es6ImportNamedImport_0_6 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_6 = require("./es6ImportNamedImport_0"); var xxxx = es6ImportNamedImport_0_6.a1; var xxxx = es6ImportNamedImport_0_6.x1; -var es6ImportNamedImport_0_7 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_7 = require("./es6ImportNamedImport_0"); var xxxx = es6ImportNamedImport_0_7.a1; var xxxx = es6ImportNamedImport_0_7.x1; -var es6ImportNamedImport_0_8 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_8 = require("./es6ImportNamedImport_0"); var z111 = es6ImportNamedImport_0_8.z1; -var es6ImportNamedImport_0_9 = require("./es6ImportNamedImport_0"); +const es6ImportNamedImport_0_9 = require("./es6ImportNamedImport_0"); var z2 = es6ImportNamedImport_0_9.z2; // z2 shouldn't give redeclare error diff --git a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.js b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.js index b67f61e88ae..38766d32cd9 100644 --- a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.js +++ b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.js @@ -13,7 +13,7 @@ export = a; exports.a = 10; //// [es6ImportNamedImportInExportAssignment_1.js] "use strict"; -var es6ImportNamedImportInExportAssignment_0_1 = require("./es6ImportNamedImportInExportAssignment_0"); +const es6ImportNamedImportInExportAssignment_0_1 = require("./es6ImportNamedImportInExportAssignment_0"); module.exports = es6ImportNamedImportInExportAssignment_0_1.a; diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 12478442472..fc1bcaa545a 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'Number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type 'number' is not assignable to type 'void'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I'. Property 'id' is missing in type 'D<{}>'. @@ -76,7 +75,6 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var aDate: Date = 9.9; ~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'Date'. -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var aVoid: void = 9.9; ~~~~~ diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt index 946bc8ee8b1..cf63c48925f 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. - Property 'a' is missing in type 'Boolean'. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== @@ -7,7 +6,6 @@ tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument o var x = new foo(true); // Should error ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. -!!! error TS2345: Property 'a' is missing in type 'Boolean'. var y = new foo({a: "test", b: 42}); // Should be OK var z: number = y.test.b; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/exportSpecifierForAGlobal.errors.txt b/tests/baselines/reference/exportSpecifierForAGlobal.errors.txt new file mode 100644 index 00000000000..6df9c6de1ef --- /dev/null +++ b/tests/baselines/reference/exportSpecifierForAGlobal.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/b.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/a.d.ts (0 errors) ==== + + declare class X { } + +==== tests/cases/compiler/b.ts (1 errors) ==== + export {X}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export function f() { + var x: X; + return x; + } + \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierForAGlobal.symbols b/tests/baselines/reference/exportSpecifierForAGlobal.symbols deleted file mode 100644 index b38fc7be270..00000000000 --- a/tests/baselines/reference/exportSpecifierForAGlobal.symbols +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/compiler/a.d.ts === - -declare class X { } ->X : Symbol(X, Decl(a.d.ts, 0, 0)) - -=== tests/cases/compiler/b.ts === -export {X}; ->X : Symbol(X, Decl(b.ts, 0, 8)) - -export function f() { ->f : Symbol(f, Decl(b.ts, 0, 11)) - - var x: X; ->x : Symbol(x, Decl(b.ts, 2, 7)) ->X : Symbol(X, Decl(a.d.ts, 0, 0)) - - return x; ->x : Symbol(x, Decl(b.ts, 2, 7)) -} - diff --git a/tests/baselines/reference/exportSpecifierForAGlobal.types b/tests/baselines/reference/exportSpecifierForAGlobal.types deleted file mode 100644 index e3d728ad0d0..00000000000 --- a/tests/baselines/reference/exportSpecifierForAGlobal.types +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/compiler/a.d.ts === - -declare class X { } ->X : X - -=== tests/cases/compiler/b.ts === -export {X}; ->X : typeof X - -export function f() { ->f : () => X - - var x: X; ->x : X ->X : X - - return x; ->x : X -} - diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt new file mode 100644 index 00000000000..7eb095b05f0 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts(3,14): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts (1 errors) ==== + declare module X { export interface bar { } } + declare module "m" { + export { X }; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export function foo(): X.bar; + } \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols deleted file mode 100644 index 16abde86d32..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === -declare module X { export interface bar { } } ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) ->bar : Symbol(bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) - -declare module "m" { - export { X }; ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 12)) - - export function foo(): X.bar; ->foo : Symbol(foo, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 2, 17)) ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 0)) ->bar : Symbol(X.bar, Decl(exportSpecifierReferencingOuterDeclaration1.ts, 0, 18)) -} diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types deleted file mode 100644 index be03554a1b0..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration1.types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration1.ts === -declare module X { export interface bar { } } ->X : any ->bar : bar - -declare module "m" { - export { X }; ->X : any - - export function foo(): X.bar; ->foo : () => X.bar ->X : any ->bar : X.bar -} diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt new file mode 100644 index 00000000000..00118010785 --- /dev/null +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(1,10): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts (0 errors) ==== + declare module X { export interface bar { } } + +==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts (1 errors) ==== + export { X }; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export declare function foo(): X.bar; \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols deleted file mode 100644 index 9a57645b1cb..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts === -declare module X { export interface bar { } } ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 0)) ->bar : Symbol(bar, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 18)) - -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts === -export { X }; ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_B.ts, 0, 8)) - -export declare function foo(): X.bar; ->foo : Symbol(foo, Decl(exportSpecifierReferencingOuterDeclaration2_B.ts, 0, 13)) ->X : Symbol(X, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 0)) ->bar : Symbol(X.bar, Decl(exportSpecifierReferencingOuterDeclaration2_A.ts, 0, 18)) - diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types deleted file mode 100644 index fa59948c116..00000000000 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration2.types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts === -declare module X { export interface bar { } } ->X : any ->bar : bar - -=== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts === -export { X }; ->X : any - -export declare function foo(): X.bar; ->foo : () => X.bar ->X : any ->bar : X.bar - diff --git a/tests/baselines/reference/exportsAndImports1-es6.js b/tests/baselines/reference/exportsAndImports1-es6.js index ece98a80318..3ac5aeb0dc5 100644 --- a/tests/baselines/reference/exportsAndImports1-es6.js +++ b/tests/baselines/reference/exportsAndImports1-es6.js @@ -67,7 +67,7 @@ exports.M = t1_1.M; exports.a = t1_1.a; //// [t3.js] "use strict"; -var t1_1 = require("./t1"); +const t1_1 = require("./t1"); exports.v = t1_1.v; exports.f = t1_1.f; exports.C = t1_1.C; diff --git a/tests/baselines/reference/exportsAndImports2-es6.js b/tests/baselines/reference/exportsAndImports2-es6.js index 865534b2851..56639bdbecf 100644 --- a/tests/baselines/reference/exportsAndImports2-es6.js +++ b/tests/baselines/reference/exportsAndImports2-es6.js @@ -24,6 +24,6 @@ exports.y = t1_1.x; exports.x = t1_1.y; //// [t3.js] "use strict"; -var t1_1 = require("./t1"); +const t1_1 = require("./t1"); exports.y = t1_1.x; exports.x = t1_1.y; diff --git a/tests/baselines/reference/exportsAndImports3-es6.js b/tests/baselines/reference/exportsAndImports3-es6.js index ed509d31437..ea16836b1f2 100644 --- a/tests/baselines/reference/exportsAndImports3-es6.js +++ b/tests/baselines/reference/exportsAndImports3-es6.js @@ -69,7 +69,7 @@ exports.M = t1_1.M1; exports.a = t1_1.a1; //// [t3.js] "use strict"; -var t1_1 = require("./t1"); +const t1_1 = require("./t1"); exports.v = t1_1.v1; exports.f = t1_1.f1; exports.C = t1_1.C1; diff --git a/tests/baselines/reference/exportsAndImports4-es6.js b/tests/baselines/reference/exportsAndImports4-es6.js index 39c6583e935..8a8d4f81225 100644 --- a/tests/baselines/reference/exportsAndImports4-es6.js +++ b/tests/baselines/reference/exportsAndImports4-es6.js @@ -45,24 +45,24 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = "hello"; //// [t3.js] "use strict"; -var a = require("./t1"); +const a = require("./t1"); exports.a = a; a.default; -var t1_1 = require("./t1"); +const t1_1 = require("./t1"); exports.b = t1_1.default; t1_1.default; -var c = require("./t1"); +const c = require("./t1"); exports.c = c; c.default; -var t1_2 = require("./t1"); +const t1_2 = require("./t1"); exports.d = t1_2.default; t1_2.default; -var t1_3 = require("./t1"), e2 = t1_3; +const t1_3 = require("./t1"), e2 = t1_3; exports.e1 = t1_3.default; exports.e2 = e2; t1_3.default; e2.default; -var t1_4 = require("./t1"); +const t1_4 = require("./t1"); exports.f1 = t1_4.default; exports.f2 = t1_4.default; t1_4.default; diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index 19e572fa58d..576ea9c266e 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/functionCall7.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/functionCall7.ts(6,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -15,7 +14,6 @@ tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do foo(4); ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. -!!! error TS2345: Property 'a' is missing in type 'Number'. foo(); ~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 7b3aa92828d..d2299894c59 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. - Property 'apply' is missing in type 'Number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. @@ -20,9 +19,11 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain Type 'F2' provides no match for the signature '(x: string): string' tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. Type '() => void' is not assignable to type '(x: string) => string'. + Type 'void' is not assignable to type 'string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(38,10): error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. Type 'T' is not assignable to type '(x: string) => string'. Type '() => void' is not assignable to type '(x: string) => string'. + Type 'void' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts (13 errors) ==== @@ -33,7 +34,6 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain foo(1); ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'Number'. foo(() => { }, 1); ~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -97,10 +97,12 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain ~ !!! error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. !!! error TS2345: Type '() => void' is not assignable to type '(x: string) => string'. +!!! error TS2345: Type 'void' is not assignable to type 'string'. foo2(y); ~ !!! error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. !!! error TS2345: Type 'T' is not assignable to type '(x: string) => string'. !!! error TS2345: Type '() => void' is not assignable to type '(x: string) => string'. +!!! error TS2345: Type 'void' is not assignable to type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt index 58ffd051d4d..1ccc296b75b 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt @@ -1,9 +1,10 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(3,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(95,16): error TS2378: A 'get' accessor must return a value. -tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(118,5): error TS1003: Identifier expected. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(101,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(106,16): error TS2378: A 'get' accessor must return a value. +tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(129,5): error TS1003: Identifier expected. -==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (3 errors) ==== +==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (4 errors) ==== function f1(): string { @@ -98,6 +99,19 @@ tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts(118,5): e return "Okay, not type annotated."; } + function f19(): void | number { + // Okay; function return type is union containing void + } + + function f20(): any | number { + // Okay; function return type is union containing any + } + + function f21(): number | string { + ~~~~~~~~~~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. + // Not okay; union does not contain void or any + } class C { public get m1() { diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js index 4dfe851683a..17468722e20 100644 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js +++ b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.js @@ -91,6 +91,17 @@ function f18() { return "Okay, not type annotated."; } +function f19(): void | number { + // Okay; function return type is union containing void +} + +function f20(): any | number { + // Okay; function return type is union containing any +} + +function f21(): number | string { + // Not okay; union does not contain void or any +} class C { public get m1() { @@ -191,6 +202,15 @@ function f17() { function f18() { return "Okay, not type annotated."; } +function f19() { + // Okay; function return type is union containing void +} +function f20() { + // Okay; function return type is union containing any +} +function f21() { + // Not okay; union does not contain void or any +} var C = (function () { function C() { } diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt index 6ac3c9e6703..805bde82b64 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(11,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. - Property 'toDateString' is missing in type 'Number'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts (1 errors) ==== @@ -16,5 +15,4 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon var r4 = foo(1); // error ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'Number'. var r5 = foo(new Date()); // no error \ No newline at end of file diff --git a/tests/baselines/reference/genericCombinators2.errors.txt b/tests/baselines/reference/genericCombinators2.errors.txt index d590f1030c3..5be717109c8 100644 --- a/tests/baselines/reference/genericCombinators2.errors.txt +++ b/tests/baselines/reference/genericCombinators2.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/genericCombinators2.ts(15,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. Type 'string' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'String'. tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. Type 'string' is not assignable to type 'Date'. @@ -24,7 +23,6 @@ tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of ty ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. !!! error TS2345: Type 'string' is not assignable to type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. var r5b = _.map(c2, rf1); ~~~ !!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt index 38818b59863..1e5e3b6ee96 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '{ length: number; foo: number; }'. - Property 'foo' is missing in type 'String'. ==== tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts (1 errors) ==== @@ -20,5 +19,4 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS23 !!! error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type '{ length: number; foo: number; }'. -!!! error TS2322: Property 'foo' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index 99106ebd795..8a977452958 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -4,7 +4,6 @@ tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type 's tests/cases/compiler/genericRestArgs.ts(10,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/genericRestArgs.ts (4 errors) ==== @@ -29,5 +28,4 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. -!!! error TS2345: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/globalIsContextualKeyword.js b/tests/baselines/reference/globalIsContextualKeyword.js new file mode 100644 index 00000000000..b6fa566c91a --- /dev/null +++ b/tests/baselines/reference/globalIsContextualKeyword.js @@ -0,0 +1,34 @@ +//// [globalIsContextualKeyword.ts] +function a() { + let global = 1; +} +function b() { + class global {} +} + +namespace global { +} + +function foo(global: number) { +} + +let obj = { + global: "123" +} + +//// [globalIsContextualKeyword.js] +function a() { + var global = 1; +} +function b() { + var global = (function () { + function global() { + } + return global; + }()); +} +function foo(global) { +} +var obj = { + global: "123" +}; diff --git a/tests/baselines/reference/globalIsContextualKeyword.symbols b/tests/baselines/reference/globalIsContextualKeyword.symbols new file mode 100644 index 00000000000..edc1cebbc95 --- /dev/null +++ b/tests/baselines/reference/globalIsContextualKeyword.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/globalIsContextualKeyword.ts === +function a() { +>a : Symbol(a, Decl(globalIsContextualKeyword.ts, 0, 0)) + + let global = 1; +>global : Symbol(global, Decl(globalIsContextualKeyword.ts, 1, 7)) +} +function b() { +>b : Symbol(b, Decl(globalIsContextualKeyword.ts, 2, 1)) + + class global {} +>global : Symbol(global, Decl(globalIsContextualKeyword.ts, 3, 14)) +} + +namespace global { +>global : Symbol(global, Decl(globalIsContextualKeyword.ts, 5, 1)) +} + +function foo(global: number) { +>foo : Symbol(foo, Decl(globalIsContextualKeyword.ts, 8, 1)) +>global : Symbol(global, Decl(globalIsContextualKeyword.ts, 10, 13)) +} + +let obj = { +>obj : Symbol(obj, Decl(globalIsContextualKeyword.ts, 13, 3)) + + global: "123" +>global : Symbol(global, Decl(globalIsContextualKeyword.ts, 13, 11)) +} diff --git a/tests/baselines/reference/globalIsContextualKeyword.types b/tests/baselines/reference/globalIsContextualKeyword.types new file mode 100644 index 00000000000..d0bf624af6d --- /dev/null +++ b/tests/baselines/reference/globalIsContextualKeyword.types @@ -0,0 +1,32 @@ +=== tests/cases/compiler/globalIsContextualKeyword.ts === +function a() { +>a : () => void + + let global = 1; +>global : number +>1 : number +} +function b() { +>b : () => void + + class global {} +>global : global +} + +namespace global { +>global : any +} + +function foo(global: number) { +>foo : (global: number) => void +>global : number +} + +let obj = { +>obj : { global: string; } +>{ global: "123"} : { global: string; } + + global: "123" +>global : string +>"123" : string +} diff --git a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt index 34cfe02305f..5d70b32aa16 100644 --- a/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt +++ b/tests/baselines/reference/importDeclRefereingExternalModuleWithNoResolve.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file. tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,20): error TS2307: Cannot find module 'externalModule'. -tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2664: Invalid module name in augmentation, module 'm1' cannot be found. tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find module 'externalModule'. @@ -12,7 +12,7 @@ tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): er !!! error TS2307: Cannot find module 'externalModule'. declare module "m1" { ~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'm1' cannot be found. import im2 = require("externalModule"); ~~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find module 'externalModule'. diff --git a/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt index 623bd535745..eb6744d656b 100644 --- a/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt +++ b/tests/baselines/reference/initializerReferencingConstructorParameters.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(4,9): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(5,15): error TS2304: Cannot find name 'x'. -tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(10,9): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(10,9): error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'? tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(11,15): error TS2304: Cannot find name 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(17,15): error TS1003: Identifier expected. -tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(23,9): error TS2304: Cannot find name 'x'. +tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts(23,9): error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'? ==== tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencingConstructorParameters.ts (6 errors) ==== @@ -22,7 +22,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencin class D { a = x; // error ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'? b: typeof x; // error ~ !!! error TS2304: Cannot find name 'x'. @@ -41,6 +41,6 @@ tests/cases/conformance/classes/propertyMemberDeclarations/initializerReferencin a = this.x; // ok b = x; // error ~ -!!! error TS2304: Cannot find name 'x'. +!!! error TS2663: Cannot find name 'x'. Did you mean the instance member 'this.x'? constructor(public x: T) { } } \ No newline at end of file diff --git a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt index ba93c2ef127..81982ac3ec7 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt +++ b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2415: Class 'C2' incorrectly extends base class 'C1'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'C2'. - Property 'x' is missing in type 'String'. ==== tests/cases/compiler/instanceSubtypeCheck2.ts (1 errors) ==== @@ -14,6 +13,5 @@ tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2415: Class 'C2' !!! error TS2415: Class 'C2' incorrectly extends base class 'C1'. !!! error TS2415: Types of property 'x' are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'C2'. -!!! error TS2415: Property 'x' is missing in type 'String'. x: string } \ No newline at end of file diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 3d805a65822..a860f5e3604 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -9,7 +9,6 @@ tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type 'Base' is not as tests/cases/compiler/intTypeCheck.ts(103,5): error TS2322: Type '() => void' is not assignable to type 'i1'. Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(106,5): error TS2322: Type 'boolean' is not assignable to type 'i1'. - Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(106,20): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(106,21): error TS2304: Cannot find name 'i1'. tests/cases/compiler/intTypeCheck.ts(107,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -38,7 +37,6 @@ tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3 tests/cases/compiler/intTypeCheck.ts(135,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(142,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(148,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. - Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(148,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(148,22): error TS2304: Cannot find name 'i4'. tests/cases/compiler/intTypeCheck.ts(149,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -52,7 +50,6 @@ tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type 'Base' is not as tests/cases/compiler/intTypeCheck.ts(159,5): error TS2322: Type '() => void' is not assignable to type 'i5'. Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(162,5): error TS2322: Type 'boolean' is not assignable to type 'i5'. - Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(162,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(162,22): error TS2304: Cannot find name 'i5'. tests/cases/compiler/intTypeCheck.ts(163,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -83,7 +80,6 @@ tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7 tests/cases/compiler/intTypeCheck.ts(191,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(198,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(204,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. - Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(204,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(204,22): error TS2304: Cannot find name 'i8'. tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -215,7 +211,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj9: i1 = new anyVar; ~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i1'. -!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ @@ -307,7 +302,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj42: i4 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i4'. -!!! error TS2322: Index signature is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ @@ -344,7 +338,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj53: i5 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i5'. -!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ @@ -439,7 +432,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj86: i8 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i8'. -!!! error TS2322: Index signature is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ diff --git a/tests/baselines/reference/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt index b297015dfbe..1025a1f5296 100644 --- a/tests/baselines/reference/interfaceImplementation7.errors.txt +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -4,7 +4,6 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' Types of property 'name' are incompatible. Type '() => string' is not assignable to type '() => { s: string; n: number; }'. Type 'string' is not assignable to type '{ s: string; n: number; }'. - Property 's' is missing in type 'String'. ==== tests/cases/compiler/interfaceImplementation7.ts (2 errors) ==== @@ -23,7 +22,6 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' !!! error TS2420: Types of property 'name' are incompatible. !!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'. !!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'. -!!! error TS2420: Property 's' is missing in type 'String'. public name(): string { return ""; } } \ No newline at end of file diff --git a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt index 4f26cc63ba3..d4526c815c4 100644 --- a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt +++ b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(19,1): error TS2322: Type 'A' is not assignable to type 'A & B'. Type 'A' is not assignable to type 'B'. + Property 'b' is missing in type 'A'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(20,1): error TS2322: Type 'B' is not assignable to type 'A & B'. Type 'B' is not assignable to type 'A'. Property 'a' is missing in type 'B'. @@ -7,26 +8,32 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(23,1): e Type 'A' is not assignable to type '(A & B) | (C & D)'. Type 'A' is not assignable to type 'C & D'. Type 'A' is not assignable to type 'C'. + Property 'c' is missing in type 'A'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'. Type 'C' is not assignable to type '(A & B) | (C & D)'. Type 'C' is not assignable to type 'C & D'. Type 'C' is not assignable to type 'D'. + Property 'd' is missing in type 'C'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(26,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. Type 'C & D' is not assignable to type 'A & B'. Type 'C & D' is not assignable to type 'A'. Type 'D' is not assignable to type 'A'. + Property 'a' is missing in type 'D'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(27,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. Type 'C & D' is not assignable to type 'A | B'. Type 'C & D' is not assignable to type 'B'. Type 'D' is not assignable to type 'B'. + Property 'b' is missing in type 'D'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(28,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. Type 'A & B' is not assignable to type 'C & D'. Type 'A & B' is not assignable to type 'C'. Type 'B' is not assignable to type 'C'. + Property 'c' is missing in type 'B'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(29,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'D'. Type 'B' is not assignable to type 'D'. + Property 'd' is missing in type 'B'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(31,1): error TS2322: Type 'A & B' is not assignable to type '(A | B) & (C | D)'. Type 'A & B' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'D'. @@ -35,6 +42,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(32,1): e Type 'A' is not assignable to type '(A | B) & (C | D)'. Type 'A' is not assignable to type 'C | D'. Type 'A' is not assignable to type 'D'. + Property 'd' is missing in type 'A'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(33,1): error TS2322: Type 'C & D' is not assignable to type '(A | B) & (C | D)'. Type 'C & D' is not assignable to type 'A | B'. Type 'C & D' is not assignable to type 'B'. @@ -43,14 +51,17 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(34,1): e Type 'C' is not assignable to type '(A | B) & (C | D)'. Type 'C' is not assignable to type 'A | B'. Type 'C' is not assignable to type 'B'. + Property 'b' is missing in type 'C'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(35,1): error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A & B'. Type '(A | B) & (C | D)' is not assignable to type 'A'. Type 'C | D' is not assignable to type 'A'. Type 'C' is not assignable to type 'A'. + Property 'a' is missing in type 'C'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'C & D'. Type '(A | B) & (C | D)' is not assignable to type 'C'. Type 'C | D' is not assignable to type 'C'. Type 'D' is not assignable to type 'C'. + Property 'c' is missing in type 'D'. ==== tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts (14 errors) ==== @@ -76,6 +87,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e ~~~ !!! error TS2322: Type 'A' is not assignable to type 'A & B'. !!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'b' is missing in type 'A'. anb = b; ~~~ !!! error TS2322: Type 'B' is not assignable to type 'A & B'. @@ -89,6 +101,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'A' is not assignable to type '(A & B) | (C & D)'. !!! error TS2322: Type 'A' is not assignable to type 'C & D'. !!! error TS2322: Type 'A' is not assignable to type 'C'. +!!! error TS2322: Property 'c' is missing in type 'A'. x = cnd; // Ok x = cod; ~ @@ -96,30 +109,35 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'C' is not assignable to type '(A & B) | (C & D)'. !!! error TS2322: Type 'C' is not assignable to type 'C & D'. !!! error TS2322: Type 'C' is not assignable to type 'D'. +!!! error TS2322: Property 'd' is missing in type 'C'. anb = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A & B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A'. !!! error TS2322: Type 'D' is not assignable to type 'A'. +!!! error TS2322: Property 'a' is missing in type 'D'. aob = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A | B'. !!! error TS2322: Type 'C & D' is not assignable to type 'B'. !!! error TS2322: Type 'D' is not assignable to type 'B'. +!!! error TS2322: Property 'b' is missing in type 'D'. cnd = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C & D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C'. !!! error TS2322: Type 'B' is not assignable to type 'C'. +!!! error TS2322: Property 'c' is missing in type 'B'. cod = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C | D'. !!! error TS2322: Type 'A & B' is not assignable to type 'D'. !!! error TS2322: Type 'B' is not assignable to type 'D'. +!!! error TS2322: Property 'd' is missing in type 'B'. y = anb; ~ @@ -133,6 +151,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'A' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'A' is not assignable to type 'C | D'. !!! error TS2322: Type 'A' is not assignable to type 'D'. +!!! error TS2322: Property 'd' is missing in type 'A'. y = cnd; ~ !!! error TS2322: Type 'C & D' is not assignable to type '(A | B) & (C | D)'. @@ -145,12 +164,14 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'C' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'C' is not assignable to type 'A | B'. !!! error TS2322: Type 'C' is not assignable to type 'B'. +!!! error TS2322: Property 'b' is missing in type 'C'. anb = y; ~~~ !!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A & B'. !!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A'. !!! error TS2322: Type 'C | D' is not assignable to type 'A'. !!! error TS2322: Type 'C' is not assignable to type 'A'. +!!! error TS2322: Property 'a' is missing in type 'C'. aob = y; // Ok cnd = y; ~~~ @@ -158,5 +179,6 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'C'. !!! error TS2322: Type 'C | D' is not assignable to type 'C'. !!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Property 'c' is missing in type 'D'. cod = y; // Ok \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 84ced226113..99d32aff9bc 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -3,9 +3,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4, tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'void'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'boolean' is not assignable to type 'E'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. - Property 'foo' is missing in type 'Boolean'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. - Property 'bar' is missing in type 'Boolean'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. @@ -35,13 +33,11 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 var f: C = x; ~ !!! error TS2322: Type 'boolean' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'Boolean'. interface I { bar: string } var g: I = x; ~ !!! error TS2322: Type 'boolean' is not assignable to type 'I'. -!!! error TS2322: Property 'bar' is missing in type 'Boolean'. var h: { (): string } = x; ~ diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index 7eb5e6cb897..fd8acaba032 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -2,13 +2,9 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5) tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2322: Type 'number' is not assignable to type 'void'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. - Property 'bar' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. - Property 'baz' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. - Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -32,22 +28,18 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 var e: C = x; ~ !!! error TS2322: Type 'number' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. interface I { bar: string; } var f: I = x; ~ !!! error TS2322: Type 'number' is not assignable to type 'I'. -!!! error TS2322: Property 'bar' is missing in type 'Number'. var g: { baz: string } = 1; ~ !!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index e67106bef92..d7ac2134dc1 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -2,13 +2,9 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5) tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2322: Type 'string' is not assignable to type 'void'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. - Property 'bar' is missing in type 'String'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. - Property 'baz' is missing in type 'Number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. - Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -33,22 +29,18 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 var e: C = x; ~ !!! error TS2322: Type 'string' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'String'. interface I { bar: string; } var f: I = x; ~ !!! error TS2322: Type 'string' is not assignable to type 'I'. -!!! error TS2322: Property 'bar' is missing in type 'String'. var g: { baz: string } = 1; ~ !!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index 9c6be972d3b..af8cec62672 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -4,9 +4,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): er tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2322: Type 'void' is not assignable to type 'C'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. - Property 'baz' is missing in type 'Number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. - Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -42,11 +40,9 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e var g: { baz: string } = 1; ~ !!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/isolatedModulesSourceMap.js.map b/tests/baselines/reference/isolatedModulesSourceMap.js.map index 3d86a0a7144..a6778476dda 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.js.map +++ b/tests/baselines/reference/isolatedModulesSourceMap.js.map @@ -1,2 +1,2 @@ //// [file1.js.map] -{"version":3,"file":"file1.js","sourceRoot":"","sources":["file1.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"file1.js","sourceRoot":"","sources":["file1.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt index 7edf071f5d1..57f604125d3 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt +++ b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt @@ -10,24 +10,27 @@ sourceFile:file1.ts ------------------------------------------------------------------- >>>export var x = 1; 1 > -2 >^^^^^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ -7 > ^^^^^^^^^^^^^^^-> +2 >^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^^^^^-> 1 > > -2 >export var -3 > x -4 > = -5 > 1 -6 > ; +2 >export +3 > var +4 > x +5 > = +6 > 1 +7 > ; 1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(1, 16) Source(2, 16) + SourceIndex(0) -5 >Emitted(1, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(1, 18) Source(2, 18) + SourceIndex(0) +2 >Emitted(1, 8) Source(2, 8) + SourceIndex(0) +3 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +4 >Emitted(1, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(1, 16) Source(2, 16) + SourceIndex(0) +6 >Emitted(1, 17) Source(2, 17) + SourceIndex(0) +7 >Emitted(1, 18) Source(2, 18) + SourceIndex(0) --- >>>//# sourceMappingURL=file1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt index 6e55ff30f04..d98a1e7e7bb 100644 --- a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt +++ b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt @@ -1,14 +1,11 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -tests/cases/compiler/a.js(3,6): error TS1223: 'type' tag already specified. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -==== tests/cases/compiler/a.js (1 errors) ==== +==== tests/cases/compiler/a.js (0 errors) ==== /** * @type {number} * @type {string} - ~~~~ -!!! error TS1223: 'type' tag already specified. */ var v; \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt index bc4d8e903ad..2b5112e1ce2 100644 --- a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -tests/cases/compiler/a.js(1,1): error TS8008: 'type aliases' can only be used in a .ts file. +tests/cases/compiler/a.js(1,6): error TS8008: 'type aliases' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. ==== tests/cases/compiler/a.js (1 errors) ==== type a = b; - ~~~~~~~~~~~ + ~ !!! error TS8008: 'type aliases' can only be used in a .ts file. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt index e73ee46fb89..662eea4d405 100644 --- a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt @@ -1,9 +1,12 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -tests/cases/compiler/a.js(1,10): error TS8016: 'type assertion expressions' can only be used in a .ts file. +tests/cases/compiler/a.js(1,10): error TS17008: JSX element 'string' has no corresponding closing tag. +tests/cases/compiler/a.js(1,27): error TS1005: 'undefined; ~~~~~~ -!!! error TS8016: 'type assertion expressions' can only be used in a .ts file. \ No newline at end of file +!!! error TS17008: JSX element 'string' has no corresponding closing tag. + +!!! error TS1005: 'React : Symbol(React, Decl(jsxEmitAttributeWithPreserve.tsx, 1, 11)) +>foo : Symbol(unknown) >data : Symbol(unknown) diff --git a/tests/baselines/reference/jsxHash.symbols b/tests/baselines/reference/jsxHash.symbols index 8a6ad0849f0..ddba4832d2c 100644 --- a/tests/baselines/reference/jsxHash.symbols +++ b/tests/baselines/reference/jsxHash.symbols @@ -1,34 +1,68 @@ === tests/cases/compiler/jsxHash.tsx === var t02 = {0}#; >t02 : Symbol(t02, Decl(jsxHash.tsx, 0, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) var t03 = #{0}; >t03 : Symbol(t03, Decl(jsxHash.tsx, 1, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) var t04 = #{0}#; >t04 : Symbol(t04, Decl(jsxHash.tsx, 2, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) var t05 = #; >t05 : Symbol(t05, Decl(jsxHash.tsx, 3, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t06 = #; >t06 : Symbol(t06, Decl(jsxHash.tsx, 4, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t07 = ##; >t07 : Symbol(t07, Decl(jsxHash.tsx, 5, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t08 = #; >t08 : Symbol(t08, Decl(jsxHash.tsx, 6, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t09 = ##; >t09 : Symbol(t09, Decl(jsxHash.tsx, 7, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t10 = #; >t10 : Symbol(t10, Decl(jsxHash.tsx, 8, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t11 = #; >t11 : Symbol(t11, Decl(jsxHash.tsx, 9, 3)) +>a : Symbol(unknown) +>i : Symbol(unknown) +>a : Symbol(unknown) var t12 = #; >t12 : Symbol(t12, Decl(jsxHash.tsx, 10, 3)) +>a : Symbol(unknown) +>a : Symbol(unknown) diff --git a/tests/baselines/reference/jsxImportInAttribute.symbols b/tests/baselines/reference/jsxImportInAttribute.symbols index 845001b22c0..252b5cc98e4 100644 --- a/tests/baselines/reference/jsxImportInAttribute.symbols +++ b/tests/baselines/reference/jsxImportInAttribute.symbols @@ -8,6 +8,7 @@ let x = Test; // emit test_1.default >Test : Symbol(Test, Decl(consumer.tsx, 1, 6)) ; // ? +>anything : Symbol(unknown) >attr : Symbol(unknown) >Test : Symbol(Test, Decl(consumer.tsx, 1, 6)) diff --git a/tests/baselines/reference/jsxReactTestSuite.symbols b/tests/baselines/reference/jsxReactTestSuite.symbols index b86054ac560..cca1dae915b 100644 --- a/tests/baselines/reference/jsxReactTestSuite.symbols +++ b/tests/baselines/reference/jsxReactTestSuite.symbols @@ -37,21 +37,36 @@ declare var hasOwnProperty:any; >hasOwnProperty : Symbol(hasOwnProperty, Decl(jsxReactTestSuite.tsx, 12, 11))
text
; +>div : Symbol(unknown) +>div : Symbol(unknown)
+>div : Symbol(unknown) + {this.props.children}
; +>div : Symbol(unknown)
+>div : Symbol(unknown) +

+>div : Symbol(unknown) +>br : Symbol(unknown) +>div : Symbol(unknown) + {foo}
{bar}
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) >foo : Symbol(foo, Decl(jsxReactTestSuite.tsx, 7, 11)) +>br : Symbol(unknown) >bar : Symbol(bar, Decl(jsxReactTestSuite.tsx, 8, 11)) >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
+>br : Symbol(unknown) +
; +>div : Symbol(unknown) @@ -74,6 +89,8 @@ var x = >x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
div : Symbol(unknown) + attr1={ >attr1 : Symbol(unknown) @@ -97,41 +114,64 @@ var x = >attr4 : Symbol(unknown)
; +>div : Symbol(unknown) (
+>div : Symbol(unknown) + {/* A comment at the beginning */} {/* A second comment at the beginning */} +>span : Symbol(unknown) + {/* A nested comment */} +>span : Symbol(unknown) + {/* A sandwiched comment */}
+>br : Symbol(unknown) + {/* A comment at the end */} {/* A second comment at the end */}
+>div : Symbol(unknown) + ); (
div : Symbol(unknown) + /* a multi-line comment */ attr1="foo"> >attr1 : Symbol(unknown) span : Symbol(unknown) + attr2="bar" >attr2 : Symbol(unknown) />
+>div : Symbol(unknown) + );
 
; +>div : Symbol(unknown) +>div : Symbol(unknown)
 
; +>div : Symbol(unknown) +>div : Symbol(unknown) testing; +>hasOwnProperty : Symbol(unknown) +>hasOwnProperty : Symbol(unknown) ; >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) @@ -158,6 +198,7 @@ var x = >sound : Symbol(unknown) ; +>font-face : Symbol(unknown) ; >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) @@ -165,6 +206,7 @@ var x = >y : Symbol(y, Decl(jsxReactTestSuite.tsx, 9, 11)) ; +>x-component : Symbol(unknown) ; >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11)) diff --git a/tests/baselines/reference/keywordInJsxIdentifier.symbols b/tests/baselines/reference/keywordInJsxIdentifier.symbols index 874d7801a7f..3cb977bee81 100644 --- a/tests/baselines/reference/keywordInJsxIdentifier.symbols +++ b/tests/baselines/reference/keywordInJsxIdentifier.symbols @@ -4,14 +4,18 @@ declare var React: any; >React : Symbol(React, Decl(keywordInJsxIdentifier.tsx, 1, 11)) ; +>foo : Symbol(unknown) >class-id : Symbol(unknown) ; +>foo : Symbol(unknown) >class : Symbol(unknown) ; +>foo : Symbol(unknown) >class-id : Symbol(unknown) ; +>foo : Symbol(unknown) >class : Symbol(unknown) diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt index d503f59c602..ab784eae397 100644 --- a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt +++ b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt @@ -1,6 +1,8 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(7,6): error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. Types of property 'thunk' are incompatible. Type '(num: number) => void' is not assignable to type '(str: string) => void'. + Types of parameters 'num' and 'str' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/lastPropertyInLiteralWins.ts(8,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(9,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(13,5): error TS2300: Duplicate identifier 'thunk'. @@ -29,6 +31,8 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate !!! error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. !!! error TS2345: Types of property 'thunk' are incompatible. !!! error TS2345: Type '(num: number) => void' is not assignable to type '(str: string) => void'. +!!! error TS2345: Types of parameters 'num' and 'str' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. test({ // Should be OK. Last 'thunk' is of correct type thunk: (num: number) => {}, diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt index 03e7158f725..a7d07a5b5f2 100644 --- a/tests/baselines/reference/maxConstraints.errors.txt +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. - Property 'compareTo' is missing in type 'Number'. ==== tests/cases/compiler/maxConstraints.ts (1 errors) ==== @@ -12,5 +11,4 @@ tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'nu var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. -!!! error TS2345: Property 'compareTo' is missing in type 'Number'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.errors.txt b/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.errors.txt new file mode 100644 index 00000000000..8e1bc337b39 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.errors.txt @@ -0,0 +1,40 @@ +tests/cases/compiler/map1.ts(7,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map2.ts(6,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. + + +==== tests/cases/compiler/map1.ts (1 errors) ==== + + import { Observable } from "./observable" + + (Observable.prototype).map = function() { } + + declare module "./observable" { + interface I {x0} + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + } + +==== tests/cases/compiler/map2.ts (1 errors) ==== + import { Observable } from "./observable" + + (Observable.prototype).map = function() { } + + declare module "./observable" { + interface I {x1} + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + } + + +==== tests/cases/compiler/observable.ts (0 errors) ==== + export declare class Observable { + filter(pred: (e:T) => boolean): Observable; + } + +==== tests/cases/compiler/main.ts (0 errors) ==== + import { Observable } from "./observable" + import "./map1"; + import "./map2"; + + let x: Observable; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.js b/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.js new file mode 100644 index 00000000000..60ba2217349 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationCollidingNamesInAugmentation1.js @@ -0,0 +1,75 @@ +//// [tests/cases/compiler/moduleAugmentationCollidingNamesInAugmentation1.ts] //// + +//// [map1.ts] + +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface I {x0} +} + +//// [map2.ts] +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface I {x1} +} + + +//// [observable.ts] +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +//// [main.ts] +import { Observable } from "./observable" +import "./map1"; +import "./map2"; + +let x: Observable; + + +//// [observable.js] +define(["require", "exports"], function (require, exports) { + "use strict"; +}); +//// [map1.js] +define(["require", "exports", "./observable"], function (require, exports, observable_1) { + "use strict"; + observable_1.Observable.prototype.map = function () { }; +}); +//// [map2.js] +define(["require", "exports", "./observable"], function (require, exports, observable_1) { + "use strict"; + observable_1.Observable.prototype.map = function () { }; +}); +//// [main.js] +define(["require", "exports", "./map1", "./map2"], function (require, exports) { + "use strict"; + var x; +}); + + +//// [observable.d.ts] +export declare class Observable { + filter(pred: (e: T) => boolean): Observable; +} +//// [map1.d.ts] +declare module "./observable" { + interface I { + x0: any; + } +} +export {}; +//// [map2.d.ts] +declare module "./observable" { + interface I { + x1: any; + } +} +export {}; +//// [main.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit1.js b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.js new file mode 100644 index 00000000000..589d0f506e9 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.js @@ -0,0 +1,68 @@ +//// [tests/cases/compiler/moduleAugmentationDeclarationEmit1.ts] //// + +//// [map.ts] + +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: number; + } +} + +//// [observable.ts] +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + let someValue: number; +} + + +//// [main.ts] +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); + +//// [observable.js] +"use strict"; +var Observable; +(function (Observable) { + var someValue; +})(Observable = exports.Observable || (exports.Observable = {})); +//// [map.js] +"use strict"; +var observable_1 = require("./observable"); +observable_1.Observable.prototype.map = function () { }; +//// [main.js] +"use strict"; +require("./map"); +var x; +var y = x.map(function (x) { return x + 1; }); + + +//// [observable.d.ts] +export declare class Observable { + filter(pred: (e: T) => boolean): Observable; +} +export declare namespace Observable { +} +//// [map.d.ts] +declare module "./observable" { + interface Observable { + map(proj: (e: T) => U): Observable; + } + namespace Observable { + let someAnotherValue: number; + } +} +export {}; +//// [main.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit1.symbols b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.symbols new file mode 100644 index 00000000000..eca44ec774d --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.symbols @@ -0,0 +1,73 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) + +(Observable.prototype).map = function() { } +>Observable.prototype : Symbol(Observable.prototype) +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) +>prototype : Symbol(Observable.prototype) + +declare module "./observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + map(proj: (e:T) => U): Observable +>map : Symbol(map, Decl(map.ts, 6, 29)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>proj : Symbol(proj, Decl(map.ts, 7, 15)) +>e : Symbol(e, Decl(map.ts, 7, 22)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>U : Symbol(U, Decl(map.ts, 7, 12)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + let someAnotherValue: number; +>someAnotherValue : Symbol(someAnotherValue, Decl(map.ts, 10, 11)) + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + filter(pred: (e:T) => boolean): Observable; +>filter : Symbol(filter, Decl(observable.ts, 0, 36)) +>pred : Symbol(pred, Decl(observable.ts, 1, 11)) +>e : Symbol(e, Decl(observable.ts, 1, 18)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +} + +export namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + let someValue: number; +>someValue : Symbol(someValue, Decl(observable.ts, 5, 7)) +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +import "./map"; + +let x: Observable; +>x : Symbol(x, Decl(main.ts, 3, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +let y = x.map(x => x + 1); +>y : Symbol(y, Decl(main.ts, 4, 3)) +>x.map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 3, 3)) +>map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 4, 14)) +>x : Symbol(x, Decl(main.ts, 4, 14)) + diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types new file mode 100644 index 00000000000..fad835029c2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types @@ -0,0 +1,83 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : typeof Observable + +(Observable.prototype).map = function() { } +>(Observable.prototype).map = function() { } : () => void +>(Observable.prototype).map : any +>(Observable.prototype) : any +>Observable.prototype : any +>Observable.prototype : Observable +>Observable : typeof Observable +>prototype : Observable +>map : any +>function() { } : () => void + +declare module "./observable" { + interface Observable { +>Observable : Observable +>T : T + + map(proj: (e:T) => U): Observable +>map : (proj: (e: T) => U) => Observable +>U : U +>proj : (e: T) => U +>e : T +>T : T +>U : U +>Observable : Observable +>U : U + } + namespace Observable { +>Observable : typeof Observable + + let someAnotherValue: number; +>someAnotherValue : number + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Observable +>T : T + + filter(pred: (e:T) => boolean): Observable; +>filter : (pred: (e: T) => boolean) => Observable +>pred : (e: T) => boolean +>e : T +>T : T +>Observable : Observable +>T : T +} + +export namespace Observable { +>Observable : typeof Observable + + let someValue: number; +>someValue : number +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : typeof Observable + +import "./map"; + +let x: Observable; +>x : Observable +>Observable : Observable + +let y = x.map(x => x + 1); +>y : Observable +>x.map(x => x + 1) : Observable +>x.map : (proj: (e: number) => U) => Observable +>x : Observable +>map : (proj: (e: number) => U) => Observable +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : number + diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit2.js b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.js new file mode 100644 index 00000000000..d8fd65a1464 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.js @@ -0,0 +1,73 @@ +//// [tests/cases/compiler/moduleAugmentationDeclarationEmit2.ts] //// + +//// [map.ts] + +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: string; + } +} + +//// [observable.ts] +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + export let someValue: number; +} + + +//// [main.ts] +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); +let z1 = Observable.someValue.toFixed(); +let z2 = Observable.someAnotherValue.toLowerCase(); + +//// [observable.js] +"use strict"; +var Observable; +(function (Observable) { +})(Observable = exports.Observable || (exports.Observable = {})); +//// [map.js] +"use strict"; +var observable_1 = require("./observable"); +observable_1.Observable.prototype.map = function () { }; +//// [main.js] +"use strict"; +var observable_1 = require("./observable"); +require("./map"); +var x; +var y = x.map(function (x) { return x + 1; }); +var z1 = observable_1.Observable.someValue.toFixed(); +var z2 = observable_1.Observable.someAnotherValue.toLowerCase(); + + +//// [observable.d.ts] +export declare class Observable { + filter(pred: (e: T) => boolean): Observable; +} +export declare namespace Observable { + let someValue: number; +} +//// [map.d.ts] +declare module "./observable" { + interface Observable { + map(proj: (e: T) => U): Observable; + } + namespace Observable { + let someAnotherValue: string; + } +} +export {}; +//// [main.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit2.symbols b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.symbols new file mode 100644 index 00000000000..d0f25f693fe --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) + +(Observable.prototype).map = function() { } +>Observable.prototype : Symbol(Observable.prototype) +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) +>prototype : Symbol(Observable.prototype) + +declare module "./observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + map(proj: (e:T) => U): Observable +>map : Symbol(map, Decl(map.ts, 6, 29)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>proj : Symbol(proj, Decl(map.ts, 7, 15)) +>e : Symbol(e, Decl(map.ts, 7, 22)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>U : Symbol(U, Decl(map.ts, 7, 12)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + let someAnotherValue: string; +>someAnotherValue : Symbol(someAnotherValue, Decl(map.ts, 10, 11)) + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + filter(pred: (e:T) => boolean): Observable; +>filter : Symbol(filter, Decl(observable.ts, 0, 36)) +>pred : Symbol(pred, Decl(observable.ts, 1, 11)) +>e : Symbol(e, Decl(observable.ts, 1, 18)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +} + +export namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + export let someValue: number; +>someValue : Symbol(someValue, Decl(observable.ts, 5, 14)) +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +import "./map"; + +let x: Observable; +>x : Symbol(x, Decl(main.ts, 3, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +let y = x.map(x => x + 1); +>y : Symbol(y, Decl(main.ts, 4, 3)) +>x.map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 3, 3)) +>map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 4, 14)) +>x : Symbol(x, Decl(main.ts, 4, 14)) + +let z1 = Observable.someValue.toFixed(); +>z1 : Symbol(z1, Decl(main.ts, 5, 3)) +>Observable.someValue.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>Observable.someValue : Symbol(Observable.someValue, Decl(observable.ts, 5, 14)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) +>someValue : Symbol(Observable.someValue, Decl(observable.ts, 5, 14)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +let z2 = Observable.someAnotherValue.toLowerCase(); +>z2 : Symbol(z2, Decl(main.ts, 6, 3)) +>Observable.someAnotherValue.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>Observable.someAnotherValue : Symbol(Observable.someAnotherValue, Decl(map.ts, 10, 11)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) +>someAnotherValue : Symbol(Observable.someAnotherValue, Decl(map.ts, 10, 11)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types new file mode 100644 index 00000000000..85e4ead2ac0 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types @@ -0,0 +1,101 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : typeof Observable + +(Observable.prototype).map = function() { } +>(Observable.prototype).map = function() { } : () => void +>(Observable.prototype).map : any +>(Observable.prototype) : any +>Observable.prototype : any +>Observable.prototype : Observable +>Observable : typeof Observable +>prototype : Observable +>map : any +>function() { } : () => void + +declare module "./observable" { + interface Observable { +>Observable : Observable +>T : T + + map(proj: (e:T) => U): Observable +>map : (proj: (e: T) => U) => Observable +>U : U +>proj : (e: T) => U +>e : T +>T : T +>U : U +>Observable : Observable +>U : U + } + namespace Observable { +>Observable : typeof Observable + + let someAnotherValue: string; +>someAnotherValue : string + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Observable +>T : T + + filter(pred: (e:T) => boolean): Observable; +>filter : (pred: (e: T) => boolean) => Observable +>pred : (e: T) => boolean +>e : T +>T : T +>Observable : Observable +>T : T +} + +export namespace Observable { +>Observable : typeof Observable + + export let someValue: number; +>someValue : number +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : typeof Observable + +import "./map"; + +let x: Observable; +>x : Observable +>Observable : Observable + +let y = x.map(x => x + 1); +>y : Observable +>x.map(x => x + 1) : Observable +>x.map : (proj: (e: number) => U) => Observable +>x : Observable +>map : (proj: (e: number) => U) => Observable +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : number + +let z1 = Observable.someValue.toFixed(); +>z1 : string +>Observable.someValue.toFixed() : string +>Observable.someValue.toFixed : (fractionDigits?: number) => string +>Observable.someValue : number +>Observable : typeof Observable +>someValue : number +>toFixed : (fractionDigits?: number) => string + +let z2 = Observable.someAnotherValue.toLowerCase(); +>z2 : string +>Observable.someAnotherValue.toLowerCase() : string +>Observable.someAnotherValue.toLowerCase : () => string +>Observable.someAnotherValue : string +>Observable : typeof Observable +>someAnotherValue : string +>toLowerCase : () => string + diff --git a/tests/baselines/reference/moduleAugmentationDisallowedExtensions.errors.txt b/tests/baselines/reference/moduleAugmentationDisallowedExtensions.errors.txt new file mode 100644 index 00000000000..571b288c04a --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDisallowedExtensions.errors.txt @@ -0,0 +1,117 @@ +tests/cases/compiler/x.ts(7,9): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(8,9): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(9,11): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,10): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,14): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,23): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,38): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,43): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(10,48): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(11,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(12,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(15,11): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(16,14): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(17,10): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/x.ts(18,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/x.ts(18,26): error TS2307: Cannot find module './x0'. +tests/cases/compiler/x.ts(19,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/x.ts(19,21): error TS2307: Cannot find module './x0'. +tests/cases/compiler/x.ts(20,5): error TS2666: Exports and export assignments are not permitted in module augmentations. +tests/cases/compiler/x.ts(20,19): error TS2307: Cannot find module './x0'. +tests/cases/compiler/x.ts(21,5): error TS2666: Exports and export assignments are not permitted in module augmentations. +tests/cases/compiler/x.ts(21,21): error TS2307: Cannot find module './x0'. +tests/cases/compiler/x.ts(25,5): error TS2666: Exports and export assignments are not permitted in module augmentations. + + +==== tests/cases/compiler/x0.ts (0 errors) ==== + + export let a = 1; + +==== tests/cases/compiler/x.ts (23 errors) ==== + + namespace N1 { + export let x = 1; + } + + declare module "./observable" { + var x: number; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + let y: number; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + const z: number; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + let {x1, y1, z0: {n}, z1: {arr: [el1, el2, el3]}}: {x1: number, y1: string, z0: {n: number}, z1: {arr: number[]} } + ~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + interface A { x } + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + namespace N { + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + export class C {} + } + class Cls {} + ~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + function foo(): number; + ~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + type T = number; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + import * as all from "./x0"; + ~~~~~~ +!!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. + ~~~~~~ +!!! error TS2307: Cannot find module './x0'. + import {a} from "./x0"; + ~~~~~~ +!!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. + ~~~~~~ +!!! error TS2307: Cannot find module './x0'. + export * from "./x0"; + ~~~~~~ +!!! error TS2666: Exports and export assignments are not permitted in module augmentations. + ~~~~~~ +!!! error TS2307: Cannot find module './x0'. + export {a} from "./x0"; + ~~~~~~ +!!! error TS2666: Exports and export assignments are not permitted in module augmentations. + ~~~~~~ +!!! error TS2307: Cannot find module './x0'. + } + + declare module "./test" { + export = N1; + ~~~~~~ +!!! error TS2666: Exports and export assignments are not permitted in module augmentations. + } + export {} + +==== tests/cases/compiler/observable.ts (0 errors) ==== + export declare class Observable { + filter(pred: (e:T) => boolean): Observable; + } + export var x = 1; + +==== tests/cases/compiler/test.ts (0 errors) ==== + export let b = 1; + +==== tests/cases/compiler/main.ts (0 errors) ==== + import { Observable } from "./observable" + import "./x"; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationDisallowedExtensions.js b/tests/baselines/reference/moduleAugmentationDisallowedExtensions.js new file mode 100644 index 00000000000..8c497d63c42 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationDisallowedExtensions.js @@ -0,0 +1,67 @@ +//// [tests/cases/compiler/moduleAugmentationDisallowedExtensions.ts] //// + +//// [x0.ts] + +export let a = 1; + +//// [x.ts] + +namespace N1 { + export let x = 1; +} + +declare module "./observable" { + var x: number; + let y: number; + const z: number; + let {x1, y1, z0: {n}, z1: {arr: [el1, el2, el3]}}: {x1: number, y1: string, z0: {n: number}, z1: {arr: number[]} } + interface A { x } + namespace N { + export class C {} + } + class Cls {} + function foo(): number; + type T = number; + import * as all from "./x0"; + import {a} from "./x0"; + export * from "./x0"; + export {a} from "./x0"; +} + +declare module "./test" { + export = N1; +} +export {} + +//// [observable.ts] +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} +export var x = 1; + +//// [test.ts] +export let b = 1; + +//// [main.ts] +import { Observable } from "./observable" +import "./x"; + + +//// [x0.js] +"use strict"; +exports.a = 1; +//// [x.js] +"use strict"; +var N1; +(function (N1) { + N1.x = 1; +})(N1 || (N1 = {})); +//// [observable.js] +"use strict"; +exports.x = 1; +//// [test.js] +"use strict"; +exports.b = 1; +//// [main.js] +"use strict"; +require("./x"); diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.js b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.js new file mode 100644 index 00000000000..0a8b1b0b4b5 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.js @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/moduleAugmentationExtendAmbientModule1.ts] //// + +//// [map.ts] + +import { Observable } from "observable" + +(Observable.prototype).map = function() { } + +declare module "observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: number; + } +} + +//// [observable.d.ts] +declare module "observable" { + class Observable { + filter(pred: (e:T) => boolean): Observable; + } + namespace Observable { + let someValue: number; + } +} + +//// [main.ts] + +/// +import { Observable } from "observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); + +//// [map.js] +"use strict"; +var observable_1 = require("observable"); +observable_1.Observable.prototype.map = function () { }; +//// [main.js] +"use strict"; +require("./map"); +var x; +var y = x.map(function (x) { return x + 1; }); diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.symbols b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.symbols new file mode 100644 index 00000000000..a471651da0b --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.symbols @@ -0,0 +1,75 @@ +=== tests/cases/compiler/main.ts === + +/// +import { Observable } from "observable" +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +import "./map"; + +let x: Observable; +>x : Symbol(x, Decl(main.ts, 5, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +let y = x.map(x => x + 1); +>y : Symbol(y, Decl(main.ts, 6, 3)) +>x.map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 5, 3)) +>map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 6, 14)) +>x : Symbol(x, Decl(main.ts, 6, 14)) + +=== tests/cases/compiler/map.ts === + +import { Observable } from "observable" +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) + +(Observable.prototype).map = function() { } +>Observable.prototype : Symbol(Observable.prototype) +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) +>prototype : Symbol(Observable.prototype) + +declare module "observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) + + map(proj: (e:T) => U): Observable +>map : Symbol(map, Decl(map.ts, 6, 29)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>proj : Symbol(proj, Decl(map.ts, 7, 15)) +>e : Symbol(e, Decl(map.ts, 7, 22)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>U : Symbol(U, Decl(map.ts, 7, 12)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) + + let someAnotherValue: number; +>someAnotherValue : Symbol(someAnotherValue, Decl(map.ts, 10, 11)) + } +} + +=== tests/cases/compiler/observable.d.ts === +declare module "observable" { + class Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) + + filter(pred: (e:T) => boolean): Observable; +>filter : Symbol(filter, Decl(observable.d.ts, 1, 25)) +>pred : Symbol(pred, Decl(observable.d.ts, 2, 15)) +>e : Symbol(e, Decl(observable.d.ts, 2, 22)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) + + let someValue: number; +>someValue : Symbol(someValue, Decl(observable.d.ts, 5, 11)) + } +} + diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types new file mode 100644 index 00000000000..e6ee79e3585 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types @@ -0,0 +1,85 @@ +=== tests/cases/compiler/main.ts === + +/// +import { Observable } from "observable" +>Observable : typeof Observable + +import "./map"; + +let x: Observable; +>x : Observable +>Observable : Observable + +let y = x.map(x => x + 1); +>y : Observable +>x.map(x => x + 1) : Observable +>x.map : (proj: (e: number) => U) => Observable +>x : Observable +>map : (proj: (e: number) => U) => Observable +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : number + +=== tests/cases/compiler/map.ts === + +import { Observable } from "observable" +>Observable : typeof Observable + +(Observable.prototype).map = function() { } +>(Observable.prototype).map = function() { } : () => void +>(Observable.prototype).map : any +>(Observable.prototype) : any +>Observable.prototype : any +>Observable.prototype : Observable +>Observable : typeof Observable +>prototype : Observable +>map : any +>function() { } : () => void + +declare module "observable" { + interface Observable { +>Observable : Observable +>T : T + + map(proj: (e:T) => U): Observable +>map : (proj: (e: T) => U) => Observable +>U : U +>proj : (e: T) => U +>e : T +>T : T +>U : U +>Observable : Observable +>U : U + } + namespace Observable { +>Observable : typeof Observable + + let someAnotherValue: number; +>someAnotherValue : number + } +} + +=== tests/cases/compiler/observable.d.ts === +declare module "observable" { + class Observable { +>Observable : Observable +>T : T + + filter(pred: (e:T) => boolean): Observable; +>filter : (pred: (e: T) => boolean) => Observable +>pred : (e: T) => boolean +>e : T +>T : T +>Observable : Observable +>T : T + } + namespace Observable { +>Observable : typeof Observable + + let someValue: number; +>someValue : number + } +} + diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.js b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.js new file mode 100644 index 00000000000..733f88e6129 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.js @@ -0,0 +1,65 @@ +//// [tests/cases/compiler/moduleAugmentationExtendAmbientModule2.ts] //// + +//// [map.ts] + +import { Observable } from "observable" + +(Observable.prototype).map = function() { } + +declare module "observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: string; + } +} + +//// [observable.d.ts] +declare module "observable" { + class Observable { + filter(pred: (e:T) => boolean): Observable; + } + namespace Observable { + export let someValue: number; + } +} + +//// [main.ts] + +/// +import { Observable } from "observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); +let z1 = Observable.someValue.toFixed(); +let z2 = Observable.someAnotherValue.toLowerCase(); + +//// [map.js] +"use strict"; +var observable_1 = require("observable"); +observable_1.Observable.prototype.map = function () { }; +//// [main.js] +"use strict"; +/// +var observable_1 = require("observable"); +require("./map"); +var x; +var y = x.map(function (x) { return x + 1; }); +var z1 = observable_1.Observable.someValue.toFixed(); +var z2 = observable_1.Observable.someAnotherValue.toLowerCase(); + + +//// [map.d.ts] +declare module "observable" { + interface Observable { + map(proj: (e: T) => U): Observable; + } + namespace Observable { + let someAnotherValue: string; + } +} +export {}; +//// [main.d.ts] +/// diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.symbols b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.symbols new file mode 100644 index 00000000000..f907f4d6979 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/main.ts === + +/// +import { Observable } from "observable" +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +import "./map"; + +let x: Observable; +>x : Symbol(x, Decl(main.ts, 5, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +let y = x.map(x => x + 1); +>y : Symbol(y, Decl(main.ts, 6, 3)) +>x.map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 5, 3)) +>map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 6, 14)) +>x : Symbol(x, Decl(main.ts, 6, 14)) + +let z1 = Observable.someValue.toFixed(); +>z1 : Symbol(z1, Decl(main.ts, 7, 3)) +>Observable.someValue.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>Observable.someValue : Symbol(Observable.someValue, Decl(observable.d.ts, 5, 18)) +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) +>someValue : Symbol(Observable.someValue, Decl(observable.d.ts, 5, 18)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +let z2 = Observable.someAnotherValue.toLowerCase(); +>z2 : Symbol(z2, Decl(main.ts, 8, 3)) +>Observable.someAnotherValue.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>Observable.someAnotherValue : Symbol(Observable.someAnotherValue, Decl(map.ts, 10, 11)) +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) +>someAnotherValue : Symbol(Observable.someAnotherValue, Decl(map.ts, 10, 11)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + +=== tests/cases/compiler/map.ts === + +import { Observable } from "observable" +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) + +(Observable.prototype).map = function() { } +>Observable.prototype : Symbol(Observable.prototype) +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) +>prototype : Symbol(Observable.prototype) + +declare module "observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) + + map(proj: (e:T) => U): Observable +>map : Symbol(map, Decl(map.ts, 6, 29)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>proj : Symbol(proj, Decl(map.ts, 7, 15)) +>e : Symbol(e, Decl(map.ts, 7, 22)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>U : Symbol(U, Decl(map.ts, 7, 12)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) + + let someAnotherValue: string; +>someAnotherValue : Symbol(someAnotherValue, Decl(map.ts, 10, 11)) + } +} + +=== tests/cases/compiler/observable.d.ts === +declare module "observable" { + class Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) + + filter(pred: (e:T) => boolean): Observable; +>filter : Symbol(filter, Decl(observable.d.ts, 1, 25)) +>pred : Symbol(pred, Decl(observable.d.ts, 2, 15)) +>e : Symbol(e, Decl(observable.d.ts, 2, 22)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.d.ts, 1, 21), Decl(map.ts, 6, 25)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.d.ts, 0, 29), Decl(observable.d.ts, 3, 5), Decl(map.ts, 5, 29), Decl(map.ts, 8, 5)) + + export let someValue: number; +>someValue : Symbol(someValue, Decl(observable.d.ts, 5, 18)) + } +} + diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types new file mode 100644 index 00000000000..70288e48f02 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types @@ -0,0 +1,103 @@ +=== tests/cases/compiler/main.ts === + +/// +import { Observable } from "observable" +>Observable : typeof Observable + +import "./map"; + +let x: Observable; +>x : Observable +>Observable : Observable + +let y = x.map(x => x + 1); +>y : Observable +>x.map(x => x + 1) : Observable +>x.map : (proj: (e: number) => U) => Observable +>x : Observable +>map : (proj: (e: number) => U) => Observable +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : number + +let z1 = Observable.someValue.toFixed(); +>z1 : string +>Observable.someValue.toFixed() : string +>Observable.someValue.toFixed : (fractionDigits?: number) => string +>Observable.someValue : number +>Observable : typeof Observable +>someValue : number +>toFixed : (fractionDigits?: number) => string + +let z2 = Observable.someAnotherValue.toLowerCase(); +>z2 : string +>Observable.someAnotherValue.toLowerCase() : string +>Observable.someAnotherValue.toLowerCase : () => string +>Observable.someAnotherValue : string +>Observable : typeof Observable +>someAnotherValue : string +>toLowerCase : () => string + +=== tests/cases/compiler/map.ts === + +import { Observable } from "observable" +>Observable : typeof Observable + +(Observable.prototype).map = function() { } +>(Observable.prototype).map = function() { } : () => void +>(Observable.prototype).map : any +>(Observable.prototype) : any +>Observable.prototype : any +>Observable.prototype : Observable +>Observable : typeof Observable +>prototype : Observable +>map : any +>function() { } : () => void + +declare module "observable" { + interface Observable { +>Observable : Observable +>T : T + + map(proj: (e:T) => U): Observable +>map : (proj: (e: T) => U) => Observable +>U : U +>proj : (e: T) => U +>e : T +>T : T +>U : U +>Observable : Observable +>U : U + } + namespace Observable { +>Observable : typeof Observable + + let someAnotherValue: string; +>someAnotherValue : string + } +} + +=== tests/cases/compiler/observable.d.ts === +declare module "observable" { + class Observable { +>Observable : Observable +>T : T + + filter(pred: (e:T) => boolean): Observable; +>filter : (pred: (e: T) => boolean) => Observable +>pred : (e: T) => boolean +>e : T +>T : T +>Observable : Observable +>T : T + } + namespace Observable { +>Observable : typeof Observable + + export let someValue: number; +>someValue : number + } +} + diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule1.js b/tests/baselines/reference/moduleAugmentationExtendFileModule1.js new file mode 100644 index 00000000000..a539100c2ed --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule1.js @@ -0,0 +1,49 @@ +//// [tests/cases/compiler/moduleAugmentationExtendFileModule1.ts] //// + +//// [map.ts] + +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: number; + } +} + +//// [observable.ts] +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + let someValue: number; +} + + +//// [main.ts] +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); + +//// [observable.js] +"use strict"; +var Observable; +(function (Observable) { + var someValue; +})(Observable = exports.Observable || (exports.Observable = {})); +//// [map.js] +"use strict"; +var observable_1 = require("./observable"); +observable_1.Observable.prototype.map = function () { }; +//// [main.js] +"use strict"; +require("./map"); +var x; +var y = x.map(function (x) { return x + 1; }); diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule1.symbols b/tests/baselines/reference/moduleAugmentationExtendFileModule1.symbols new file mode 100644 index 00000000000..eca44ec774d --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule1.symbols @@ -0,0 +1,73 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) + +(Observable.prototype).map = function() { } +>Observable.prototype : Symbol(Observable.prototype) +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) +>prototype : Symbol(Observable.prototype) + +declare module "./observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + map(proj: (e:T) => U): Observable +>map : Symbol(map, Decl(map.ts, 6, 29)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>proj : Symbol(proj, Decl(map.ts, 7, 15)) +>e : Symbol(e, Decl(map.ts, 7, 22)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>U : Symbol(U, Decl(map.ts, 7, 12)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + let someAnotherValue: number; +>someAnotherValue : Symbol(someAnotherValue, Decl(map.ts, 10, 11)) + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + filter(pred: (e:T) => boolean): Observable; +>filter : Symbol(filter, Decl(observable.ts, 0, 36)) +>pred : Symbol(pred, Decl(observable.ts, 1, 11)) +>e : Symbol(e, Decl(observable.ts, 1, 18)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +} + +export namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + let someValue: number; +>someValue : Symbol(someValue, Decl(observable.ts, 5, 7)) +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +import "./map"; + +let x: Observable; +>x : Symbol(x, Decl(main.ts, 3, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +let y = x.map(x => x + 1); +>y : Symbol(y, Decl(main.ts, 4, 3)) +>x.map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 3, 3)) +>map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 4, 14)) +>x : Symbol(x, Decl(main.ts, 4, 14)) + diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule1.types b/tests/baselines/reference/moduleAugmentationExtendFileModule1.types new file mode 100644 index 00000000000..fad835029c2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule1.types @@ -0,0 +1,83 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : typeof Observable + +(Observable.prototype).map = function() { } +>(Observable.prototype).map = function() { } : () => void +>(Observable.prototype).map : any +>(Observable.prototype) : any +>Observable.prototype : any +>Observable.prototype : Observable +>Observable : typeof Observable +>prototype : Observable +>map : any +>function() { } : () => void + +declare module "./observable" { + interface Observable { +>Observable : Observable +>T : T + + map(proj: (e:T) => U): Observable +>map : (proj: (e: T) => U) => Observable +>U : U +>proj : (e: T) => U +>e : T +>T : T +>U : U +>Observable : Observable +>U : U + } + namespace Observable { +>Observable : typeof Observable + + let someAnotherValue: number; +>someAnotherValue : number + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Observable +>T : T + + filter(pred: (e:T) => boolean): Observable; +>filter : (pred: (e: T) => boolean) => Observable +>pred : (e: T) => boolean +>e : T +>T : T +>Observable : Observable +>T : T +} + +export namespace Observable { +>Observable : typeof Observable + + let someValue: number; +>someValue : number +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : typeof Observable + +import "./map"; + +let x: Observable; +>x : Observable +>Observable : Observable + +let y = x.map(x => x + 1); +>y : Observable +>x.map(x => x + 1) : Observable +>x.map : (proj: (e: number) => U) => Observable +>x : Observable +>map : (proj: (e: number) => U) => Observable +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : number + diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule2.js b/tests/baselines/reference/moduleAugmentationExtendFileModule2.js new file mode 100644 index 00000000000..389f2119aba --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule2.js @@ -0,0 +1,53 @@ +//// [tests/cases/compiler/moduleAugmentationExtendFileModule2.ts] //// + +//// [map.ts] + +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: string; + } +} + +//// [observable.ts] +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + export let someValue: number; +} + + +//// [main.ts] +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); +let z1 = Observable.someValue.toFixed(); +let z2 = Observable.someAnotherValue.toLowerCase(); + +//// [observable.js] +"use strict"; +var Observable; +(function (Observable) { +})(Observable = exports.Observable || (exports.Observable = {})); +//// [map.js] +"use strict"; +var observable_1 = require("./observable"); +observable_1.Observable.prototype.map = function () { }; +//// [main.js] +"use strict"; +var observable_1 = require("./observable"); +require("./map"); +var x; +var y = x.map(function (x) { return x + 1; }); +var z1 = observable_1.Observable.someValue.toFixed(); +var z2 = observable_1.Observable.someAnotherValue.toLowerCase(); diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule2.symbols b/tests/baselines/reference/moduleAugmentationExtendFileModule2.symbols new file mode 100644 index 00000000000..d0f25f693fe --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule2.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) + +(Observable.prototype).map = function() { } +>Observable.prototype : Symbol(Observable.prototype) +>Observable : Symbol(Observable, Decl(map.ts, 1, 8)) +>prototype : Symbol(Observable.prototype) + +declare module "./observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + map(proj: (e:T) => U): Observable +>map : Symbol(map, Decl(map.ts, 6, 29)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>proj : Symbol(proj, Decl(map.ts, 7, 15)) +>e : Symbol(e, Decl(map.ts, 7, 22)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>U : Symbol(U, Decl(map.ts, 7, 12)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>U : Symbol(U, Decl(map.ts, 7, 12)) + } + namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + let someAnotherValue: string; +>someAnotherValue : Symbol(someAnotherValue, Decl(map.ts, 10, 11)) + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) + + filter(pred: (e:T) => boolean): Observable; +>filter : Symbol(filter, Decl(observable.ts, 0, 36)) +>pred : Symbol(pred, Decl(observable.ts, 1, 11)) +>e : Symbol(e, Decl(observable.ts, 1, 18)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) +>T : Symbol(T, Decl(observable.ts, 0, 32), Decl(map.ts, 6, 25)) +} + +export namespace Observable { +>Observable : Symbol(Observable, Decl(observable.ts, 0, 0), Decl(observable.ts, 2, 1), Decl(map.ts, 5, 31), Decl(map.ts, 8, 5)) + + export let someValue: number; +>someValue : Symbol(someValue, Decl(observable.ts, 5, 14)) +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +import "./map"; + +let x: Observable; +>x : Symbol(x, Decl(main.ts, 3, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) + +let y = x.map(x => x + 1); +>y : Symbol(y, Decl(main.ts, 4, 3)) +>x.map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 3, 3)) +>map : Symbol(Observable.map, Decl(map.ts, 6, 29)) +>x : Symbol(x, Decl(main.ts, 4, 14)) +>x : Symbol(x, Decl(main.ts, 4, 14)) + +let z1 = Observable.someValue.toFixed(); +>z1 : Symbol(z1, Decl(main.ts, 5, 3)) +>Observable.someValue.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>Observable.someValue : Symbol(Observable.someValue, Decl(observable.ts, 5, 14)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) +>someValue : Symbol(Observable.someValue, Decl(observable.ts, 5, 14)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +let z2 = Observable.someAnotherValue.toLowerCase(); +>z2 : Symbol(z2, Decl(main.ts, 6, 3)) +>Observable.someAnotherValue.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>Observable.someAnotherValue : Symbol(Observable.someAnotherValue, Decl(map.ts, 10, 11)) +>Observable : Symbol(Observable, Decl(main.ts, 0, 8)) +>someAnotherValue : Symbol(Observable.someAnotherValue, Decl(map.ts, 10, 11)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule2.types b/tests/baselines/reference/moduleAugmentationExtendFileModule2.types new file mode 100644 index 00000000000..85e4ead2ac0 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule2.types @@ -0,0 +1,101 @@ +=== tests/cases/compiler/map.ts === + +import { Observable } from "./observable" +>Observable : typeof Observable + +(Observable.prototype).map = function() { } +>(Observable.prototype).map = function() { } : () => void +>(Observable.prototype).map : any +>(Observable.prototype) : any +>Observable.prototype : any +>Observable.prototype : Observable +>Observable : typeof Observable +>prototype : Observable +>map : any +>function() { } : () => void + +declare module "./observable" { + interface Observable { +>Observable : Observable +>T : T + + map(proj: (e:T) => U): Observable +>map : (proj: (e: T) => U) => Observable +>U : U +>proj : (e: T) => U +>e : T +>T : T +>U : U +>Observable : Observable +>U : U + } + namespace Observable { +>Observable : typeof Observable + + let someAnotherValue: string; +>someAnotherValue : string + } +} + +=== tests/cases/compiler/observable.ts === +export declare class Observable { +>Observable : Observable +>T : T + + filter(pred: (e:T) => boolean): Observable; +>filter : (pred: (e: T) => boolean) => Observable +>pred : (e: T) => boolean +>e : T +>T : T +>Observable : Observable +>T : T +} + +export namespace Observable { +>Observable : typeof Observable + + export let someValue: number; +>someValue : number +} + + +=== tests/cases/compiler/main.ts === +import { Observable } from "./observable" +>Observable : typeof Observable + +import "./map"; + +let x: Observable; +>x : Observable +>Observable : Observable + +let y = x.map(x => x + 1); +>y : Observable +>x.map(x => x + 1) : Observable +>x.map : (proj: (e: number) => U) => Observable +>x : Observable +>map : (proj: (e: number) => U) => Observable +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : number + +let z1 = Observable.someValue.toFixed(); +>z1 : string +>Observable.someValue.toFixed() : string +>Observable.someValue.toFixed : (fractionDigits?: number) => string +>Observable.someValue : number +>Observable : typeof Observable +>someValue : number +>toFixed : (fractionDigits?: number) => string + +let z2 = Observable.someAnotherValue.toLowerCase(); +>z2 : string +>Observable.someAnotherValue.toLowerCase() : string +>Observable.someAnotherValue.toLowerCase : () => string +>Observable.someAnotherValue : string +>Observable : typeof Observable +>someAnotherValue : string +>toLowerCase : () => string + diff --git a/tests/baselines/reference/moduleAugmentationGlobal1.js b/tests/baselines/reference/moduleAugmentationGlobal1.js new file mode 100644 index 00000000000..99351642a18 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal1.js @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/moduleAugmentationGlobal1.ts] //// + +//// [f1.ts] + +export class A {x: number;} + +//// [f2.ts] +import {A} from "./f1"; + +// change the shape of Array +declare global { + interface Array { + getA(): A; + } +} + +let x = [1]; +let y = x.getA().x; + + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +//// [f2.js] +"use strict"; +var x = [1]; +var y = x.getA().x; + + +//// [f1.d.ts] +export declare class A { + x: number; +} +//// [f2.d.ts] +import { A } from "./f1"; +declare global { + interface Array { + getA(): A; + } +} diff --git a/tests/baselines/reference/moduleAugmentationGlobal1.symbols b/tests/baselines/reference/moduleAugmentationGlobal1.symbols new file mode 100644 index 00000000000..36139555c96 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal1.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/f1.ts === + +export class A {x: number;} +>A : Symbol(A, Decl(f1.ts, 0, 0)) +>x : Symbol(x, Decl(f1.ts, 1, 16)) + +=== tests/cases/compiler/f2.ts === +import {A} from "./f1"; +>A : Symbol(A, Decl(f2.ts, 0, 8)) + +// change the shape of Array +declare global { +>global : Symbol(, Decl(f2.ts, 0, 23)) + + interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(f2.ts, 3, 16)) +>T : Symbol(T, Decl(lib.d.ts, --, --), Decl(f2.ts, 4, 20)) + + getA(): A; +>getA : Symbol(getA, Decl(f2.ts, 4, 24)) +>A : Symbol(A, Decl(f2.ts, 0, 8)) + } +} + +let x = [1]; +>x : Symbol(x, Decl(f2.ts, 9, 3)) + +let y = x.getA().x; +>y : Symbol(y, Decl(f2.ts, 10, 3)) +>x.getA().x : Symbol(A.x, Decl(f1.ts, 1, 16)) +>x.getA : Symbol(Array.getA, Decl(f2.ts, 4, 24)) +>x : Symbol(x, Decl(f2.ts, 9, 3)) +>getA : Symbol(Array.getA, Decl(f2.ts, 4, 24)) +>x : Symbol(A.x, Decl(f1.ts, 1, 16)) + diff --git a/tests/baselines/reference/moduleAugmentationGlobal1.types b/tests/baselines/reference/moduleAugmentationGlobal1.types new file mode 100644 index 00000000000..c1742edd7c0 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal1.types @@ -0,0 +1,38 @@ +=== tests/cases/compiler/f1.ts === + +export class A {x: number;} +>A : A +>x : number + +=== tests/cases/compiler/f2.ts === +import {A} from "./f1"; +>A : typeof A + +// change the shape of Array +declare global { +>global : typeof + + interface Array { +>Array : T[] +>T : T + + getA(): A; +>getA : () => A +>A : A + } +} + +let x = [1]; +>x : number[] +>[1] : number[] +>1 : number + +let y = x.getA().x; +>y : number +>x.getA().x : number +>x.getA() : A +>x.getA : () => A +>x : number[] +>getA : () => A +>x : number + diff --git a/tests/baselines/reference/moduleAugmentationGlobal2.js b/tests/baselines/reference/moduleAugmentationGlobal2.js new file mode 100644 index 00000000000..90e8373302e --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal2.js @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/moduleAugmentationGlobal2.ts] //// + +//// [f1.ts] + +export class A {}; +//// [f2.ts] + +// change the shape of Array +import {A} from "./f1"; + +declare global { + interface Array { + getCountAsString(): string; + } +} + +let x = [1]; +let y = x.getCountAsString().toLowerCase(); + + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +; +//// [f2.js] +"use strict"; +var x = [1]; +var y = x.getCountAsString().toLowerCase(); + + +//// [f1.d.ts] +export declare class A { +} +//// [f2.d.ts] +declare global { + interface Array { + getCountAsString(): string; + } +} +export {}; diff --git a/tests/baselines/reference/moduleAugmentationGlobal2.symbols b/tests/baselines/reference/moduleAugmentationGlobal2.symbols new file mode 100644 index 00000000000..4ee2b9bace8 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal2.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/f1.ts === + +export class A {}; +>A : Symbol(A, Decl(f1.ts, 0, 0)) + +=== tests/cases/compiler/f2.ts === + +// change the shape of Array +import {A} from "./f1"; +>A : Symbol(A, Decl(f2.ts, 2, 8)) + +declare global { +>global : Symbol(, Decl(f2.ts, 2, 23)) + + interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(f2.ts, 4, 16)) +>T : Symbol(T, Decl(lib.d.ts, --, --), Decl(f2.ts, 5, 20)) + + getCountAsString(): string; +>getCountAsString : Symbol(getCountAsString, Decl(f2.ts, 5, 24)) + } +} + +let x = [1]; +>x : Symbol(x, Decl(f2.ts, 10, 3)) + +let y = x.getCountAsString().toLowerCase(); +>y : Symbol(y, Decl(f2.ts, 11, 3)) +>x.getCountAsString().toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>x.getCountAsString : Symbol(Array.getCountAsString, Decl(f2.ts, 5, 24)) +>x : Symbol(x, Decl(f2.ts, 10, 3)) +>getCountAsString : Symbol(Array.getCountAsString, Decl(f2.ts, 5, 24)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/moduleAugmentationGlobal2.types b/tests/baselines/reference/moduleAugmentationGlobal2.types new file mode 100644 index 00000000000..36ef480d8b2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal2.types @@ -0,0 +1,38 @@ +=== tests/cases/compiler/f1.ts === + +export class A {}; +>A : A + +=== tests/cases/compiler/f2.ts === + +// change the shape of Array +import {A} from "./f1"; +>A : typeof A + +declare global { +>global : typeof + + interface Array { +>Array : T[] +>T : T + + getCountAsString(): string; +>getCountAsString : () => string + } +} + +let x = [1]; +>x : number[] +>[1] : number[] +>1 : number + +let y = x.getCountAsString().toLowerCase(); +>y : string +>x.getCountAsString().toLowerCase() : string +>x.getCountAsString().toLowerCase : () => string +>x.getCountAsString() : string +>x.getCountAsString : () => string +>x : number[] +>getCountAsString : () => string +>toLowerCase : () => string + diff --git a/tests/baselines/reference/moduleAugmentationGlobal3.js b/tests/baselines/reference/moduleAugmentationGlobal3.js new file mode 100644 index 00000000000..4cff75f5df0 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal3.js @@ -0,0 +1,52 @@ +//// [tests/cases/compiler/moduleAugmentationGlobal3.ts] //// + +//// [f1.ts] + +export class A {}; +//// [f2.ts] + +// change the shape of Array +import {A} from "./f1"; + +declare global { + interface Array { + getCountAsString(): string; + } +} + +//// [f3.ts] +import "./f2"; + +let x = [1]; +let y = x.getCountAsString().toLowerCase(); + + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +; +//// [f2.js] +"use strict"; +//// [f3.js] +"use strict"; +require("./f2"); +var x = [1]; +var y = x.getCountAsString().toLowerCase(); + + +//// [f1.d.ts] +export declare class A { +} +//// [f2.d.ts] +declare global { + interface Array { + getCountAsString(): string; + } +} +export {}; +//// [f3.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationGlobal3.symbols b/tests/baselines/reference/moduleAugmentationGlobal3.symbols new file mode 100644 index 00000000000..acb9a7b9e58 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal3.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/f1.ts === + +export class A {}; +>A : Symbol(A, Decl(f1.ts, 0, 0)) + +=== tests/cases/compiler/f2.ts === + +// change the shape of Array +import {A} from "./f1"; +>A : Symbol(A, Decl(f2.ts, 2, 8)) + +declare global { +>global : Symbol(, Decl(f2.ts, 2, 23)) + + interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(f2.ts, 4, 16)) +>T : Symbol(T, Decl(lib.d.ts, --, --), Decl(f2.ts, 5, 20)) + + getCountAsString(): string; +>getCountAsString : Symbol(getCountAsString, Decl(f2.ts, 5, 24)) + } +} + +=== tests/cases/compiler/f3.ts === +import "./f2"; + +let x = [1]; +>x : Symbol(x, Decl(f3.ts, 2, 3)) + +let y = x.getCountAsString().toLowerCase(); +>y : Symbol(y, Decl(f3.ts, 3, 3)) +>x.getCountAsString().toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>x.getCountAsString : Symbol(Array.getCountAsString, Decl(f2.ts, 5, 24)) +>x : Symbol(x, Decl(f3.ts, 2, 3)) +>getCountAsString : Symbol(Array.getCountAsString, Decl(f2.ts, 5, 24)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/moduleAugmentationGlobal3.types b/tests/baselines/reference/moduleAugmentationGlobal3.types new file mode 100644 index 00000000000..58d7f30faab --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal3.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/f1.ts === + +export class A {}; +>A : A + +=== tests/cases/compiler/f2.ts === + +// change the shape of Array +import {A} from "./f1"; +>A : typeof A + +declare global { +>global : typeof + + interface Array { +>Array : T[] +>T : T + + getCountAsString(): string; +>getCountAsString : () => string + } +} + +=== tests/cases/compiler/f3.ts === +import "./f2"; + +let x = [1]; +>x : number[] +>[1] : number[] +>1 : number + +let y = x.getCountAsString().toLowerCase(); +>y : string +>x.getCountAsString().toLowerCase() : string +>x.getCountAsString().toLowerCase : () => string +>x.getCountAsString() : string +>x.getCountAsString : () => string +>x : number[] +>getCountAsString : () => string +>toLowerCase : () => string + diff --git a/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt new file mode 100644 index 00000000000..fd3444f56b1 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal4.errors.txt @@ -0,0 +1,25 @@ +tests/cases/compiler/f1.ts(3,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f2.ts(3,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. + + +==== tests/cases/compiler/f1.ts (1 errors) ==== + + declare global { + interface Something {x} + ~~~~~~~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + } + export {}; +==== tests/cases/compiler/f2.ts (1 errors) ==== + + declare global { + interface Something {y} + ~~~~~~~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + } + export {}; +==== tests/cases/compiler/f3.ts (0 errors) ==== + import "./f1"; + import "./f2"; + + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal4.js b/tests/baselines/reference/moduleAugmentationGlobal4.js new file mode 100644 index 00000000000..11c5d968df2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal4.js @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/moduleAugmentationGlobal4.ts] //// + +//// [f1.ts] + +declare global { + interface Something {x} +} +export {}; +//// [f2.ts] + +declare global { + interface Something {y} +} +export {}; +//// [f3.ts] +import "./f1"; +import "./f2"; + + + +//// [f1.js] +"use strict"; +//// [f2.js] +"use strict"; +//// [f3.js] +"use strict"; +require("./f1"); +require("./f2"); + + +//// [f1.d.ts] +declare global { + interface Something { + x: any; + } +} +export { }; +export {}; +//// [f2.d.ts] +declare global { + interface Something { + y: any; + } +} +export { }; +export {}; +//// [f3.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt new file mode 100644 index 00000000000..4f1f9133760 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal5.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/f1.d.ts(4,19): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f2.d.ts(3,19): error TS2665: Module augmentation cannot introduce new names in the top level scope. + + +==== tests/cases/compiler/f3.ts (0 errors) ==== + /// + /// + import "A"; + import "B"; + + +==== tests/cases/compiler/f1.d.ts (1 errors) ==== + + declare module "A" { + global { + interface Something {x} + ~~~~~~~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + } + } +==== tests/cases/compiler/f2.d.ts (1 errors) ==== + declare module "B" { + global { + interface Something {y} + ~~~~~~~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal5.js b/tests/baselines/reference/moduleAugmentationGlobal5.js new file mode 100644 index 00000000000..3efdd2dbb98 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal5.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/moduleAugmentationGlobal5.ts] //// + +//// [f1.d.ts] + +declare module "A" { + global { + interface Something {x} + } +} +//// [f2.d.ts] +declare module "B" { + global { + interface Something {y} + } +} +//// [f3.ts] +/// +/// +import "A"; +import "B"; + + + +//// [f3.js] +"use strict"; +/// +/// +require("A"); +require("B"); + + +//// [f3.d.ts] +/// +/// diff --git a/tests/baselines/reference/moduleAugmentationGlobal6.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal6.errors.txt new file mode 100644 index 00000000000..849c45111ac --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/moduleAugmentationGlobal6.ts(1,9): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + + +==== tests/cases/compiler/moduleAugmentationGlobal6.ts (1 errors) ==== + declare global { + ~~~~~~ +!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + interface Array { x } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal6.js b/tests/baselines/reference/moduleAugmentationGlobal6.js new file mode 100644 index 00000000000..ac988f670d2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal6.js @@ -0,0 +1,6 @@ +//// [moduleAugmentationGlobal6.ts] +declare global { + interface Array { x } +} + +//// [moduleAugmentationGlobal6.js] diff --git a/tests/baselines/reference/moduleAugmentationGlobal6_1.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal6_1.errors.txt new file mode 100644 index 00000000000..01315f9fcbc --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal6_1.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/moduleAugmentationGlobal6_1.ts(1,1): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal6_1.ts(1,1): error TS2670: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. + + +==== tests/cases/compiler/moduleAugmentationGlobal6_1.ts (2 errors) ==== + global { + ~~~~~~ +!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + ~~~~~~ +!!! error TS2670: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. + interface Array { x } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal6_1.js b/tests/baselines/reference/moduleAugmentationGlobal6_1.js new file mode 100644 index 00000000000..5ae85debbe2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal6_1.js @@ -0,0 +1,6 @@ +//// [moduleAugmentationGlobal6_1.ts] +global { + interface Array { x } +} + +//// [moduleAugmentationGlobal6_1.js] diff --git a/tests/baselines/reference/moduleAugmentationGlobal7.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal7.errors.txt new file mode 100644 index 00000000000..3ba8003288c --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal7.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/moduleAugmentationGlobal7.ts(2,13): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + + +==== tests/cases/compiler/moduleAugmentationGlobal7.ts (1 errors) ==== + namespace A { + declare global { + ~~~~~~ +!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + interface Array { x } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal7.js b/tests/baselines/reference/moduleAugmentationGlobal7.js new file mode 100644 index 00000000000..54c6ddc0de7 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal7.js @@ -0,0 +1,8 @@ +//// [moduleAugmentationGlobal7.ts] +namespace A { + declare global { + interface Array { x } + } +} + +//// [moduleAugmentationGlobal7.js] diff --git a/tests/baselines/reference/moduleAugmentationGlobal7_1.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal7_1.errors.txt new file mode 100644 index 00000000000..c2e8282f2bf --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal7_1.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/moduleAugmentationGlobal7_1.ts(2,5): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal7_1.ts(2,5): error TS2670: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. + + +==== tests/cases/compiler/moduleAugmentationGlobal7_1.ts (2 errors) ==== + namespace A { + global { + ~~~~~~ +!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + ~~~~~~ +!!! error TS2670: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. + interface Array { x } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal7_1.js b/tests/baselines/reference/moduleAugmentationGlobal7_1.js new file mode 100644 index 00000000000..745be0d76a0 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal7_1.js @@ -0,0 +1,8 @@ +//// [moduleAugmentationGlobal7_1.ts] +namespace A { + global { + interface Array { x } + } +} + +//// [moduleAugmentationGlobal7_1.js] diff --git a/tests/baselines/reference/moduleAugmentationGlobal8.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal8.errors.txt new file mode 100644 index 00000000000..09c84fea2c2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal8.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/moduleAugmentationGlobal8.ts(2,13): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + + +==== tests/cases/compiler/moduleAugmentationGlobal8.ts (1 errors) ==== + namespace A { + declare global { + ~~~~~~ +!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + interface Array { x } + } + } + export {} + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal8.js b/tests/baselines/reference/moduleAugmentationGlobal8.js new file mode 100644 index 00000000000..261dfd21b58 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal8.js @@ -0,0 +1,13 @@ +//// [moduleAugmentationGlobal8.ts] +namespace A { + declare global { + interface Array { x } + } +} +export {} + + +//// [moduleAugmentationGlobal8.js] +define(["require", "exports"], function (require, exports) { + "use strict"; +}); diff --git a/tests/baselines/reference/moduleAugmentationGlobal8_1.errors.txt b/tests/baselines/reference/moduleAugmentationGlobal8_1.errors.txt new file mode 100644 index 00000000000..022a4f5ec1a --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal8_1.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/moduleAugmentationGlobal8_1.ts(2,5): error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. +tests/cases/compiler/moduleAugmentationGlobal8_1.ts(2,5): error TS2670: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. + + +==== tests/cases/compiler/moduleAugmentationGlobal8_1.ts (2 errors) ==== + namespace A { + global { + ~~~~~~ +!!! error TS2669: Augmentations for the global scope can only be directly nested in external modules or ambient module declarations. + ~~~~~~ +!!! error TS2670: Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context. + interface Array { x } + } + } + export {} + \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationGlobal8_1.js b/tests/baselines/reference/moduleAugmentationGlobal8_1.js new file mode 100644 index 00000000000..2ac585a711b --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationGlobal8_1.js @@ -0,0 +1,13 @@ +//// [moduleAugmentationGlobal8_1.ts] +namespace A { + global { + interface Array { x } + } +} +export {} + + +//// [moduleAugmentationGlobal8_1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; +}); diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports1.js b/tests/baselines/reference/moduleAugmentationImportsAndExports1.js new file mode 100644 index 00000000000..7159e7b5d0c --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports1.js @@ -0,0 +1,71 @@ +//// [tests/cases/compiler/moduleAugmentationImportsAndExports1.ts] //// + +//// [f1.ts] + +export class A {} + +//// [f2.ts] +export class B { + n: number; +} + +//// [f3.ts] +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } +declare module "./f1" { + interface A { + foo(): B; + } +} + +//// [f4.ts] +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +//// [f2.js] +"use strict"; +var B = (function () { + function B() { + } + return B; +}()); +exports.B = B; +//// [f3.js] +"use strict"; +var f1_1 = require("./f1"); +f1_1.A.prototype.foo = function () { return undefined; }; +//// [f4.js] +"use strict"; +require("./f3"); +var a; +var b = a.foo().n; + + +//// [f1.d.ts] +export declare class A { +} +//// [f2.d.ts] +export declare class B { + n: number; +} +//// [f3.d.ts] +import { B } from "./f2"; +declare module "./f1" { + interface A { + foo(): B; + } +} +//// [f4.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports1.symbols b/tests/baselines/reference/moduleAugmentationImportsAndExports1.symbols new file mode 100644 index 00000000000..c641cad5228 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports1.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/f1.ts === + +export class A {} +>A : Symbol(A, Decl(f1.ts, 0, 0), Decl(f3.ts, 4, 23)) + +=== tests/cases/compiler/f2.ts === +export class B { +>B : Symbol(B, Decl(f2.ts, 0, 0)) + + n: number; +>n : Symbol(n, Decl(f2.ts, 0, 16)) +} + +=== tests/cases/compiler/f3.ts === +import {A} from "./f1"; +>A : Symbol(A, Decl(f3.ts, 0, 8)) + +import {B} from "./f2"; +>B : Symbol(B, Decl(f3.ts, 1, 8)) + +A.prototype.foo = function () { return undefined; } +>A.prototype.foo : Symbol(A.foo, Decl(f3.ts, 5, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(f3.ts, 0, 8)) +>prototype : Symbol(A.prototype) +>foo : Symbol(A.foo, Decl(f3.ts, 5, 17)) +>undefined : Symbol(undefined) + +declare module "./f1" { + interface A { +>A : Symbol(A, Decl(f1.ts, 0, 0), Decl(f3.ts, 4, 23)) + + foo(): B; +>foo : Symbol(foo, Decl(f3.ts, 5, 17)) +>B : Symbol(B, Decl(f3.ts, 1, 8)) + } +} + +=== tests/cases/compiler/f4.ts === +import {A} from "./f1"; +>A : Symbol(A, Decl(f4.ts, 0, 8)) + +import "./f3"; + +let a: A; +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>A : Symbol(A, Decl(f4.ts, 0, 8)) + +let b = a.foo().n; +>b : Symbol(b, Decl(f4.ts, 4, 3)) +>a.foo().n : Symbol(B.n, Decl(f2.ts, 0, 16)) +>a.foo : Symbol(A.foo, Decl(f3.ts, 5, 17)) +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>foo : Symbol(A.foo, Decl(f3.ts, 5, 17)) +>n : Symbol(B.n, Decl(f2.ts, 0, 16)) + diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports1.types b/tests/baselines/reference/moduleAugmentationImportsAndExports1.types new file mode 100644 index 00000000000..886a04b54ef --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports1.types @@ -0,0 +1,59 @@ +=== tests/cases/compiler/f1.ts === + +export class A {} +>A : A + +=== tests/cases/compiler/f2.ts === +export class B { +>B : B + + n: number; +>n : number +} + +=== tests/cases/compiler/f3.ts === +import {A} from "./f1"; +>A : typeof A + +import {B} from "./f2"; +>B : typeof B + +A.prototype.foo = function () { return undefined; } +>A.prototype.foo = function () { return undefined; } : () => any +>A.prototype.foo : () => B +>A.prototype : A +>A : typeof A +>prototype : A +>foo : () => B +>function () { return undefined; } : () => any +>undefined : undefined + +declare module "./f1" { + interface A { +>A : A + + foo(): B; +>foo : () => B +>B : B + } +} + +=== tests/cases/compiler/f4.ts === +import {A} from "./f1"; +>A : typeof A + +import "./f3"; + +let a: A; +>a : A +>A : A + +let b = a.foo().n; +>b : number +>a.foo().n : number +>a.foo() : B +>a.foo : () => B +>a : A +>foo : () => B +>n : number + diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports2.errors.txt b/tests/baselines/reference/moduleAugmentationImportsAndExports2.errors.txt new file mode 100644 index 00000000000..deb3881e209 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports2.errors.txt @@ -0,0 +1,73 @@ +tests/cases/compiler/f3.ts(3,13): error TS2339: Property 'foo' does not exist on type 'A'. +tests/cases/compiler/f3.ts(11,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/f3.ts(11,21): error TS2307: Cannot find module './f2'. +tests/cases/compiler/f3.ts(12,5): error TS2666: Exports and export assignments are not permitted in module augmentations. +tests/cases/compiler/f3.ts(12,21): error TS2307: Cannot find module './f2'. +tests/cases/compiler/f3.ts(13,12): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(13,16): error TS4000: Import declaration 'I' is using private name 'N'. +tests/cases/compiler/f3.ts(14,12): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(14,16): error TS4000: Import declaration 'C' is using private name 'N'. +tests/cases/compiler/f3.ts(16,15): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f4.ts(5,11): error TS2339: Property 'foo' does not exist on type 'A'. + + +==== tests/cases/compiler/f1.ts (0 errors) ==== + + export class A {} + +==== tests/cases/compiler/f2.ts (0 errors) ==== + export class B { + n: number; + } + +==== tests/cases/compiler/f3.ts (10 errors) ==== + import {A} from "./f1"; + + A.prototype.foo = function () { return undefined; } + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'A'. + + namespace N { + export interface Ifc { a } + export interface Cls { a } + } + + declare module "./f1" { + import {B} from "./f2"; + ~~~~~~ +!!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. + ~~~~~~ +!!! error TS2307: Cannot find module './f2'. + export {B} from "./f2"; + ~~~~~~ +!!! error TS2666: Exports and export assignments are not permitted in module augmentations. + ~~~~~~ +!!! error TS2307: Cannot find module './f2'. + import I = N.Ifc; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~ +!!! error TS4000: Import declaration 'I' is using private name 'N'. + import C = N.Cls; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~ +!!! error TS4000: Import declaration 'C' is using private name 'N'. + // should have explicit export + interface A { + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + foo(): B; + bar(): I; + baz(): C; + } + } + +==== tests/cases/compiler/f4.ts (1 errors) ==== + import {A} from "./f1"; + import "./f3"; + + let a: A; + let b = a.foo().n; + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports2.js b/tests/baselines/reference/moduleAugmentationImportsAndExports2.js new file mode 100644 index 00000000000..3a4a807a334 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports2.js @@ -0,0 +1,76 @@ +//// [tests/cases/compiler/moduleAugmentationImportsAndExports2.ts] //// + +//// [f1.ts] + +export class A {} + +//// [f2.ts] +export class B { + n: number; +} + +//// [f3.ts] +import {A} from "./f1"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a } + export interface Cls { a } +} + +declare module "./f1" { + import {B} from "./f2"; + export {B} from "./f2"; + import I = N.Ifc; + import C = N.Cls; + // should have explicit export + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +//// [f4.ts] +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +//// [f2.js] +"use strict"; +var B = (function () { + function B() { + } + return B; +}()); +exports.B = B; +//// [f3.js] +"use strict"; +var f1_1 = require("./f1"); +f1_1.A.prototype.foo = function () { return undefined; }; +//// [f4.js] +"use strict"; +require("./f3"); +var a; +var b = a.foo().n; + + +//// [f1.d.ts] +export declare class A { +} +//// [f2.d.ts] +export declare class B { + n: number; +} +//// [f4.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports3.errors.txt b/tests/baselines/reference/moduleAugmentationImportsAndExports3.errors.txt new file mode 100644 index 00000000000..a7c8fa2cff2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports3.errors.txt @@ -0,0 +1,56 @@ +tests/cases/compiler/f3.ts(11,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. +tests/cases/compiler/f3.ts(11,21): error TS2307: Cannot find module './f2'. +tests/cases/compiler/f3.ts(12,12): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(12,16): error TS4000: Import declaration 'I' is using private name 'N'. +tests/cases/compiler/f3.ts(13,12): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/f3.ts(13,16): error TS4000: Import declaration 'C' is using private name 'N'. + + +==== tests/cases/compiler/f1.ts (0 errors) ==== + + export class A {} + +==== tests/cases/compiler/f2.ts (0 errors) ==== + export class B { + n: number; + } + +==== tests/cases/compiler/f3.ts (6 errors) ==== + import {A} from "./f1"; + + A.prototype.foo = function () { return undefined; } + + namespace N { + export interface Ifc { a } + export interface Cls { a } + } + + declare module "./f1" { + import {B} from "./f2"; + ~~~~~~ +!!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. + ~~~~~~ +!!! error TS2307: Cannot find module './f2'. + import I = N.Ifc; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~ +!!! error TS4000: Import declaration 'I' is using private name 'N'. + import C = N.Cls; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~ +!!! error TS4000: Import declaration 'C' is using private name 'N'. + interface A { + foo(): B; + bar(): I; + baz(): C; + } + } + +==== tests/cases/compiler/f4.ts (0 errors) ==== + import {A} from "./f1"; + import "./f3"; + + let a: A; + let b = a.foo().n; \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports3.js b/tests/baselines/reference/moduleAugmentationImportsAndExports3.js new file mode 100644 index 00000000000..d872a79e985 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports3.js @@ -0,0 +1,74 @@ +//// [tests/cases/compiler/moduleAugmentationImportsAndExports3.ts] //// + +//// [f1.ts] + +export class A {} + +//// [f2.ts] +export class B { + n: number; +} + +//// [f3.ts] +import {A} from "./f1"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a } + export interface Cls { a } +} + +declare module "./f1" { + import {B} from "./f2"; + import I = N.Ifc; + import C = N.Cls; + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +//// [f4.ts] +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +//// [f2.js] +"use strict"; +var B = (function () { + function B() { + } + return B; +}()); +exports.B = B; +//// [f3.js] +"use strict"; +var f1_1 = require("./f1"); +f1_1.A.prototype.foo = function () { return undefined; }; +//// [f4.js] +"use strict"; +require("./f3"); +var a; +var b = a.foo().n; + + +//// [f1.d.ts] +export declare class A { +} +//// [f2.d.ts] +export declare class B { + n: number; +} +//// [f4.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports4.js b/tests/baselines/reference/moduleAugmentationImportsAndExports4.js new file mode 100644 index 00000000000..53095555815 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports4.js @@ -0,0 +1,68 @@ +//// [tests/cases/compiler/moduleAugmentationImportsAndExports4.ts] //// + +//// [f1.ts] + +export class A {} + +//// [f2.ts] +export class B { + n: number; +} + +//// [f3.ts] +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a: number; } + export interface Cls { b: number; } +} +import I = N.Ifc; +import C = N.Cls; + +declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +//// [f4.ts] +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; +let c = a.bar().a; +let d = a.baz().b; + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +//// [f2.js] +"use strict"; +var B = (function () { + function B() { + } + return B; +}()); +exports.B = B; +//// [f3.js] +"use strict"; +var f1_1 = require("./f1"); +f1_1.A.prototype.foo = function () { return undefined; }; +//// [f4.js] +"use strict"; +require("./f3"); +var a; +var b = a.foo().n; +var c = a.bar().a; +var d = a.baz().b; diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports4.symbols b/tests/baselines/reference/moduleAugmentationImportsAndExports4.symbols new file mode 100644 index 00000000000..94dc05519dd --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports4.symbols @@ -0,0 +1,101 @@ +=== tests/cases/compiler/f1.ts === + +export class A {} +>A : Symbol(A, Decl(f1.ts, 0, 0), Decl(f3.ts, 12, 23)) + +=== tests/cases/compiler/f2.ts === +export class B { +>B : Symbol(B, Decl(f2.ts, 0, 0)) + + n: number; +>n : Symbol(n, Decl(f2.ts, 0, 16)) +} + +=== tests/cases/compiler/f3.ts === +import {A} from "./f1"; +>A : Symbol(A, Decl(f3.ts, 0, 8)) + +import {B} from "./f2"; +>B : Symbol(B, Decl(f3.ts, 1, 8)) + +A.prototype.foo = function () { return undefined; } +>A.prototype.foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(f3.ts, 0, 8)) +>prototype : Symbol(A.prototype) +>foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>undefined : Symbol(undefined) + +namespace N { +>N : Symbol(N, Decl(f3.ts, 3, 51)) + + export interface Ifc { a: number; } +>Ifc : Symbol(Ifc, Decl(f3.ts, 5, 13)) +>a : Symbol(a, Decl(f3.ts, 6, 26)) + + export interface Cls { b: number; } +>Cls : Symbol(Cls, Decl(f3.ts, 6, 39)) +>b : Symbol(b, Decl(f3.ts, 7, 26)) +} +import I = N.Ifc; +>I : Symbol(I, Decl(f3.ts, 8, 1)) +>N : Symbol(N, Decl(f3.ts, 3, 51)) +>Ifc : Symbol(I, Decl(f3.ts, 5, 13)) + +import C = N.Cls; +>C : Symbol(C, Decl(f3.ts, 9, 17)) +>N : Symbol(N, Decl(f3.ts, 3, 51)) +>Cls : Symbol(C, Decl(f3.ts, 6, 39)) + +declare module "./f1" { + interface A { +>A : Symbol(A, Decl(f1.ts, 0, 0), Decl(f3.ts, 12, 23)) + + foo(): B; +>foo : Symbol(foo, Decl(f3.ts, 13, 17)) +>B : Symbol(B, Decl(f3.ts, 1, 8)) + + bar(): I; +>bar : Symbol(bar, Decl(f3.ts, 14, 17)) +>I : Symbol(I, Decl(f3.ts, 8, 1)) + + baz(): C; +>baz : Symbol(baz, Decl(f3.ts, 15, 17)) +>C : Symbol(C, Decl(f3.ts, 9, 17)) + } +} + +=== tests/cases/compiler/f4.ts === +import {A} from "./f1"; +>A : Symbol(A, Decl(f4.ts, 0, 8)) + +import "./f3"; + +let a: A; +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>A : Symbol(A, Decl(f4.ts, 0, 8)) + +let b = a.foo().n; +>b : Symbol(b, Decl(f4.ts, 4, 3)) +>a.foo().n : Symbol(B.n, Decl(f2.ts, 0, 16)) +>a.foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>n : Symbol(B.n, Decl(f2.ts, 0, 16)) + +let c = a.bar().a; +>c : Symbol(c, Decl(f4.ts, 5, 3)) +>a.bar().a : Symbol(N.Ifc.a, Decl(f3.ts, 6, 26)) +>a.bar : Symbol(A.bar, Decl(f3.ts, 14, 17)) +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>bar : Symbol(A.bar, Decl(f3.ts, 14, 17)) +>a : Symbol(N.Ifc.a, Decl(f3.ts, 6, 26)) + +let d = a.baz().b; +>d : Symbol(d, Decl(f4.ts, 6, 3)) +>a.baz().b : Symbol(N.Cls.b, Decl(f3.ts, 7, 26)) +>a.baz : Symbol(A.baz, Decl(f3.ts, 15, 17)) +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>baz : Symbol(A.baz, Decl(f3.ts, 15, 17)) +>b : Symbol(N.Cls.b, Decl(f3.ts, 7, 26)) + diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports4.types b/tests/baselines/reference/moduleAugmentationImportsAndExports4.types new file mode 100644 index 00000000000..454dc5d27ec --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports4.types @@ -0,0 +1,106 @@ +=== tests/cases/compiler/f1.ts === + +export class A {} +>A : A + +=== tests/cases/compiler/f2.ts === +export class B { +>B : B + + n: number; +>n : number +} + +=== tests/cases/compiler/f3.ts === +import {A} from "./f1"; +>A : typeof A + +import {B} from "./f2"; +>B : typeof B + +A.prototype.foo = function () { return undefined; } +>A.prototype.foo = function () { return undefined; } : () => any +>A.prototype.foo : () => B +>A.prototype : A +>A : typeof A +>prototype : A +>foo : () => B +>function () { return undefined; } : () => any +>undefined : undefined + +namespace N { +>N : any + + export interface Ifc { a: number; } +>Ifc : Ifc +>a : number + + export interface Cls { b: number; } +>Cls : Cls +>b : number +} +import I = N.Ifc; +>I : any +>N : any +>Ifc : I + +import C = N.Cls; +>C : any +>N : any +>Cls : C + +declare module "./f1" { + interface A { +>A : A + + foo(): B; +>foo : () => B +>B : B + + bar(): I; +>bar : () => I +>I : I + + baz(): C; +>baz : () => C +>C : C + } +} + +=== tests/cases/compiler/f4.ts === +import {A} from "./f1"; +>A : typeof A + +import "./f3"; + +let a: A; +>a : A +>A : A + +let b = a.foo().n; +>b : number +>a.foo().n : number +>a.foo() : B +>a.foo : () => B +>a : A +>foo : () => B +>n : number + +let c = a.bar().a; +>c : number +>a.bar().a : number +>a.bar() : N.Ifc +>a.bar : () => N.Ifc +>a : A +>bar : () => N.Ifc +>a : number + +let d = a.baz().b; +>d : number +>a.baz().b : number +>a.baz() : N.Cls +>a.baz : () => N.Cls +>a : A +>baz : () => N.Cls +>b : number + diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports5.errors.txt b/tests/baselines/reference/moduleAugmentationImportsAndExports5.errors.txt new file mode 100644 index 00000000000..5f783453888 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports5.errors.txt @@ -0,0 +1,46 @@ +tests/cases/compiler/f3.ts(10,12): error TS4000: Import declaration 'I' is using private name 'N'. +tests/cases/compiler/f3.ts(11,12): error TS4000: Import declaration 'C' is using private name 'N'. + + +==== tests/cases/compiler/f1.ts (0 errors) ==== + + export class A {} + +==== tests/cases/compiler/f2.ts (0 errors) ==== + export class B { + n: number; + } + +==== tests/cases/compiler/f3.ts (2 errors) ==== + import {A} from "./f1"; + import {B} from "./f2"; + + A.prototype.foo = function () { return undefined; } + + namespace N { + export interface Ifc { a: number; } + export interface Cls { b: number; } + } + import I = N.Ifc; + ~ +!!! error TS4000: Import declaration 'I' is using private name 'N'. + import C = N.Cls; + ~ +!!! error TS4000: Import declaration 'C' is using private name 'N'. + + declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } + } + +==== tests/cases/compiler/f4.ts (0 errors) ==== + import {A} from "./f1"; + import "./f3"; + + let a: A; + let b = a.foo().n; + let c = a.bar().a; + let d = a.baz().b; \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports5.js b/tests/baselines/reference/moduleAugmentationImportsAndExports5.js new file mode 100644 index 00000000000..c9b622ccf25 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports5.js @@ -0,0 +1,78 @@ +//// [tests/cases/compiler/moduleAugmentationImportsAndExports5.ts] //// + +//// [f1.ts] + +export class A {} + +//// [f2.ts] +export class B { + n: number; +} + +//// [f3.ts] +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a: number; } + export interface Cls { b: number; } +} +import I = N.Ifc; +import C = N.Cls; + +declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +//// [f4.ts] +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; +let c = a.bar().a; +let d = a.baz().b; + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +//// [f2.js] +"use strict"; +var B = (function () { + function B() { + } + return B; +}()); +exports.B = B; +//// [f3.js] +"use strict"; +var f1_1 = require("./f1"); +f1_1.A.prototype.foo = function () { return undefined; }; +//// [f4.js] +"use strict"; +require("./f3"); +var a; +var b = a.foo().n; +var c = a.bar().a; +var d = a.baz().b; + + +//// [f1.d.ts] +export declare class A { +} +//// [f2.d.ts] +export declare class B { + n: number; +} +//// [f4.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports6.js b/tests/baselines/reference/moduleAugmentationImportsAndExports6.js new file mode 100644 index 00000000000..f0b297720b3 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports6.js @@ -0,0 +1,97 @@ +//// [tests/cases/compiler/moduleAugmentationImportsAndExports6.ts] //// + +//// [f1.ts] + +export class A {} + +//// [f2.ts] +export class B { + n: number; +} + +//// [f3.ts] +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } + +export namespace N { + export interface Ifc { a: number; } + export interface Cls { b: number; } +} +import I = N.Ifc; +import C = N.Cls; + +declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +//// [f4.ts] +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; +let c = a.bar().a; +let d = a.baz().b; + +//// [f1.js] +"use strict"; +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +//// [f2.js] +"use strict"; +var B = (function () { + function B() { + } + return B; +}()); +exports.B = B; +//// [f3.js] +"use strict"; +var f1_1 = require("./f1"); +f1_1.A.prototype.foo = function () { return undefined; }; +//// [f4.js] +"use strict"; +require("./f3"); +var a; +var b = a.foo().n; +var c = a.bar().a; +var d = a.baz().b; + + +//// [f1.d.ts] +export declare class A { +} +//// [f2.d.ts] +export declare class B { + n: number; +} +//// [f3.d.ts] +import { B } from "./f2"; +export declare namespace N { + interface Ifc { + a: number; + } + interface Cls { + b: number; + } +} +import I = N.Ifc; +import C = N.Cls; +declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} +//// [f4.d.ts] diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports6.symbols b/tests/baselines/reference/moduleAugmentationImportsAndExports6.symbols new file mode 100644 index 00000000000..92952ef94bc --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports6.symbols @@ -0,0 +1,101 @@ +=== tests/cases/compiler/f1.ts === + +export class A {} +>A : Symbol(A, Decl(f1.ts, 0, 0), Decl(f3.ts, 12, 23)) + +=== tests/cases/compiler/f2.ts === +export class B { +>B : Symbol(B, Decl(f2.ts, 0, 0)) + + n: number; +>n : Symbol(n, Decl(f2.ts, 0, 16)) +} + +=== tests/cases/compiler/f3.ts === +import {A} from "./f1"; +>A : Symbol(A, Decl(f3.ts, 0, 8)) + +import {B} from "./f2"; +>B : Symbol(B, Decl(f3.ts, 1, 8)) + +A.prototype.foo = function () { return undefined; } +>A.prototype.foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(f3.ts, 0, 8)) +>prototype : Symbol(A.prototype) +>foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>undefined : Symbol(undefined) + +export namespace N { +>N : Symbol(N, Decl(f3.ts, 3, 51)) + + export interface Ifc { a: number; } +>Ifc : Symbol(Ifc, Decl(f3.ts, 5, 20)) +>a : Symbol(a, Decl(f3.ts, 6, 26)) + + export interface Cls { b: number; } +>Cls : Symbol(Cls, Decl(f3.ts, 6, 39)) +>b : Symbol(b, Decl(f3.ts, 7, 26)) +} +import I = N.Ifc; +>I : Symbol(I, Decl(f3.ts, 8, 1)) +>N : Symbol(N, Decl(f3.ts, 3, 51)) +>Ifc : Symbol(I, Decl(f3.ts, 5, 20)) + +import C = N.Cls; +>C : Symbol(C, Decl(f3.ts, 9, 17)) +>N : Symbol(N, Decl(f3.ts, 3, 51)) +>Cls : Symbol(C, Decl(f3.ts, 6, 39)) + +declare module "./f1" { + interface A { +>A : Symbol(A, Decl(f1.ts, 0, 0), Decl(f3.ts, 12, 23)) + + foo(): B; +>foo : Symbol(foo, Decl(f3.ts, 13, 17)) +>B : Symbol(B, Decl(f3.ts, 1, 8)) + + bar(): I; +>bar : Symbol(bar, Decl(f3.ts, 14, 17)) +>I : Symbol(I, Decl(f3.ts, 8, 1)) + + baz(): C; +>baz : Symbol(baz, Decl(f3.ts, 15, 17)) +>C : Symbol(C, Decl(f3.ts, 9, 17)) + } +} + +=== tests/cases/compiler/f4.ts === +import {A} from "./f1"; +>A : Symbol(A, Decl(f4.ts, 0, 8)) + +import "./f3"; + +let a: A; +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>A : Symbol(A, Decl(f4.ts, 0, 8)) + +let b = a.foo().n; +>b : Symbol(b, Decl(f4.ts, 4, 3)) +>a.foo().n : Symbol(B.n, Decl(f2.ts, 0, 16)) +>a.foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>foo : Symbol(A.foo, Decl(f3.ts, 13, 17)) +>n : Symbol(B.n, Decl(f2.ts, 0, 16)) + +let c = a.bar().a; +>c : Symbol(c, Decl(f4.ts, 5, 3)) +>a.bar().a : Symbol(N.Ifc.a, Decl(f3.ts, 6, 26)) +>a.bar : Symbol(A.bar, Decl(f3.ts, 14, 17)) +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>bar : Symbol(A.bar, Decl(f3.ts, 14, 17)) +>a : Symbol(N.Ifc.a, Decl(f3.ts, 6, 26)) + +let d = a.baz().b; +>d : Symbol(d, Decl(f4.ts, 6, 3)) +>a.baz().b : Symbol(N.Cls.b, Decl(f3.ts, 7, 26)) +>a.baz : Symbol(A.baz, Decl(f3.ts, 15, 17)) +>a : Symbol(a, Decl(f4.ts, 3, 3)) +>baz : Symbol(A.baz, Decl(f3.ts, 15, 17)) +>b : Symbol(N.Cls.b, Decl(f3.ts, 7, 26)) + diff --git a/tests/baselines/reference/moduleAugmentationImportsAndExports6.types b/tests/baselines/reference/moduleAugmentationImportsAndExports6.types new file mode 100644 index 00000000000..0c201599b52 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationImportsAndExports6.types @@ -0,0 +1,106 @@ +=== tests/cases/compiler/f1.ts === + +export class A {} +>A : A + +=== tests/cases/compiler/f2.ts === +export class B { +>B : B + + n: number; +>n : number +} + +=== tests/cases/compiler/f3.ts === +import {A} from "./f1"; +>A : typeof A + +import {B} from "./f2"; +>B : typeof B + +A.prototype.foo = function () { return undefined; } +>A.prototype.foo = function () { return undefined; } : () => any +>A.prototype.foo : () => B +>A.prototype : A +>A : typeof A +>prototype : A +>foo : () => B +>function () { return undefined; } : () => any +>undefined : undefined + +export namespace N { +>N : any + + export interface Ifc { a: number; } +>Ifc : Ifc +>a : number + + export interface Cls { b: number; } +>Cls : Cls +>b : number +} +import I = N.Ifc; +>I : any +>N : any +>Ifc : I + +import C = N.Cls; +>C : any +>N : any +>Cls : C + +declare module "./f1" { + interface A { +>A : A + + foo(): B; +>foo : () => B +>B : B + + bar(): I; +>bar : () => I +>I : I + + baz(): C; +>baz : () => C +>C : C + } +} + +=== tests/cases/compiler/f4.ts === +import {A} from "./f1"; +>A : typeof A + +import "./f3"; + +let a: A; +>a : A +>A : A + +let b = a.foo().n; +>b : number +>a.foo().n : number +>a.foo() : B +>a.foo : () => B +>a : A +>foo : () => B +>n : number + +let c = a.bar().a; +>c : number +>a.bar().a : number +>a.bar() : N.Ifc +>a.bar : () => N.Ifc +>a : A +>bar : () => N.Ifc +>a : number + +let d = a.baz().b; +>d : number +>a.baz().b : number +>a.baz() : N.Cls +>a.baz : () => N.Cls +>a : A +>baz : () => N.Cls +>b : number + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule1.js b/tests/baselines/reference/moduleAugmentationInAmbientModule1.js new file mode 100644 index 00000000000..aecb8954d53 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule1.js @@ -0,0 +1,39 @@ +//// [tests/cases/compiler/moduleAugmentationInAmbientModule1.ts] //// + +//// [O.d.ts] + + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +//// [main.ts] +/// + +import {Observable} from "Observable"; +let x: Observable; +x.foo().x; + + +//// [main.js] +/// +"use strict"; +var x; +x.foo().x; + + +//// [main.d.ts] +/// diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule1.symbols b/tests/baselines/reference/moduleAugmentationInAmbientModule1.symbols new file mode 100644 index 00000000000..b59f0766eea --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule1.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/main.ts === +/// + +import {Observable} from "Observable"; +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +let x: Observable; +>x : Symbol(x, Decl(main.ts, 3, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +x.foo().x; +>x.foo().x : Symbol(Cls.x, Decl(O.d.ts, 7, 15)) +>x.foo : Symbol(Observable.foo, Decl(O.d.ts, 13, 30)) +>x : Symbol(x, Decl(main.ts, 3, 3)) +>foo : Symbol(Observable.foo, Decl(O.d.ts, 13, 30)) +>x : Symbol(Cls.x, Decl(O.d.ts, 7, 15)) + +=== tests/cases/compiler/O.d.ts === + + +declare module "Observable" { + class Observable {} +>Observable : Symbol(Observable, Decl(O.d.ts, 2, 29), Decl(O.d.ts, 12, 25)) +} + +declare module "M" { + class Cls { x: number } +>Cls : Symbol(Cls, Decl(O.d.ts, 6, 20)) +>x : Symbol(x, Decl(O.d.ts, 7, 15)) +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : Symbol(Cls, Decl(O.d.ts, 11, 12)) + + module "Observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(O.d.ts, 2, 29), Decl(O.d.ts, 12, 25)) + + foo(): Cls; +>foo : Symbol(foo, Decl(O.d.ts, 13, 30)) +>Cls : Symbol(Cls, Decl(O.d.ts, 11, 12)) + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule1.types b/tests/baselines/reference/moduleAugmentationInAmbientModule1.types new file mode 100644 index 00000000000..0be2a787cb6 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule1.types @@ -0,0 +1,47 @@ +=== tests/cases/compiler/main.ts === +/// + +import {Observable} from "Observable"; +>Observable : typeof Observable + +let x: Observable; +>x : Observable +>Observable : Observable + +x.foo().x; +>x.foo().x : number +>x.foo() : Cls +>x.foo : () => Cls +>x : Observable +>foo : () => Cls +>x : number + +=== tests/cases/compiler/O.d.ts === + + +declare module "Observable" { + class Observable {} +>Observable : Observable +} + +declare module "M" { + class Cls { x: number } +>Cls : Cls +>x : number +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : typeof Cls + + module "Observable" { + interface Observable { +>Observable : Observable + + foo(): Cls; +>foo : () => Cls +>Cls : Cls + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule2.js b/tests/baselines/reference/moduleAugmentationInAmbientModule2.js new file mode 100644 index 00000000000..5529afc674f --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule2.js @@ -0,0 +1,36 @@ +//// [tests/cases/compiler/moduleAugmentationInAmbientModule2.ts] //// + +//// [O.d.ts] + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +//// [main.ts] +/// + +import {Observable} from "Observable"; +import "Map"; +let x: Observable; +x.foo().x; + + +//// [main.js] +/// +"use strict"; +require("Map"); +var x; +x.foo().x; diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule2.symbols b/tests/baselines/reference/moduleAugmentationInAmbientModule2.symbols new file mode 100644 index 00000000000..6308e67b3b9 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule2.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/main.ts === +/// + +import {Observable} from "Observable"; +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +import "Map"; +let x: Observable; +>x : Symbol(x, Decl(main.ts, 4, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +x.foo().x; +>x.foo().x : Symbol(Cls.x, Decl(O.d.ts, 6, 15)) +>x.foo : Symbol(Observable.foo, Decl(O.d.ts, 12, 30)) +>x : Symbol(x, Decl(main.ts, 4, 3)) +>foo : Symbol(Observable.foo, Decl(O.d.ts, 12, 30)) +>x : Symbol(Cls.x, Decl(O.d.ts, 6, 15)) + +=== tests/cases/compiler/O.d.ts === + +declare module "Observable" { + class Observable {} +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25)) +} + +declare module "M" { + class Cls { x: number } +>Cls : Symbol(Cls, Decl(O.d.ts, 5, 20)) +>x : Symbol(x, Decl(O.d.ts, 6, 15)) +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : Symbol(Cls, Decl(O.d.ts, 10, 12)) + + module "Observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25)) + + foo(): Cls; +>foo : Symbol(foo, Decl(O.d.ts, 12, 30)) +>Cls : Symbol(Cls, Decl(O.d.ts, 10, 12)) + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule2.types b/tests/baselines/reference/moduleAugmentationInAmbientModule2.types new file mode 100644 index 00000000000..31ea8904c2a --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule2.types @@ -0,0 +1,47 @@ +=== tests/cases/compiler/main.ts === +/// + +import {Observable} from "Observable"; +>Observable : typeof Observable + +import "Map"; +let x: Observable; +>x : Observable +>Observable : Observable + +x.foo().x; +>x.foo().x : number +>x.foo() : Cls +>x.foo : () => Cls +>x : Observable +>foo : () => Cls +>x : number + +=== tests/cases/compiler/O.d.ts === + +declare module "Observable" { + class Observable {} +>Observable : Observable +} + +declare module "M" { + class Cls { x: number } +>Cls : Cls +>x : number +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : typeof Cls + + module "Observable" { + interface Observable { +>Observable : Observable + + foo(): Cls; +>foo : () => Cls +>Cls : Cls + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule3.js b/tests/baselines/reference/moduleAugmentationInAmbientModule3.js new file mode 100644 index 00000000000..3a94c50ef1f --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule3.js @@ -0,0 +1,47 @@ +//// [tests/cases/compiler/moduleAugmentationInAmbientModule3.ts] //// + +//// [O.d.ts] + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +declare module "Map" { + class Cls2 { x2: number } + module "Observable" { + interface Observable { + foo2(): Cls2; + } + } +} + +//// [main.ts] +/// + +import {Observable} from "Observable"; +import "Map"; +let x: Observable; +x.foo().x; +x.foo2().x2; + + +//// [main.js] +/// +"use strict"; +require("Map"); +var x; +x.foo().x; +x.foo2().x2; diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule3.symbols b/tests/baselines/reference/moduleAugmentationInAmbientModule3.symbols new file mode 100644 index 00000000000..34eea56753f --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule3.symbols @@ -0,0 +1,69 @@ +=== tests/cases/compiler/main.ts === +/// + +import {Observable} from "Observable"; +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +import "Map"; +let x: Observable; +>x : Symbol(x, Decl(main.ts, 4, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 2, 8)) + +x.foo().x; +>x.foo().x : Symbol(Cls.x, Decl(O.d.ts, 6, 15)) +>x.foo : Symbol(Observable.foo, Decl(O.d.ts, 12, 30)) +>x : Symbol(x, Decl(main.ts, 4, 3)) +>foo : Symbol(Observable.foo, Decl(O.d.ts, 12, 30)) +>x : Symbol(Cls.x, Decl(O.d.ts, 6, 15)) + +x.foo2().x2; +>x.foo2().x2 : Symbol(Cls2.x2, Decl(O.d.ts, 19, 16)) +>x.foo2 : Symbol(Observable.foo2, Decl(O.d.ts, 21, 30)) +>x : Symbol(x, Decl(main.ts, 4, 3)) +>foo2 : Symbol(Observable.foo2, Decl(O.d.ts, 21, 30)) +>x2 : Symbol(Cls2.x2, Decl(O.d.ts, 19, 16)) + +=== tests/cases/compiler/O.d.ts === + +declare module "Observable" { + class Observable {} +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25), Decl(O.d.ts, 20, 25)) +} + +declare module "M" { + class Cls { x: number } +>Cls : Symbol(Cls, Decl(O.d.ts, 5, 20)) +>x : Symbol(x, Decl(O.d.ts, 6, 15)) +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : Symbol(Cls, Decl(O.d.ts, 10, 12)) + + module "Observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25), Decl(O.d.ts, 20, 25)) + + foo(): Cls; +>foo : Symbol(foo, Decl(O.d.ts, 12, 30)) +>Cls : Symbol(Cls, Decl(O.d.ts, 10, 12)) + } + } +} + +declare module "Map" { + class Cls2 { x2: number } +>Cls2 : Symbol(Cls2, Decl(O.d.ts, 18, 22)) +>x2 : Symbol(x2, Decl(O.d.ts, 19, 16)) + + module "Observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25), Decl(O.d.ts, 20, 25)) + + foo2(): Cls2; +>foo2 : Symbol(foo2, Decl(O.d.ts, 21, 30)) +>Cls2 : Symbol(Cls2, Decl(O.d.ts, 18, 22)) + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule3.types b/tests/baselines/reference/moduleAugmentationInAmbientModule3.types new file mode 100644 index 00000000000..2cec5edc6bf --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule3.types @@ -0,0 +1,71 @@ +=== tests/cases/compiler/main.ts === +/// + +import {Observable} from "Observable"; +>Observable : typeof Observable + +import "Map"; +let x: Observable; +>x : Observable +>Observable : Observable + +x.foo().x; +>x.foo().x : number +>x.foo() : Cls +>x.foo : () => Cls +>x : Observable +>foo : () => Cls +>x : number + +x.foo2().x2; +>x.foo2().x2 : number +>x.foo2() : Cls2 +>x.foo2 : () => Cls2 +>x : Observable +>foo2 : () => Cls2 +>x2 : number + +=== tests/cases/compiler/O.d.ts === + +declare module "Observable" { + class Observable {} +>Observable : Observable +} + +declare module "M" { + class Cls { x: number } +>Cls : Cls +>x : number +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : typeof Cls + + module "Observable" { + interface Observable { +>Observable : Observable + + foo(): Cls; +>foo : () => Cls +>Cls : Cls + } + } +} + +declare module "Map" { + class Cls2 { x2: number } +>Cls2 : Cls2 +>x2 : number + + module "Observable" { + interface Observable { +>Observable : Observable + + foo2(): Cls2; +>foo2 : () => Cls2 +>Cls2 : Cls2 + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule4.js b/tests/baselines/reference/moduleAugmentationInAmbientModule4.js new file mode 100644 index 00000000000..bf0339d3107 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule4.js @@ -0,0 +1,50 @@ +//// [tests/cases/compiler/moduleAugmentationInAmbientModule4.ts] //// + +//// [O.d.ts] + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +//// [O2.d.ts] +declare module "Map" { + class Cls2 { x2: number } + module "Observable" { + interface Observable { + foo2(): Cls2; + } + } +} + +//// [main.ts] +/// +/// + +import {Observable} from "Observable"; +import "Map"; +let x: Observable; +x.foo().x; +x.foo2().x2; + + +//// [main.js] +/// +/// +"use strict"; +require("Map"); +var x; +x.foo().x; +x.foo2().x2; diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule4.symbols b/tests/baselines/reference/moduleAugmentationInAmbientModule4.symbols new file mode 100644 index 00000000000..55658c2a52e --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule4.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/main.ts === +/// +/// + +import {Observable} from "Observable"; +>Observable : Symbol(Observable, Decl(main.ts, 3, 8)) + +import "Map"; +let x: Observable; +>x : Symbol(x, Decl(main.ts, 5, 3)) +>Observable : Symbol(Observable, Decl(main.ts, 3, 8)) + +x.foo().x; +>x.foo().x : Symbol(Cls.x, Decl(O.d.ts, 6, 15)) +>x.foo : Symbol(Observable.foo, Decl(O.d.ts, 12, 30)) +>x : Symbol(x, Decl(main.ts, 5, 3)) +>foo : Symbol(Observable.foo, Decl(O.d.ts, 12, 30)) +>x : Symbol(Cls.x, Decl(O.d.ts, 6, 15)) + +x.foo2().x2; +>x.foo2().x2 : Symbol(Cls2.x2, Decl(O2.d.ts, 1, 16)) +>x.foo2 : Symbol(Observable.foo2, Decl(O2.d.ts, 3, 30)) +>x : Symbol(x, Decl(main.ts, 5, 3)) +>foo2 : Symbol(Observable.foo2, Decl(O2.d.ts, 3, 30)) +>x2 : Symbol(Cls2.x2, Decl(O2.d.ts, 1, 16)) + +=== tests/cases/compiler/O.d.ts === + +declare module "Observable" { + class Observable {} +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25), Decl(O2.d.ts, 2, 25)) +} + +declare module "M" { + class Cls { x: number } +>Cls : Symbol(Cls, Decl(O.d.ts, 5, 20)) +>x : Symbol(x, Decl(O.d.ts, 6, 15)) +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : Symbol(Cls, Decl(O.d.ts, 10, 12)) + + module "Observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25), Decl(O2.d.ts, 2, 25)) + + foo(): Cls; +>foo : Symbol(foo, Decl(O.d.ts, 12, 30)) +>Cls : Symbol(Cls, Decl(O.d.ts, 10, 12)) + } + } +} + +=== tests/cases/compiler/O2.d.ts === +declare module "Map" { + class Cls2 { x2: number } +>Cls2 : Symbol(Cls2, Decl(O2.d.ts, 0, 22)) +>x2 : Symbol(x2, Decl(O2.d.ts, 1, 16)) + + module "Observable" { + interface Observable { +>Observable : Symbol(Observable, Decl(O.d.ts, 1, 29), Decl(O.d.ts, 11, 25), Decl(O2.d.ts, 2, 25)) + + foo2(): Cls2; +>foo2 : Symbol(foo2, Decl(O2.d.ts, 3, 30)) +>Cls2 : Symbol(Cls2, Decl(O2.d.ts, 0, 22)) + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule4.types b/tests/baselines/reference/moduleAugmentationInAmbientModule4.types new file mode 100644 index 00000000000..04791aef860 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule4.types @@ -0,0 +1,73 @@ +=== tests/cases/compiler/main.ts === +/// +/// + +import {Observable} from "Observable"; +>Observable : typeof Observable + +import "Map"; +let x: Observable; +>x : Observable +>Observable : Observable + +x.foo().x; +>x.foo().x : number +>x.foo() : Cls +>x.foo : () => Cls +>x : Observable +>foo : () => Cls +>x : number + +x.foo2().x2; +>x.foo2().x2 : number +>x.foo2() : Cls2 +>x.foo2 : () => Cls2 +>x : Observable +>foo2 : () => Cls2 +>x2 : number + +=== tests/cases/compiler/O.d.ts === + +declare module "Observable" { + class Observable {} +>Observable : Observable +} + +declare module "M" { + class Cls { x: number } +>Cls : Cls +>x : number +} + +declare module "Map" { + import { Cls } from "M"; +>Cls : typeof Cls + + module "Observable" { + interface Observable { +>Observable : Observable + + foo(): Cls; +>foo : () => Cls +>Cls : Cls + } + } +} + +=== tests/cases/compiler/O2.d.ts === +declare module "Map" { + class Cls2 { x2: number } +>Cls2 : Cls2 +>x2 : number + + module "Observable" { + interface Observable { +>Observable : Observable + + foo2(): Cls2; +>foo2 : () => Cls2 +>Cls2 : Cls2 + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule5.js b/tests/baselines/reference/moduleAugmentationInAmbientModule5.js new file mode 100644 index 00000000000..fab9cebb179 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule5.js @@ -0,0 +1,35 @@ +//// [tests/cases/compiler/moduleAugmentationInAmbientModule5.ts] //// + +//// [array.d.ts] + +declare module "A" { + class A { x: number; } +} + +declare module "array" { + import {A} from "A"; + global { + interface Array { + getA(): A; + } + } +} + +//// [f.ts] +/// +import "array"; + +let x = [1]; +let y = x.getA().x; + + +//// [f.js] +"use strict"; +/// +require("array"); +var x = [1]; +var y = x.getA().x; + + +//// [f.d.ts] +/// diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule5.symbols b/tests/baselines/reference/moduleAugmentationInAmbientModule5.symbols new file mode 100644 index 00000000000..a663efca64d --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule5.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/f.ts === +/// +import "array"; + +let x = [1]; +>x : Symbol(x, Decl(f.ts, 3, 3)) + +let y = x.getA().x; +>y : Symbol(y, Decl(f.ts, 4, 3)) +>x.getA().x : Symbol(A.x, Decl(array.d.ts, 2, 13)) +>x.getA : Symbol(Array.getA, Decl(array.d.ts, 8, 28)) +>x : Symbol(x, Decl(f.ts, 3, 3)) +>getA : Symbol(Array.getA, Decl(array.d.ts, 8, 28)) +>x : Symbol(A.x, Decl(array.d.ts, 2, 13)) + +=== tests/cases/compiler/array.d.ts === + +declare module "A" { + class A { x: number; } +>A : Symbol(A, Decl(array.d.ts, 1, 20)) +>x : Symbol(x, Decl(array.d.ts, 2, 13)) +} + +declare module "array" { + import {A} from "A"; +>A : Symbol(A, Decl(array.d.ts, 6, 12)) + + global { +>global : Symbol(, Decl(array.d.ts, 6, 24)) + + interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(array.d.ts, 7, 12)) +>T : Symbol(T, Decl(lib.d.ts, --, --), Decl(array.d.ts, 8, 24)) + + getA(): A; +>getA : Symbol(getA, Decl(array.d.ts, 8, 28)) +>A : Symbol(A, Decl(array.d.ts, 6, 12)) + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule5.types b/tests/baselines/reference/moduleAugmentationInAmbientModule5.types new file mode 100644 index 00000000000..d04cdca4893 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule5.types @@ -0,0 +1,44 @@ +=== tests/cases/compiler/f.ts === +/// +import "array"; + +let x = [1]; +>x : number[] +>[1] : number[] +>1 : number + +let y = x.getA().x; +>y : number +>x.getA().x : number +>x.getA() : A +>x.getA : () => A +>x : number[] +>getA : () => A +>x : number + +=== tests/cases/compiler/array.d.ts === + +declare module "A" { + class A { x: number; } +>A : A +>x : number +} + +declare module "array" { + import {A} from "A"; +>A : typeof A + + global { +>global : typeof + + interface Array { +>Array : T[] +>T : T + + getA(): A; +>getA : () => A +>A : A + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt b/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt new file mode 100644 index 00000000000..7c7f17cd641 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationNoNewNames.errors.txt @@ -0,0 +1,47 @@ +tests/cases/compiler/map.ts(10,11): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(11,9): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(11,20): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(12,13): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(12,19): error TS2665: Module augmentation cannot introduce new names in the top level scope. +tests/cases/compiler/map.ts(13,12): error TS2665: Module augmentation cannot introduce new names in the top level scope. + + +==== tests/cases/compiler/map.ts (6 errors) ==== + + import { Observable } from "./observable" + + (Observable.prototype).map = function() { } + + declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + class Bar {} + ~~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + let y: number, z: string; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + let {a: x, b: x1}: {a: number, b: number}; + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + ~~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + module Z {} + ~ +!!! error TS2665: Module augmentation cannot introduce new names in the top level scope. + } + +==== tests/cases/compiler/observable.ts (0 errors) ==== + export declare class Observable { + filter(pred: (e:T) => boolean): Observable; + } + +==== tests/cases/compiler/main.ts (0 errors) ==== + import { Observable } from "./observable" + import "./map"; + + let x: Observable; + let y = x.map(x => x + 1); \ No newline at end of file diff --git a/tests/baselines/reference/moduleAugmentationNoNewNames.js b/tests/baselines/reference/moduleAugmentationNoNewNames.js new file mode 100644 index 00000000000..ccd4a668497 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationNoNewNames.js @@ -0,0 +1,41 @@ +//// [tests/cases/compiler/moduleAugmentationNoNewNames.ts] //// + +//// [map.ts] + +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + class Bar {} + let y: number, z: string; + let {a: x, b: x1}: {a: number, b: number}; + module Z {} +} + +//// [observable.ts] +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +//// [main.ts] +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); + +//// [observable.js] +"use strict"; +//// [map.js] +"use strict"; +var observable_1 = require("./observable"); +observable_1.Observable.prototype.map = function () { }; +//// [main.js] +"use strict"; +require("./map"); +var x; +var y = x.map(function (x) { return x + 1; }); diff --git a/tests/baselines/reference/moduleAugmentationsBundledOutput1.js b/tests/baselines/reference/moduleAugmentationsBundledOutput1.js new file mode 100644 index 00000000000..92916206e76 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsBundledOutput1.js @@ -0,0 +1,142 @@ +//// [tests/cases/compiler/moduleAugmentationsBundledOutput1.ts] //// + +//// [m1.ts] + +export class Cls { +} + +//// [m2.ts] +import {Cls} from "./m1"; +(Cls.prototype).foo = function() { return 1; }; +(Cls.prototype).bar = function() { return "1"; }; + +declare module "./m1" { + interface Cls { + foo(): number; + } +} + +declare module "./m1" { + interface Cls { + bar(): string; + } +} + +//// [m3.ts] +export class C1 { x: number } +export class C2 { x: string } + +//// [m4.ts] +import {Cls} from "./m1"; +import {C1, C2} from "./m3"; +(Cls.prototype).baz1 = function() { return undefined }; +(Cls.prototype).baz2 = function() { return undefined }; + +declare module "./m1" { + interface Cls { + baz1(): C1; + } +} + +declare module "./m1" { + interface Cls { + baz2(): C2; + } +} + +//// [test.ts] +import { Cls } from "./m1"; +import "m2"; +import "m4"; +let c: Cls; +c.foo().toExponential(); +c.bar().toLowerCase(); +c.baz1().x.toExponential(); +c.baz2().x.toLowerCase(); + + +//// [out.js] +define("m1", ["require", "exports"], function (require, exports) { + "use strict"; + var Cls = (function () { + function Cls() { + } + return Cls; + }()); + exports.Cls = Cls; +}); +define("m2", ["require", "exports", "m1"], function (require, exports, m1_1) { + "use strict"; + m1_1.Cls.prototype.foo = function () { return 1; }; + m1_1.Cls.prototype.bar = function () { return "1"; }; +}); +define("m3", ["require", "exports"], function (require, exports) { + "use strict"; + var C1 = (function () { + function C1() { + } + return C1; + }()); + exports.C1 = C1; + var C2 = (function () { + function C2() { + } + return C2; + }()); + exports.C2 = C2; +}); +define("m4", ["require", "exports", "m1"], function (require, exports, m1_2) { + "use strict"; + m1_2.Cls.prototype.baz1 = function () { return undefined; }; + m1_2.Cls.prototype.baz2 = function () { return undefined; }; +}); +define("test", ["require", "exports", "m2", "m4"], function (require, exports) { + "use strict"; + var c; + c.foo().toExponential(); + c.bar().toLowerCase(); + c.baz1().x.toExponential(); + c.baz2().x.toLowerCase(); +}); + + +//// [out.d.ts] +declare module "m1" { + export class Cls { + } +} +declare module "m2" { + module "m1" { + interface Cls { + foo(): number; + } + } + module "m1" { + interface Cls { + bar(): string; + } + } +} +declare module "m3" { + export class C1 { + x: number; + } + export class C2 { + x: string; + } +} +declare module "m4" { + import { C1, C2 } from "m3"; + module "m1" { + interface Cls { + baz1(): C1; + } + } + module "m1" { + interface Cls { + baz2(): C2; + } + } +} +declare module "test" { +} diff --git a/tests/baselines/reference/moduleAugmentationsBundledOutput1.symbols b/tests/baselines/reference/moduleAugmentationsBundledOutput1.symbols new file mode 100644 index 00000000000..47160cbc17f --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsBundledOutput1.symbols @@ -0,0 +1,129 @@ +=== tests/cases/compiler/m1.ts === + +export class Cls { +>Cls : Symbol(Cls, Decl(m1.ts, 0, 0), Decl(m2.ts, 4, 23), Decl(m2.ts, 10, 23), Decl(m4.ts, 5, 23), Decl(m4.ts, 11, 23)) +} + +=== tests/cases/compiler/m2.ts === +import {Cls} from "./m1"; +>Cls : Symbol(Cls, Decl(m2.ts, 0, 8)) + +(Cls.prototype).foo = function() { return 1; }; +>Cls.prototype : Symbol(Cls.prototype) +>Cls : Symbol(Cls, Decl(m2.ts, 0, 8)) +>prototype : Symbol(Cls.prototype) + +(Cls.prototype).bar = function() { return "1"; }; +>Cls.prototype : Symbol(Cls.prototype) +>Cls : Symbol(Cls, Decl(m2.ts, 0, 8)) +>prototype : Symbol(Cls.prototype) + +declare module "./m1" { + interface Cls { +>Cls : Symbol(Cls, Decl(m1.ts, 0, 0), Decl(m2.ts, 4, 23), Decl(m2.ts, 10, 23), Decl(m4.ts, 5, 23), Decl(m4.ts, 11, 23)) + + foo(): number; +>foo : Symbol(foo, Decl(m2.ts, 5, 19)) + } +} + +declare module "./m1" { + interface Cls { +>Cls : Symbol(Cls, Decl(m1.ts, 0, 0), Decl(m2.ts, 4, 23), Decl(m2.ts, 10, 23), Decl(m4.ts, 5, 23), Decl(m4.ts, 11, 23)) + + bar(): string; +>bar : Symbol(bar, Decl(m2.ts, 11, 19)) + } +} + +=== tests/cases/compiler/m3.ts === +export class C1 { x: number } +>C1 : Symbol(C1, Decl(m3.ts, 0, 0)) +>x : Symbol(x, Decl(m3.ts, 0, 17)) + +export class C2 { x: string } +>C2 : Symbol(C2, Decl(m3.ts, 0, 29)) +>x : Symbol(x, Decl(m3.ts, 1, 17)) + +=== tests/cases/compiler/m4.ts === +import {Cls} from "./m1"; +>Cls : Symbol(Cls, Decl(m4.ts, 0, 8)) + +import {C1, C2} from "./m3"; +>C1 : Symbol(C1, Decl(m4.ts, 1, 8)) +>C2 : Symbol(C2, Decl(m4.ts, 1, 11)) + +(Cls.prototype).baz1 = function() { return undefined }; +>Cls.prototype : Symbol(Cls.prototype) +>Cls : Symbol(Cls, Decl(m4.ts, 0, 8)) +>prototype : Symbol(Cls.prototype) +>undefined : Symbol(undefined) + +(Cls.prototype).baz2 = function() { return undefined }; +>Cls.prototype : Symbol(Cls.prototype) +>Cls : Symbol(Cls, Decl(m4.ts, 0, 8)) +>prototype : Symbol(Cls.prototype) +>undefined : Symbol(undefined) + +declare module "./m1" { + interface Cls { +>Cls : Symbol(Cls, Decl(m1.ts, 0, 0), Decl(m2.ts, 4, 23), Decl(m2.ts, 10, 23), Decl(m4.ts, 5, 23), Decl(m4.ts, 11, 23)) + + baz1(): C1; +>baz1 : Symbol(baz1, Decl(m4.ts, 6, 19)) +>C1 : Symbol(C1, Decl(m4.ts, 1, 8)) + } +} + +declare module "./m1" { + interface Cls { +>Cls : Symbol(Cls, Decl(m1.ts, 0, 0), Decl(m2.ts, 4, 23), Decl(m2.ts, 10, 23), Decl(m4.ts, 5, 23), Decl(m4.ts, 11, 23)) + + baz2(): C2; +>baz2 : Symbol(baz2, Decl(m4.ts, 12, 19)) +>C2 : Symbol(C2, Decl(m4.ts, 1, 11)) + } +} + +=== tests/cases/compiler/test.ts === +import { Cls } from "./m1"; +>Cls : Symbol(Cls, Decl(test.ts, 0, 8)) + +import "m2"; +import "m4"; +let c: Cls; +>c : Symbol(c, Decl(test.ts, 3, 3)) +>Cls : Symbol(Cls, Decl(test.ts, 0, 8)) + +c.foo().toExponential(); +>c.foo().toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, --, --)) +>c.foo : Symbol(Cls.foo, Decl(m2.ts, 5, 19)) +>c : Symbol(c, Decl(test.ts, 3, 3)) +>foo : Symbol(Cls.foo, Decl(m2.ts, 5, 19)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, --, --)) + +c.bar().toLowerCase(); +>c.bar().toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>c.bar : Symbol(Cls.bar, Decl(m2.ts, 11, 19)) +>c : Symbol(c, Decl(test.ts, 3, 3)) +>bar : Symbol(Cls.bar, Decl(m2.ts, 11, 19)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + +c.baz1().x.toExponential(); +>c.baz1().x.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, --, --)) +>c.baz1().x : Symbol(C1.x, Decl(m3.ts, 0, 17)) +>c.baz1 : Symbol(Cls.baz1, Decl(m4.ts, 6, 19)) +>c : Symbol(c, Decl(test.ts, 3, 3)) +>baz1 : Symbol(Cls.baz1, Decl(m4.ts, 6, 19)) +>x : Symbol(C1.x, Decl(m3.ts, 0, 17)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, --, --)) + +c.baz2().x.toLowerCase(); +>c.baz2().x.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>c.baz2().x : Symbol(C2.x, Decl(m3.ts, 1, 17)) +>c.baz2 : Symbol(Cls.baz2, Decl(m4.ts, 12, 19)) +>c : Symbol(c, Decl(test.ts, 3, 3)) +>baz2 : Symbol(Cls.baz2, Decl(m4.ts, 12, 19)) +>x : Symbol(C2.x, Decl(m3.ts, 1, 17)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/moduleAugmentationsBundledOutput1.types b/tests/baselines/reference/moduleAugmentationsBundledOutput1.types new file mode 100644 index 00000000000..80e9127905d --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsBundledOutput1.types @@ -0,0 +1,163 @@ +=== tests/cases/compiler/m1.ts === + +export class Cls { +>Cls : Cls +} + +=== tests/cases/compiler/m2.ts === +import {Cls} from "./m1"; +>Cls : typeof Cls + +(Cls.prototype).foo = function() { return 1; }; +>(Cls.prototype).foo = function() { return 1; } : () => number +>(Cls.prototype).foo : any +>(Cls.prototype) : any +>Cls.prototype : any +>Cls.prototype : Cls +>Cls : typeof Cls +>prototype : Cls +>foo : any +>function() { return 1; } : () => number +>1 : number + +(Cls.prototype).bar = function() { return "1"; }; +>(Cls.prototype).bar = function() { return "1"; } : () => string +>(Cls.prototype).bar : any +>(Cls.prototype) : any +>Cls.prototype : any +>Cls.prototype : Cls +>Cls : typeof Cls +>prototype : Cls +>bar : any +>function() { return "1"; } : () => string +>"1" : string + +declare module "./m1" { + interface Cls { +>Cls : Cls + + foo(): number; +>foo : () => number + } +} + +declare module "./m1" { + interface Cls { +>Cls : Cls + + bar(): string; +>bar : () => string + } +} + +=== tests/cases/compiler/m3.ts === +export class C1 { x: number } +>C1 : C1 +>x : number + +export class C2 { x: string } +>C2 : C2 +>x : string + +=== tests/cases/compiler/m4.ts === +import {Cls} from "./m1"; +>Cls : typeof Cls + +import {C1, C2} from "./m3"; +>C1 : typeof C1 +>C2 : typeof C2 + +(Cls.prototype).baz1 = function() { return undefined }; +>(Cls.prototype).baz1 = function() { return undefined } : () => any +>(Cls.prototype).baz1 : any +>(Cls.prototype) : any +>Cls.prototype : any +>Cls.prototype : Cls +>Cls : typeof Cls +>prototype : Cls +>baz1 : any +>function() { return undefined } : () => any +>undefined : undefined + +(Cls.prototype).baz2 = function() { return undefined }; +>(Cls.prototype).baz2 = function() { return undefined } : () => any +>(Cls.prototype).baz2 : any +>(Cls.prototype) : any +>Cls.prototype : any +>Cls.prototype : Cls +>Cls : typeof Cls +>prototype : Cls +>baz2 : any +>function() { return undefined } : () => any +>undefined : undefined + +declare module "./m1" { + interface Cls { +>Cls : Cls + + baz1(): C1; +>baz1 : () => C1 +>C1 : C1 + } +} + +declare module "./m1" { + interface Cls { +>Cls : Cls + + baz2(): C2; +>baz2 : () => C2 +>C2 : C2 + } +} + +=== tests/cases/compiler/test.ts === +import { Cls } from "./m1"; +>Cls : typeof Cls + +import "m2"; +import "m4"; +let c: Cls; +>c : Cls +>Cls : Cls + +c.foo().toExponential(); +>c.foo().toExponential() : string +>c.foo().toExponential : (fractionDigits?: number) => string +>c.foo() : number +>c.foo : () => number +>c : Cls +>foo : () => number +>toExponential : (fractionDigits?: number) => string + +c.bar().toLowerCase(); +>c.bar().toLowerCase() : string +>c.bar().toLowerCase : () => string +>c.bar() : string +>c.bar : () => string +>c : Cls +>bar : () => string +>toLowerCase : () => string + +c.baz1().x.toExponential(); +>c.baz1().x.toExponential() : string +>c.baz1().x.toExponential : (fractionDigits?: number) => string +>c.baz1().x : number +>c.baz1() : C1 +>c.baz1 : () => C1 +>c : Cls +>baz1 : () => C1 +>x : number +>toExponential : (fractionDigits?: number) => string + +c.baz2().x.toLowerCase(); +>c.baz2().x.toLowerCase() : string +>c.baz2().x.toLowerCase : () => string +>c.baz2().x : string +>c.baz2() : C2 +>c.baz2 : () => C2 +>c : Cls +>baz2 : () => C2 +>x : string +>toLowerCase : () => string + diff --git a/tests/baselines/reference/moduleAugmentationsImports1.js b/tests/baselines/reference/moduleAugmentationsImports1.js new file mode 100644 index 00000000000..2c635a0719e --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports1.js @@ -0,0 +1,104 @@ +//// [tests/cases/compiler/moduleAugmentationsImports1.ts] //// + +//// [a.ts] + +export class A {} + +//// [b.ts] +export class B {x: number;} + +//// [c.d.ts] +declare module "C" { + class Cls {y: string; } +} + +//// [d.ts] +/// + +import {A} from "./a"; +import {B} from "./b"; +import {Cls} from "C"; + +A.prototype.getB = function () { return undefined; } +A.prototype.getCls = function () { return undefined; } + +declare module "./a" { + interface A { + getB(): B; + } +} + +declare module "./a" { + interface A { + getCls(): Cls; + } +} + +//// [main.ts] +import {A} from "./a"; +import "d"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); + +//// [f.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + var A = (function () { + function A() { + } + return A; + }()); + exports.A = A; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + var B = (function () { + function B() { + } + return B; + }()); + exports.B = B; +}); +/// +define("d", ["require", "exports", "a"], function (require, exports, a_1) { + "use strict"; + a_1.A.prototype.getB = function () { return undefined; }; + a_1.A.prototype.getCls = function () { return undefined; }; +}); +define("main", ["require", "exports", "d"], function (require, exports) { + "use strict"; + var a; + var b = a.getB().x.toFixed(); + var c = a.getCls().y.toLowerCase(); +}); + + +//// [f.d.ts] +/// +declare module "a" { + export class A { + } +} +declare module "b" { + export class B { + x: number; + } +} +declare module "d" { + import { B } from "b"; + import { Cls } from "C"; + module "a" { + interface A { + getB(): B; + } + } + module "a" { + interface A { + getCls(): Cls; + } + } +} +declare module "main" { +} diff --git a/tests/baselines/reference/moduleAugmentationsImports1.symbols b/tests/baselines/reference/moduleAugmentationsImports1.symbols new file mode 100644 index 00000000000..38ef8f55229 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports1.symbols @@ -0,0 +1,95 @@ +=== tests/cases/compiler/a.ts === + +export class A {} +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.ts, 9, 22), Decl(d.ts, 15, 22)) + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : Symbol(B, Decl(b.ts, 0, 0)) +>x : Symbol(x, Decl(b.ts, 0, 16)) + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Symbol(Cls, Decl(c.d.ts, 0, 20)) +>y : Symbol(y, Decl(c.d.ts, 1, 15)) +} + +=== tests/cases/compiler/d.ts === +/// + +import {A} from "./a"; +>A : Symbol(A, Decl(d.ts, 2, 8)) + +import {B} from "./b"; +>B : Symbol(B, Decl(d.ts, 3, 8)) + +import {Cls} from "C"; +>Cls : Symbol(Cls, Decl(d.ts, 4, 8)) + +A.prototype.getB = function () { return undefined; } +>A.prototype.getB : Symbol(A.getB, Decl(d.ts, 10, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(d.ts, 2, 8)) +>prototype : Symbol(A.prototype) +>getB : Symbol(A.getB, Decl(d.ts, 10, 17)) +>undefined : Symbol(undefined) + +A.prototype.getCls = function () { return undefined; } +>A.prototype.getCls : Symbol(A.getCls, Decl(d.ts, 16, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(d.ts, 2, 8)) +>prototype : Symbol(A.prototype) +>getCls : Symbol(A.getCls, Decl(d.ts, 16, 17)) +>undefined : Symbol(undefined) + +declare module "./a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.ts, 9, 22), Decl(d.ts, 15, 22)) + + getB(): B; +>getB : Symbol(getB, Decl(d.ts, 10, 17)) +>B : Symbol(B, Decl(d.ts, 3, 8)) + } +} + +declare module "./a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.ts, 9, 22), Decl(d.ts, 15, 22)) + + getCls(): Cls; +>getCls : Symbol(getCls, Decl(d.ts, 16, 17)) +>Cls : Symbol(Cls, Decl(d.ts, 4, 8)) + } +} + +=== tests/cases/compiler/main.ts === +import {A} from "./a"; +>A : Symbol(A, Decl(main.ts, 0, 8)) + +import "d"; + +let a: A; +>a : Symbol(a, Decl(main.ts, 3, 3)) +>A : Symbol(A, Decl(main.ts, 0, 8)) + +let b = a.getB().x.toFixed(); +>b : Symbol(b, Decl(main.ts, 4, 3)) +>a.getB().x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>a.getB().x : Symbol(B.x, Decl(b.ts, 0, 16)) +>a.getB : Symbol(A.getB, Decl(d.ts, 10, 17)) +>a : Symbol(a, Decl(main.ts, 3, 3)) +>getB : Symbol(A.getB, Decl(d.ts, 10, 17)) +>x : Symbol(B.x, Decl(b.ts, 0, 16)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +let c = a.getCls().y.toLowerCase(); +>c : Symbol(c, Decl(main.ts, 5, 3)) +>a.getCls().y.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>a.getCls().y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>a.getCls : Symbol(A.getCls, Decl(d.ts, 16, 17)) +>a : Symbol(a, Decl(main.ts, 3, 3)) +>getCls : Symbol(A.getCls, Decl(d.ts, 16, 17)) +>y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/moduleAugmentationsImports1.types b/tests/baselines/reference/moduleAugmentationsImports1.types new file mode 100644 index 00000000000..bf0bfee0a7a --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports1.types @@ -0,0 +1,103 @@ +=== tests/cases/compiler/a.ts === + +export class A {} +>A : A + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : B +>x : number + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Cls +>y : string +} + +=== tests/cases/compiler/d.ts === +/// + +import {A} from "./a"; +>A : typeof A + +import {B} from "./b"; +>B : typeof B + +import {Cls} from "C"; +>Cls : typeof Cls + +A.prototype.getB = function () { return undefined; } +>A.prototype.getB = function () { return undefined; } : () => any +>A.prototype.getB : () => B +>A.prototype : A +>A : typeof A +>prototype : A +>getB : () => B +>function () { return undefined; } : () => any +>undefined : undefined + +A.prototype.getCls = function () { return undefined; } +>A.prototype.getCls = function () { return undefined; } : () => any +>A.prototype.getCls : () => Cls +>A.prototype : A +>A : typeof A +>prototype : A +>getCls : () => Cls +>function () { return undefined; } : () => any +>undefined : undefined + +declare module "./a" { + interface A { +>A : A + + getB(): B; +>getB : () => B +>B : B + } +} + +declare module "./a" { + interface A { +>A : A + + getCls(): Cls; +>getCls : () => Cls +>Cls : Cls + } +} + +=== tests/cases/compiler/main.ts === +import {A} from "./a"; +>A : typeof A + +import "d"; + +let a: A; +>a : A +>A : A + +let b = a.getB().x.toFixed(); +>b : string +>a.getB().x.toFixed() : string +>a.getB().x.toFixed : (fractionDigits?: number) => string +>a.getB().x : number +>a.getB() : B +>a.getB : () => B +>a : A +>getB : () => B +>x : number +>toFixed : (fractionDigits?: number) => string + +let c = a.getCls().y.toLowerCase(); +>c : string +>a.getCls().y.toLowerCase() : string +>a.getCls().y.toLowerCase : () => string +>a.getCls().y : string +>a.getCls() : Cls +>a.getCls : () => Cls +>a : A +>getCls : () => Cls +>y : string +>toLowerCase : () => string + diff --git a/tests/baselines/reference/moduleAugmentationsImports2.js b/tests/baselines/reference/moduleAugmentationsImports2.js new file mode 100644 index 00000000000..f70426b49bd --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports2.js @@ -0,0 +1,114 @@ +//// [tests/cases/compiler/moduleAugmentationsImports2.ts] //// + +//// [a.ts] + +export class A {} + +//// [b.ts] +export class B {x: number;} + +//// [c.d.ts] +declare module "C" { + class Cls {y: string; } +} + +//// [d.ts] +/// + +import {A} from "./a"; +import {B} from "./b"; + +A.prototype.getB = function () { return undefined; } + +declare module "./a" { + interface A { + getB(): B; + } +} + +//// [e.ts] +import {A} from "./a"; +import {Cls} from "C"; + +A.prototype.getCls = function () { return undefined; } + +declare module "./a" { + interface A { + getCls(): Cls; + } +} + +//// [main.ts] +import {A} from "./a"; +import "d"; +import "e"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); + +//// [f.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + var A = (function () { + function A() { + } + return A; + }()); + exports.A = A; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + var B = (function () { + function B() { + } + return B; + }()); + exports.B = B; +}); +/// +define("d", ["require", "exports", "a"], function (require, exports, a_1) { + "use strict"; + a_1.A.prototype.getB = function () { return undefined; }; +}); +define("e", ["require", "exports", "a"], function (require, exports, a_2) { + "use strict"; + a_2.A.prototype.getCls = function () { return undefined; }; +}); +define("main", ["require", "exports", "d", "e"], function (require, exports) { + "use strict"; + var a; + var b = a.getB().x.toFixed(); + var c = a.getCls().y.toLowerCase(); +}); + + +//// [f.d.ts] +/// +declare module "a" { + export class A { + } +} +declare module "b" { + export class B { + x: number; + } +} +declare module "d" { + import { B } from "b"; + module "a" { + interface A { + getB(): B; + } + } +} +declare module "e" { + import { Cls } from "C"; + module "a" { + interface A { + getCls(): Cls; + } + } +} +declare module "main" { +} diff --git a/tests/baselines/reference/moduleAugmentationsImports2.symbols b/tests/baselines/reference/moduleAugmentationsImports2.symbols new file mode 100644 index 00000000000..643ccf20eb2 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports2.symbols @@ -0,0 +1,100 @@ +=== tests/cases/compiler/a.ts === + +export class A {} +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.ts, 7, 22), Decl(e.ts, 5, 22)) + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : Symbol(B, Decl(b.ts, 0, 0)) +>x : Symbol(x, Decl(b.ts, 0, 16)) + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Symbol(Cls, Decl(c.d.ts, 0, 20)) +>y : Symbol(y, Decl(c.d.ts, 1, 15)) +} + +=== tests/cases/compiler/d.ts === +/// + +import {A} from "./a"; +>A : Symbol(A, Decl(d.ts, 2, 8)) + +import {B} from "./b"; +>B : Symbol(B, Decl(d.ts, 3, 8)) + +A.prototype.getB = function () { return undefined; } +>A.prototype.getB : Symbol(A.getB, Decl(d.ts, 8, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(d.ts, 2, 8)) +>prototype : Symbol(A.prototype) +>getB : Symbol(A.getB, Decl(d.ts, 8, 17)) +>undefined : Symbol(undefined) + +declare module "./a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.ts, 7, 22), Decl(e.ts, 5, 22)) + + getB(): B; +>getB : Symbol(getB, Decl(d.ts, 8, 17)) +>B : Symbol(B, Decl(d.ts, 3, 8)) + } +} + +=== tests/cases/compiler/e.ts === +import {A} from "./a"; +>A : Symbol(A, Decl(e.ts, 0, 8)) + +import {Cls} from "C"; +>Cls : Symbol(Cls, Decl(e.ts, 1, 8)) + +A.prototype.getCls = function () { return undefined; } +>A.prototype.getCls : Symbol(A.getCls, Decl(e.ts, 6, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(e.ts, 0, 8)) +>prototype : Symbol(A.prototype) +>getCls : Symbol(A.getCls, Decl(e.ts, 6, 17)) +>undefined : Symbol(undefined) + +declare module "./a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.ts, 7, 22), Decl(e.ts, 5, 22)) + + getCls(): Cls; +>getCls : Symbol(getCls, Decl(e.ts, 6, 17)) +>Cls : Symbol(Cls, Decl(e.ts, 1, 8)) + } +} + +=== tests/cases/compiler/main.ts === +import {A} from "./a"; +>A : Symbol(A, Decl(main.ts, 0, 8)) + +import "d"; +import "e"; + +let a: A; +>a : Symbol(a, Decl(main.ts, 4, 3)) +>A : Symbol(A, Decl(main.ts, 0, 8)) + +let b = a.getB().x.toFixed(); +>b : Symbol(b, Decl(main.ts, 5, 3)) +>a.getB().x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>a.getB().x : Symbol(B.x, Decl(b.ts, 0, 16)) +>a.getB : Symbol(A.getB, Decl(d.ts, 8, 17)) +>a : Symbol(a, Decl(main.ts, 4, 3)) +>getB : Symbol(A.getB, Decl(d.ts, 8, 17)) +>x : Symbol(B.x, Decl(b.ts, 0, 16)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +let c = a.getCls().y.toLowerCase(); +>c : Symbol(c, Decl(main.ts, 6, 3)) +>a.getCls().y.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>a.getCls().y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>a.getCls : Symbol(A.getCls, Decl(e.ts, 6, 17)) +>a : Symbol(a, Decl(main.ts, 4, 3)) +>getCls : Symbol(A.getCls, Decl(e.ts, 6, 17)) +>y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/moduleAugmentationsImports2.types b/tests/baselines/reference/moduleAugmentationsImports2.types new file mode 100644 index 00000000000..56b40625600 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports2.types @@ -0,0 +1,108 @@ +=== tests/cases/compiler/a.ts === + +export class A {} +>A : A + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : B +>x : number + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Cls +>y : string +} + +=== tests/cases/compiler/d.ts === +/// + +import {A} from "./a"; +>A : typeof A + +import {B} from "./b"; +>B : typeof B + +A.prototype.getB = function () { return undefined; } +>A.prototype.getB = function () { return undefined; } : () => any +>A.prototype.getB : () => B +>A.prototype : A +>A : typeof A +>prototype : A +>getB : () => B +>function () { return undefined; } : () => any +>undefined : undefined + +declare module "./a" { + interface A { +>A : A + + getB(): B; +>getB : () => B +>B : B + } +} + +=== tests/cases/compiler/e.ts === +import {A} from "./a"; +>A : typeof A + +import {Cls} from "C"; +>Cls : typeof Cls + +A.prototype.getCls = function () { return undefined; } +>A.prototype.getCls = function () { return undefined; } : () => any +>A.prototype.getCls : () => Cls +>A.prototype : A +>A : typeof A +>prototype : A +>getCls : () => Cls +>function () { return undefined; } : () => any +>undefined : undefined + +declare module "./a" { + interface A { +>A : A + + getCls(): Cls; +>getCls : () => Cls +>Cls : Cls + } +} + +=== tests/cases/compiler/main.ts === +import {A} from "./a"; +>A : typeof A + +import "d"; +import "e"; + +let a: A; +>a : A +>A : A + +let b = a.getB().x.toFixed(); +>b : string +>a.getB().x.toFixed() : string +>a.getB().x.toFixed : (fractionDigits?: number) => string +>a.getB().x : number +>a.getB() : B +>a.getB : () => B +>a : A +>getB : () => B +>x : number +>toFixed : (fractionDigits?: number) => string + +let c = a.getCls().y.toLowerCase(); +>c : string +>a.getCls().y.toLowerCase() : string +>a.getCls().y.toLowerCase : () => string +>a.getCls().y : string +>a.getCls() : Cls +>a.getCls : () => Cls +>a : A +>getCls : () => Cls +>y : string +>toLowerCase : () => string + diff --git a/tests/baselines/reference/moduleAugmentationsImports3.js b/tests/baselines/reference/moduleAugmentationsImports3.js new file mode 100644 index 00000000000..3654583b5c9 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports3.js @@ -0,0 +1,101 @@ +//// [tests/cases/compiler/moduleAugmentationsImports3.ts] //// + +//// [a.ts] + +export class A {} + +//// [b.ts] +export class B {x: number;} + +//// [c.d.ts] +declare module "C" { + class Cls {y: string; } +} + +//// [d.d.ts] +declare module "D" { + import {A} from "a"; + import {B} from "b"; + module "a" { + interface A { + getB(): B; + } + } +} + +//// [e.ts] +/// +import {A} from "./a"; +import {Cls} from "C"; + +A.prototype.getCls = function () { return undefined; } + +declare module "./a" { + interface A { + getCls(): Cls; + } +} + +//// [main.ts] +/// +import {A} from "./a"; +import "D"; +import "e"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); + +//// [f.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + var A = (function () { + function A() { + } + return A; + }()); + exports.A = A; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + var B = (function () { + function B() { + } + return B; + }()); + exports.B = B; +}); +define("e", ["require", "exports", "a"], function (require, exports, a_1) { + "use strict"; + a_1.A.prototype.getCls = function () { return undefined; }; +}); +define("main", ["require", "exports", "D", "e"], function (require, exports) { + "use strict"; + var a; + var b = a.getB().x.toFixed(); + var c = a.getCls().y.toLowerCase(); +}); + + +//// [f.d.ts] +/// +/// +declare module "a" { + export class A { + } +} +declare module "b" { + export class B { + x: number; + } +} +declare module "e" { + import { Cls } from "C"; + module "a" { + interface A { + getCls(): Cls; + } + } +} +declare module "main" { +} diff --git a/tests/baselines/reference/moduleAugmentationsImports3.symbols b/tests/baselines/reference/moduleAugmentationsImports3.symbols new file mode 100644 index 00000000000..db8eee074c0 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports3.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/main.ts === +/// +import {A} from "./a"; +>A : Symbol(A, Decl(main.ts, 1, 8)) + +import "D"; +import "e"; + +let a: A; +>a : Symbol(a, Decl(main.ts, 5, 3)) +>A : Symbol(A, Decl(main.ts, 1, 8)) + +let b = a.getB().x.toFixed(); +>b : Symbol(b, Decl(main.ts, 6, 3)) +>a.getB().x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>a.getB().x : Symbol(B.x, Decl(b.ts, 0, 16)) +>a.getB : Symbol(A.getB, Decl(d.d.ts, 4, 21)) +>a : Symbol(a, Decl(main.ts, 5, 3)) +>getB : Symbol(A.getB, Decl(d.d.ts, 4, 21)) +>x : Symbol(B.x, Decl(b.ts, 0, 16)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +let c = a.getCls().y.toLowerCase(); +>c : Symbol(c, Decl(main.ts, 7, 3)) +>a.getCls().y.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>a.getCls().y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>a.getCls : Symbol(A.getCls, Decl(e.ts, 7, 17)) +>a : Symbol(a, Decl(main.ts, 5, 3)) +>getCls : Symbol(A.getCls, Decl(e.ts, 7, 17)) +>y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + +=== tests/cases/compiler/a.ts === + +export class A {} +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.d.ts, 3, 16), Decl(e.ts, 6, 22)) + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : Symbol(B, Decl(b.ts, 0, 0)) +>x : Symbol(x, Decl(b.ts, 0, 16)) + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Symbol(Cls, Decl(c.d.ts, 0, 20)) +>y : Symbol(y, Decl(c.d.ts, 1, 15)) +} + +=== tests/cases/compiler/d.d.ts === +declare module "D" { + import {A} from "a"; +>A : Symbol(A, Decl(d.d.ts, 1, 12)) + + import {B} from "b"; +>B : Symbol(B, Decl(d.d.ts, 2, 12)) + + module "a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.d.ts, 3, 16), Decl(e.ts, 6, 22)) + + getB(): B; +>getB : Symbol(getB, Decl(d.d.ts, 4, 21)) +>B : Symbol(B, Decl(d.d.ts, 2, 12)) + } + } +} + +=== tests/cases/compiler/e.ts === +/// +import {A} from "./a"; +>A : Symbol(A, Decl(e.ts, 1, 8)) + +import {Cls} from "C"; +>Cls : Symbol(Cls, Decl(e.ts, 2, 8)) + +A.prototype.getCls = function () { return undefined; } +>A.prototype.getCls : Symbol(A.getCls, Decl(e.ts, 7, 17)) +>A.prototype : Symbol(A.prototype) +>A : Symbol(A, Decl(e.ts, 1, 8)) +>prototype : Symbol(A.prototype) +>getCls : Symbol(A.getCls, Decl(e.ts, 7, 17)) +>undefined : Symbol(undefined) + +declare module "./a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.d.ts, 3, 16), Decl(e.ts, 6, 22)) + + getCls(): Cls; +>getCls : Symbol(getCls, Decl(e.ts, 7, 17)) +>Cls : Symbol(Cls, Decl(e.ts, 2, 8)) + } +} + diff --git a/tests/baselines/reference/moduleAugmentationsImports3.types b/tests/baselines/reference/moduleAugmentationsImports3.types new file mode 100644 index 00000000000..04d17296c56 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports3.types @@ -0,0 +1,100 @@ +=== tests/cases/compiler/main.ts === +/// +import {A} from "./a"; +>A : typeof A + +import "D"; +import "e"; + +let a: A; +>a : A +>A : A + +let b = a.getB().x.toFixed(); +>b : string +>a.getB().x.toFixed() : string +>a.getB().x.toFixed : (fractionDigits?: number) => string +>a.getB().x : number +>a.getB() : B +>a.getB : () => B +>a : A +>getB : () => B +>x : number +>toFixed : (fractionDigits?: number) => string + +let c = a.getCls().y.toLowerCase(); +>c : string +>a.getCls().y.toLowerCase() : string +>a.getCls().y.toLowerCase : () => string +>a.getCls().y : string +>a.getCls() : Cls +>a.getCls : () => Cls +>a : A +>getCls : () => Cls +>y : string +>toLowerCase : () => string + +=== tests/cases/compiler/a.ts === + +export class A {} +>A : A + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : B +>x : number + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Cls +>y : string +} + +=== tests/cases/compiler/d.d.ts === +declare module "D" { + import {A} from "a"; +>A : typeof A + + import {B} from "b"; +>B : typeof B + + module "a" { + interface A { +>A : A + + getB(): B; +>getB : () => B +>B : B + } + } +} + +=== tests/cases/compiler/e.ts === +/// +import {A} from "./a"; +>A : typeof A + +import {Cls} from "C"; +>Cls : typeof Cls + +A.prototype.getCls = function () { return undefined; } +>A.prototype.getCls = function () { return undefined; } : () => any +>A.prototype.getCls : () => Cls +>A.prototype : A +>A : typeof A +>prototype : A +>getCls : () => Cls +>function () { return undefined; } : () => any +>undefined : undefined + +declare module "./a" { + interface A { +>A : A + + getCls(): Cls; +>getCls : () => Cls +>Cls : Cls + } +} + diff --git a/tests/baselines/reference/moduleAugmentationsImports4.js b/tests/baselines/reference/moduleAugmentationsImports4.js new file mode 100644 index 00000000000..9b64016113f --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports4.js @@ -0,0 +1,90 @@ +//// [tests/cases/compiler/moduleAugmentationsImports4.ts] //// + +//// [a.ts] + +export class A {} + +//// [b.ts] +export class B {x: number;} + +//// [c.d.ts] +declare module "C" { + class Cls {y: string; } +} + +//// [d.d.ts] +declare module "D" { + import {A} from "a"; + import {B} from "b"; + module "a" { + interface A { + getB(): B; + } + } +} + +//// [e.d.ts] +/// +declare module "E" { + import {A} from "a"; + import {Cls} from "C"; + + module "a" { + interface A { + getCls(): Cls; + } + } +} + +//// [main.ts] +/// +/// +import {A} from "./a"; +import "D"; +import "E"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); + +//// [f.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + var A = (function () { + function A() { + } + return A; + }()); + exports.A = A; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + var B = (function () { + function B() { + } + return B; + }()); + exports.B = B; +}); +define("main", ["require", "exports", "D", "E"], function (require, exports) { + "use strict"; + var a; + var b = a.getB().x.toFixed(); + var c = a.getCls().y.toLowerCase(); +}); + + +//// [f.d.ts] +/// +/// +declare module "a" { + export class A { + } +} +declare module "b" { + export class B { + x: number; + } +} +declare module "main" { +} diff --git a/tests/baselines/reference/moduleAugmentationsImports4.symbols b/tests/baselines/reference/moduleAugmentationsImports4.symbols new file mode 100644 index 00000000000..8d203de8519 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports4.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/main.ts === +/// +/// +import {A} from "./a"; +>A : Symbol(A, Decl(main.ts, 2, 8)) + +import "D"; +import "E"; + +let a: A; +>a : Symbol(a, Decl(main.ts, 6, 3)) +>A : Symbol(A, Decl(main.ts, 2, 8)) + +let b = a.getB().x.toFixed(); +>b : Symbol(b, Decl(main.ts, 7, 3)) +>a.getB().x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) +>a.getB().x : Symbol(B.x, Decl(b.ts, 0, 16)) +>a.getB : Symbol(A.getB, Decl(d.d.ts, 4, 21)) +>a : Symbol(a, Decl(main.ts, 6, 3)) +>getB : Symbol(A.getB, Decl(d.d.ts, 4, 21)) +>x : Symbol(B.x, Decl(b.ts, 0, 16)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, --, --)) + +let c = a.getCls().y.toLowerCase(); +>c : Symbol(c, Decl(main.ts, 8, 3)) +>a.getCls().y.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>a.getCls().y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>a.getCls : Symbol(A.getCls, Decl(e.d.ts, 6, 21)) +>a : Symbol(a, Decl(main.ts, 6, 3)) +>getCls : Symbol(A.getCls, Decl(e.d.ts, 6, 21)) +>y : Symbol(Cls.y, Decl(c.d.ts, 1, 15)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + +=== tests/cases/compiler/a.ts === + +export class A {} +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.d.ts, 3, 16), Decl(e.d.ts, 5, 16)) + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : Symbol(B, Decl(b.ts, 0, 0)) +>x : Symbol(x, Decl(b.ts, 0, 16)) + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Symbol(Cls, Decl(c.d.ts, 0, 20)) +>y : Symbol(y, Decl(c.d.ts, 1, 15)) +} + +=== tests/cases/compiler/d.d.ts === +declare module "D" { + import {A} from "a"; +>A : Symbol(A, Decl(d.d.ts, 1, 12)) + + import {B} from "b"; +>B : Symbol(B, Decl(d.d.ts, 2, 12)) + + module "a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.d.ts, 3, 16), Decl(e.d.ts, 5, 16)) + + getB(): B; +>getB : Symbol(getB, Decl(d.d.ts, 4, 21)) +>B : Symbol(B, Decl(d.d.ts, 2, 12)) + } + } +} + +=== tests/cases/compiler/e.d.ts === +/// +declare module "E" { + import {A} from "a"; +>A : Symbol(A, Decl(e.d.ts, 2, 12)) + + import {Cls} from "C"; +>Cls : Symbol(Cls, Decl(e.d.ts, 3, 12)) + + module "a" { + interface A { +>A : Symbol(A, Decl(a.ts, 0, 0), Decl(d.d.ts, 3, 16), Decl(e.d.ts, 5, 16)) + + getCls(): Cls; +>getCls : Symbol(getCls, Decl(e.d.ts, 6, 21)) +>Cls : Symbol(Cls, Decl(e.d.ts, 3, 12)) + } + } +} + diff --git a/tests/baselines/reference/moduleAugmentationsImports4.types b/tests/baselines/reference/moduleAugmentationsImports4.types new file mode 100644 index 00000000000..53d570e14e6 --- /dev/null +++ b/tests/baselines/reference/moduleAugmentationsImports4.types @@ -0,0 +1,93 @@ +=== tests/cases/compiler/main.ts === +/// +/// +import {A} from "./a"; +>A : typeof A + +import "D"; +import "E"; + +let a: A; +>a : A +>A : A + +let b = a.getB().x.toFixed(); +>b : string +>a.getB().x.toFixed() : string +>a.getB().x.toFixed : (fractionDigits?: number) => string +>a.getB().x : number +>a.getB() : B +>a.getB : () => B +>a : A +>getB : () => B +>x : number +>toFixed : (fractionDigits?: number) => string + +let c = a.getCls().y.toLowerCase(); +>c : string +>a.getCls().y.toLowerCase() : string +>a.getCls().y.toLowerCase : () => string +>a.getCls().y : string +>a.getCls() : Cls +>a.getCls : () => Cls +>a : A +>getCls : () => Cls +>y : string +>toLowerCase : () => string + +=== tests/cases/compiler/a.ts === + +export class A {} +>A : A + +=== tests/cases/compiler/b.ts === +export class B {x: number;} +>B : B +>x : number + +=== tests/cases/compiler/c.d.ts === +declare module "C" { + class Cls {y: string; } +>Cls : Cls +>y : string +} + +=== tests/cases/compiler/d.d.ts === +declare module "D" { + import {A} from "a"; +>A : typeof A + + import {B} from "b"; +>B : typeof B + + module "a" { + interface A { +>A : A + + getB(): B; +>getB : () => B +>B : B + } + } +} + +=== tests/cases/compiler/e.d.ts === +/// +declare module "E" { + import {A} from "a"; +>A : typeof A + + import {Cls} from "C"; +>Cls : typeof Cls + + module "a" { + interface A { +>A : A + + getCls(): Cls; +>getCls : () => Cls +>Cls : Cls + } + } +} + diff --git a/tests/baselines/reference/numericIndexerConstraint1.errors.txt b/tests/baselines/reference/numericIndexerConstraint1.errors.txt index 42cf293fe60..0d4bb17002b 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint1.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'Foo'. - Property 'foo' is missing in type 'Number'. ==== tests/cases/compiler/numericIndexerConstraint1.ts (1 errors) ==== @@ -8,5 +7,4 @@ tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'numb var result: Foo = x["one"]; // error ~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'Foo'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt index c35e49f02a3..f825c416311 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. Index signatures are incompatible. Type 'A' is not assignable to type 'B'. + Property 'y' is missing in type 'A'. ==== tests/cases/compiler/objectLiteralIndexerErrors.ts (1 errors) ==== @@ -21,4 +22,5 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ !!! error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'y' is missing in type 'A'. o1 = { x: c, 0: a }; // string indexer is any, number indexer is A \ No newline at end of file diff --git a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt index e1b0bb34529..6f45030a650 100644 --- a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt +++ b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt @@ -2,7 +2,6 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type 'string' is not assignable to type 'IArguments'. - Property 'callee' is missing in type 'String'. ==== tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts (4 errors) ==== @@ -20,6 +19,5 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy !!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'IArguments'. -!!! error TS2322: Property 'callee' is missing in type 'String'. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserharness.errors.txt b/tests/baselines/reference/parserharness.errors.txt index 66afa3d010f..963ce12ddf1 100644 --- a/tests/baselines/reference/parserharness.errors.txt +++ b/tests/baselines/reference/parserharness.errors.txt @@ -7,11 +7,11 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(25,17): er tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(43,19): error TS2304: Cannot find name 'require'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(44,14): error TS2304: Cannot find name 'require'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(341,13): error TS2304: Cannot find name 'errorHandlerStack'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(347,13): error TS2304: Cannot find name 'errorHandlerStack'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(351,17): error TS2304: Cannot find name 'errorHandlerStack'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,17): error TS2304: Cannot find name 'errorHandlerStack'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,35): error TS2304: Cannot find name 'errorHandlerStack'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(341,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(347,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(351,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(354,35): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(691,50): error TS2304: Cannot find name 'ITextWriter'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(716,47): error TS2503: Cannot find namespace 'TypeScript'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(721,62): error TS2304: Cannot find name 'ITextWriter'. @@ -471,7 +471,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): static pushGlobalErrorHandler(done: IDone) { errorHandlerStack.push(function (e) { ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'errorHandlerStack'. +!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? done(e); }); } @@ -479,20 +479,20 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): static popGlobalErrorHandler() { errorHandlerStack.pop(); ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'errorHandlerStack'. +!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? } static handleError(e: Error) { if (errorHandlerStack.length === 0) { ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'errorHandlerStack'. +!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? IO.printLine('Global error: ' + e); } else { errorHandlerStack[errorHandlerStack.length - 1](e); ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'errorHandlerStack'. +!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'errorHandlerStack'. +!!! error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? } } } diff --git a/tests/baselines/reference/parserindenter.errors.txt b/tests/baselines/reference/parserindenter.errors.txt index a332abab7bb..8ccc9220710 100644 --- a/tests/baselines/reference/parserindenter.errors.txt +++ b/tests/baselines/reference/parserindenter.errors.txt @@ -28,7 +28,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(152,63): tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(153,30): error TS2304: Cannot find name 'List_TextEditInfo'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(155,32): error TS2304: Cannot find name 'AuthorTokenKind'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(182,79): error TS2503: Cannot find namespace 'Services'. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(183,20): error TS2304: Cannot find name 'GetIndentSizeFromText'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(183,20): error TS2662: Cannot find name 'GetIndentSizeFromText'. Did you mean the static member 'Indenter.GetIndentSizeFromText'? tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(186,67): error TS2503: Cannot find namespace 'Services'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(207,50): error TS2304: Cannot find name 'TokenSpan'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(207,67): error TS2304: Cannot find name 'ParseNode'. @@ -373,7 +373,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserindenter.ts(736,38): !!! error TS2503: Cannot find namespace 'Services'. return GetIndentSizeFromText(indentText, editorOptions, /*includeNonIndentChars:*/ false); ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'GetIndentSizeFromText'. +!!! error TS2662: Cannot find name 'GetIndentSizeFromText'. Did you mean the static member 'Indenter.GetIndentSizeFromText'? } static GetIndentSizeFromText(text: string, editorOptions: Services.EditorOptions, includeNonIndentChars: boolean): number { diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index 236418a10ae..05bb3559f1a 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -1,3 +1,4 @@ +tests/cases/compiler/privacyGloImportParseErrors.ts(22,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. @@ -13,12 +14,12 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(125,45): error TS1147: Impor tests/cases/compiler/privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyGloImportParseErrors.ts(133,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. -tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2664: Invalid module name in augmentation, module 'abc3' cannot be found. tests/cases/compiler/privacyGloImportParseErrors.ts(146,25): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Import declarations in a namespace cannot reference a module. -==== tests/cases/compiler/privacyGloImportParseErrors.ts (18 errors) ==== +==== tests/cases/compiler/privacyGloImportParseErrors.ts (19 errors) ==== module m1 { export module m1_M1_public { export class c1 { @@ -41,6 +42,8 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor } export declare module "m1_M3_public" { + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); @@ -191,7 +194,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(149,29): error TS1147: Impor } module "abc3" { ~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'abc3' cannot be found. } } diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index 5bae45f405c..1826ac7226a 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -1,3 +1,4 @@ +tests/cases/compiler/privacyImportParseErrors.ts(22,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS1147: Import declarations in a namespace cannot reference a module. @@ -6,6 +7,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS1147: Import de tests/cases/compiler/privacyImportParseErrors.ts(69,37): error TS2307: Cannot find module 'm1_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(81,43): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(82,43): error TS1147: Import declarations in a namespace cannot reference a module. +tests/cases/compiler/privacyImportParseErrors.ts(106,5): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyImportParseErrors.ts(106,27): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(114,20): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS1147: Import declarations in a namespace cannot reference a module. @@ -14,31 +16,35 @@ tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS1147: Import d tests/cases/compiler/privacyImportParseErrors.ts(153,37): error TS2307: Cannot find module 'm2_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(166,43): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(167,43): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. -tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(180,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(180,23): error TS2664: Invalid module name in augmentation, module 'glo_M2_public' cannot be found. +tests/cases/compiler/privacyImportParseErrors.ts(198,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(198,23): error TS2664: Invalid module name in augmentation, module 'glo_M4_private' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(218,34): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(238,34): error TS2307: Cannot find module 'glo_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(251,40): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(252,40): error TS2307: Cannot find module 'glo_M4_private'. -tests/cases/compiler/privacyImportParseErrors.ts(255,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(255,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. +tests/cases/compiler/privacyImportParseErrors.ts(255,23): error TS2664: Invalid module name in augmentation, module 'use_glo_M1_public' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(258,45): error TS2304: Cannot find name 'use_glo_M1_public'. tests/cases/compiler/privacyImportParseErrors.ts(261,39): error TS2304: Cannot find name 'use_glo_M1_public'. tests/cases/compiler/privacyImportParseErrors.ts(264,40): error TS2307: Cannot find module 'glo_M2_public'. tests/cases/compiler/privacyImportParseErrors.ts(273,38): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(277,45): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(284,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(284,16): error TS2664: Invalid module name in augmentation, module 'use_glo_M3_private' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(287,46): error TS2304: Cannot find name 'use_glo_M3_private'. tests/cases/compiler/privacyImportParseErrors.ts(290,40): error TS2304: Cannot find name 'use_glo_M3_private'. tests/cases/compiler/privacyImportParseErrors.ts(293,41): error TS2307: Cannot find module 'glo_M4_private'. tests/cases/compiler/privacyImportParseErrors.ts(302,38): error TS1147: Import declarations in a namespace cannot reference a module. tests/cases/compiler/privacyImportParseErrors.ts(306,45): error TS1147: Import declarations in a namespace cannot reference a module. -tests/cases/compiler/privacyImportParseErrors.ts(312,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(312,16): error TS2664: Invalid module name in augmentation, module 'anotherParseError' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(314,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyImportParseErrors.ts(314,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(319,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(322,12): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(326,1): error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. tests/cases/compiler/privacyImportParseErrors.ts(326,9): error TS1029: 'export' modifier must precede 'declare' modifier. -tests/cases/compiler/privacyImportParseErrors.ts(326,23): error TS2435: Ambient modules cannot be nested in other modules or namespaces. +tests/cases/compiler/privacyImportParseErrors.ts(326,23): error TS2664: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. tests/cases/compiler/privacyImportParseErrors.ts(328,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyImportParseErrors.ts(328,24): error TS2435: Ambient modules cannot be nested in other modules or namespaces. tests/cases/compiler/privacyImportParseErrors.ts(333,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces. @@ -49,7 +55,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(350,25): error TS1147: Import d tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import declarations in a namespace cannot reference a module. -==== tests/cases/compiler/privacyImportParseErrors.ts (49 errors) ==== +==== tests/cases/compiler/privacyImportParseErrors.ts (55 errors) ==== export module m1 { export module m1_M1_public { export class c1 { @@ -72,6 +78,8 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d } export declare module "m1_M3_public" { + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); @@ -172,6 +180,8 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d } export declare module "m2_M3_public" { + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~ !!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. export function f1(); @@ -262,8 +272,10 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d } export declare module "glo_M2_public" { + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'glo_M2_public' cannot be found. export function f1(); export class c1 { } @@ -282,8 +294,10 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d } export declare module "glo_M4_private" { + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'glo_M4_private' cannot be found. export function f1(); export class c1 { } @@ -349,8 +363,10 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d export declare module "use_glo_M1_public" { + ~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'use_glo_M1_public' cannot be found. import use_glo_M1_public = glo_M1_public; export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; }; export var use_glo_M1_public_v2_public: use_glo_M1_public; @@ -391,7 +407,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "use_glo_M3_private" { ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'use_glo_M3_private' cannot be found. import use_glo_M3_private = glo_M3_private; export var use_glo_M3_private_v1_public: { new (): use_glo_M3_private.c1; }; export var use_glo_M3_private_v2_public: use_glo_M3_private; @@ -431,7 +447,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d declare module "anotherParseError" { ~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'anotherParseError' cannot be found. module m2 { declare module "abc" { ~~~~~~~ @@ -454,10 +470,12 @@ tests/cases/compiler/privacyImportParseErrors.ts(353,29): error TS1147: Import d } declare export module "anotherParseError2" { + ~~~~~~~ +!!! error TS2668: 'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible. ~~~~~~ !!! error TS1029: 'export' modifier must precede 'declare' modifier. ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2435: Ambient modules cannot be nested in other modules or namespaces. +!!! error TS2664: Invalid module name in augmentation, module 'anotherParseError2' cannot be found. module m2 { declare module "abc" { ~~~~~~~ diff --git a/tests/baselines/reference/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt index bd3e52fcc1c..7396d03059a 100644 --- a/tests/baselines/reference/promiseChaining1.errors.txt +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. Type 'string' is not assignable to type 'Function'. - Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining1.ts (1 errors) ==== @@ -14,7 +13,6 @@ tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type ' ~~~~~~~~~~ !!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. !!! error TS2345: Type 'string' is not assignable to type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'String'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining2.errors.txt b/tests/baselines/reference/promiseChaining2.errors.txt index f12baebd4dc..a31c4335da7 100644 --- a/tests/baselines/reference/promiseChaining2.errors.txt +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. Type 'string' is not assignable to type 'Function'. - Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining2.ts (1 errors) ==== @@ -14,7 +13,6 @@ tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type ' ~~~~~~~~~~ !!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. !!! error TS2345: Type 'string' is not assignable to type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'String'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index a74938f5dd9..4edfff05a5a 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/promisePermutations.ts(74,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations.ts(79,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -157,7 +156,6 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 8afceeae0fd..dda9a08b38d 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations2.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -156,7 +155,6 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index b17021a02b9..c6c2bca62a4 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations3.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. @@ -159,7 +158,6 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index f38fc93ccde..c3447664c96 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,7 +1,5 @@ tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I'. - Property 'p' is missing in type 'Number'. tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2'. - Property 'q' is missing in type 'Number'. tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3'. Property 'zeep' is missing in type 'I4'. tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]'. @@ -40,7 +38,6 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var z:I=3; ~ !!! error TS2322: Type 'number' is not assignable to type 'I'. -!!! error TS2322: Property 'p' is missing in type 'Number'. export interface I2 { q; } @@ -52,7 +49,6 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var z:T.U.I2=3; ~ !!! error TS2322: Type 'number' is not assignable to type 'I2'. -!!! error TS2322: Property 'q' is missing in type 'Number'. } } diff --git a/tests/baselines/reference/reExportGlobalDeclaration1.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration1.errors.txt new file mode 100644 index 00000000000..0ebeed05b28 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration1.errors.txt @@ -0,0 +1,57 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,12): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,13): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,12): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(5,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(5,12): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(8,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(9,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(10,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(11,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare var x: number; + declare var x1: number; + declare let {a, b}: {a: number, b: number}; + +==== tests/cases/compiler/file2.ts (12 errors) ==== + export {x, x as y}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {x1, x1 as y1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + + export {a, a as a1}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {b, b as b1}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + + + export {x as z}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {x1 as z1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {a as a2}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {b as b2}; + ~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration1.js b/tests/baselines/reference/reExportGlobalDeclaration1.js new file mode 100644 index 00000000000..c0db9a0eaf3 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration1.js @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration1.ts] //// + +//// [file1.d.ts] + +declare var x: number; +declare var x1: number; +declare let {a, b}: {a: number, b: number}; + +//// [file2.ts] +export {x, x as y}; +export {x1, x1 as y1}; + +export {a, a as a1}; +export {b, b as b1}; + + +export {x as z}; +export {x1 as z1}; +export {a as a2}; +export {b as b2}; + + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reExportGlobalDeclaration2.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration2.errors.txt new file mode 100644 index 00000000000..17a3e2ad565 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration2.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,13): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,13): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(3,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare interface I1 { + x: number + } + + declare interface I2 { + x: number + } + +==== tests/cases/compiler/file2.ts (6 errors) ==== + export {I1, I1 as II1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {I2, I2 as II2}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {I1 as III1}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {I2 as III2}; + ~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration2.js b/tests/baselines/reference/reExportGlobalDeclaration2.js new file mode 100644 index 00000000000..160a9b28f54 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration2.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration2.ts] //// + +//// [file1.d.ts] + +declare interface I1 { + x: number +} + +declare interface I2 { + x: number +} + +//// [file2.ts] +export {I1, I1 as II1}; +export {I2, I2 as II2}; +export {I1 as III1}; +export {I2 as III2}; + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reExportGlobalDeclaration3.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration3.errors.txt new file mode 100644 index 00000000000..d99c184518c --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration3.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,14): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,14): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(3,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare namespace NS1 { + export var foo: number; + } + + declare namespace NS2 { + export var foo: number; + } + +==== tests/cases/compiler/file2.ts (6 errors) ==== + export {NS1, NS1 as NNS1}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {NS2, NS2 as NNS2}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {NS1 as NNNS1}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {NS2 as NNNS2}; + ~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration3.js b/tests/baselines/reference/reExportGlobalDeclaration3.js new file mode 100644 index 00000000000..e1b85b6b8d5 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration3.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration3.ts] //// + +//// [file1.d.ts] + +declare namespace NS1 { + export var foo: number; +} + +declare namespace NS2 { + export var foo: number; +} + +//// [file2.ts] +export {NS1, NS1 as NNS1}; +export {NS2, NS2 as NNS2}; +export {NS1 as NNNS1}; +export {NS2 as NNNS2}; + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reExportGlobalDeclaration4.errors.txt b/tests/baselines/reference/reExportGlobalDeclaration4.errors.txt new file mode 100644 index 00000000000..5e250a5fc57 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration4.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/file2.ts(1,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(1,15): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(2,15): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(3,9): error TS2661: Cannot re-export name that is not defined in the module. +tests/cases/compiler/file2.ts(4,9): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/file1.d.ts (0 errors) ==== + + declare class Cls1 { + x: number + } + declare class Cls2 { + x: number + } + + +==== tests/cases/compiler/file2.ts (6 errors) ==== + export {Cls1, Cls1 as CCls1}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {Cls2, Cls2 as CCls2}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {Cls1 as CCCls1}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. + export {Cls2 as CCCls2}; + ~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. \ No newline at end of file diff --git a/tests/baselines/reference/reExportGlobalDeclaration4.js b/tests/baselines/reference/reExportGlobalDeclaration4.js new file mode 100644 index 00000000000..09d6b760790 --- /dev/null +++ b/tests/baselines/reference/reExportGlobalDeclaration4.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reExportGlobalDeclaration4.ts] //// + +//// [file1.d.ts] + +declare class Cls1 { + x: number +} +declare class Cls2 { + x: number +} + + +//// [file2.ts] +export {Cls1, Cls1 as CCls1}; +export {Cls2, Cls2 as CCls2}; +export {Cls1 as CCCls1}; +export {Cls2 as CCCls2}; + +//// [file2.js] +"use strict"; diff --git a/tests/baselines/reference/reExportUndefined1.errors.txt b/tests/baselines/reference/reExportUndefined1.errors.txt new file mode 100644 index 00000000000..ff3259ae37e --- /dev/null +++ b/tests/baselines/reference/reExportUndefined1.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/a.ts(2,10): error TS2661: Cannot re-export name that is not defined in the module. + + +==== tests/cases/compiler/a.ts (1 errors) ==== + + export { undefined }; + ~~~~~~~~~ +!!! error TS2661: Cannot re-export name that is not defined in the module. \ No newline at end of file diff --git a/tests/baselines/reference/reExportUndefined1.js b/tests/baselines/reference/reExportUndefined1.js new file mode 100644 index 00000000000..94729e4f544 --- /dev/null +++ b/tests/baselines/reference/reExportUndefined1.js @@ -0,0 +1,6 @@ +//// [a.ts] + +export { undefined }; + +//// [a.js] +"use strict"; diff --git a/tests/baselines/reference/reExportUndefined2.js b/tests/baselines/reference/reExportUndefined2.js new file mode 100644 index 00000000000..53b78599cbe --- /dev/null +++ b/tests/baselines/reference/reExportUndefined2.js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/reExportUndefined2.ts] //// + +//// [a.ts] + +var undefined; +export { undefined }; + +//// [b.ts] +import { undefined } from "./a"; +declare function use(a: number); +use(undefined); + +//// [a.js] +"use strict"; +var undefined; +exports.undefined = undefined; +//// [b.js] +"use strict"; +var a_1 = require("./a"); +use(a_1.undefined); diff --git a/tests/baselines/reference/reExportUndefined2.symbols b/tests/baselines/reference/reExportUndefined2.symbols new file mode 100644 index 00000000000..c4f532ed6dc --- /dev/null +++ b/tests/baselines/reference/reExportUndefined2.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/a.ts === + +var undefined; +>undefined : Symbol(undefined, Decl(a.ts, 1, 3)) + +export { undefined }; +>undefined : Symbol(undefined, Decl(a.ts, 2, 8)) + +=== tests/cases/compiler/b.ts === +import { undefined } from "./a"; +>undefined : Symbol(undefined, Decl(b.ts, 0, 8)) + +declare function use(a: number); +>use : Symbol(use, Decl(b.ts, 0, 32)) +>a : Symbol(a, Decl(b.ts, 1, 21)) + +use(undefined); +>use : Symbol(use, Decl(b.ts, 0, 32)) +>undefined : Symbol(undefined, Decl(b.ts, 0, 8)) + diff --git a/tests/baselines/reference/reExportUndefined2.types b/tests/baselines/reference/reExportUndefined2.types new file mode 100644 index 00000000000..d3f3dc9d726 --- /dev/null +++ b/tests/baselines/reference/reExportUndefined2.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/a.ts === + +var undefined; +>undefined : any + +export { undefined }; +>undefined : any + +=== tests/cases/compiler/b.ts === +import { undefined } from "./a"; +>undefined : any + +declare function use(a: number); +>use : (a: number) => any +>a : number + +use(undefined); +>use(undefined) : any +>use : (a: number) => any +>undefined : any + diff --git a/tests/baselines/reference/reachabilityChecks7.js b/tests/baselines/reference/reachabilityChecks7.js index c78f99953e9..75338742700 100644 --- a/tests/baselines/reference/reachabilityChecks7.js +++ b/tests/baselines/reference/reachabilityChecks7.js @@ -31,17 +31,12 @@ declare function use(s: string): void; let x1 = () => { use("Test"); } //// [reachabilityChecks7.js] -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { - return new Promise(function (resolve, reject) { - generator = generator.call(thisArg, _arguments); - function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } - function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } - function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } - function step(verb, value) { - var result = generator[verb](value); - result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); - } - step("next", void 0); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new P(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); }); }; // async function without return type annotation - error diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.symbols b/tests/baselines/reference/reactNamespaceImportPresevation.symbols index 8a4407c8160..e2f530d31ba 100644 --- a/tests/baselines/reference/reactNamespaceImportPresevation.symbols +++ b/tests/baselines/reference/reactNamespaceImportPresevation.symbols @@ -16,5 +16,6 @@ declare var foo: any; >foo : Symbol(foo, Decl(test.tsx, 1, 11)) ; +>foo : Symbol(unknown) >data : Symbol(unknown) diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.symbols b/tests/baselines/reference/reactNamespaceJSXEmit.symbols index d79c1cf531e..3ca5b91e538 100644 --- a/tests/baselines/reference/reactNamespaceJSXEmit.symbols +++ b/tests/baselines/reference/reactNamespaceJSXEmit.symbols @@ -13,6 +13,7 @@ declare var x: any; >x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11)) ; +>foo : Symbol(unknown) >data : Symbol(unknown) ; @@ -21,6 +22,8 @@ declare var x: any; >x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11)) ; +>x-component : Symbol(unknown) + ; >Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11)) >x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11)) diff --git a/tests/baselines/reference/recursiveClassReferenceTest.errors.txt b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt index 088d7222f48..4a1a6f1782c 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.errors.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/recursiveClassReferenceTest.ts(16,19): error TS2304: Cannot find name 'Element'. -tests/cases/compiler/recursiveClassReferenceTest.ts(56,11): error TS2304: Cannot find name 'domNode'. -tests/cases/compiler/recursiveClassReferenceTest.ts(88,36): error TS2304: Cannot find name 'mode'. +tests/cases/compiler/recursiveClassReferenceTest.ts(56,11): error TS2663: Cannot find name 'domNode'. Did you mean the instance member 'this.domNode'? +tests/cases/compiler/recursiveClassReferenceTest.ts(88,36): error TS2663: Cannot find name 'mode'. Did you mean the instance member 'this.mode'? tests/cases/compiler/recursiveClassReferenceTest.ts(95,21): error TS2345: Argument of type 'Window' is not assignable to parameter of type 'IMode'. Property 'getInitialState' is missing in type 'Window'. @@ -65,7 +65,7 @@ tests/cases/compiler/recursiveClassReferenceTest.ts(95,21): error TS2345: Argume public getDomNode() { return domNode; ~~~~~~~ -!!! error TS2304: Cannot find name 'domNode'. +!!! error TS2663: Cannot find name 'domNode'. Did you mean the instance member 'this.domNode'? } public destroy() { @@ -99,7 +99,7 @@ tests/cases/compiler/recursiveClassReferenceTest.ts(95,21): error TS2345: Argume public getMode(): IMode { return mode; } ~~~~ -!!! error TS2304: Cannot find name 'mode'. +!!! error TS2663: Cannot find name 'mode'. Did you mean the instance member 'this.mode'? } export class Mode extends AbstractMode { diff --git a/tests/baselines/reference/restArgAssignmentCompat.errors.txt b/tests/baselines/reference/restArgAssignmentCompat.errors.txt index 2ea07395099..c17d28cb28b 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.errors.txt +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/restArgAssignmentCompat.ts (1 errors) ==== @@ -16,6 +15,5 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: !!! error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. n([4], 'foo'); \ No newline at end of file diff --git a/tests/baselines/reference/returnInConstructor1.errors.txt b/tests/baselines/reference/returnInConstructor1.errors.txt index dbe3b9e5ee8..30f629f9f8a 100644 --- a/tests/baselines/reference/returnInConstructor1.errors.txt +++ b/tests/baselines/reference/returnInConstructor1.errors.txt @@ -1,8 +1,6 @@ tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2322: Type 'number' is not assignable to type 'B'. - Property 'foo' is missing in type 'Number'. tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2322: Type 'string' is not assignable to type 'D'. - Property 'foo' is missing in type 'String'. tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/compiler/returnInConstructor1.ts(39,16): error TS2322: Type '{ foo: number; }' is not assignable to type 'F'. Types of property 'foo' are incompatible. @@ -28,7 +26,6 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o return 1; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'B'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } @@ -47,7 +44,6 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o return "test"; // error ~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'D'. -!!! error TS2322: Property 'foo' is missing in type 'String'. ~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/scannertest1.errors.txt b/tests/baselines/reference/scannertest1.errors.txt index 14a19b28851..3831dbe398e 100644 --- a/tests/baselines/reference/scannertest1.errors.txt +++ b/tests/baselines/reference/scannertest1.errors.txt @@ -1,14 +1,14 @@ tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(1,1): error TS6053: File 'tests/cases/conformance/scanner/ecmascript5/References.ts' not found. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. -tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(9,16): error TS2304: Cannot find name 'isDecimalDigit'. +tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(10,22): error TS2304: Cannot find name 'CharacterCodes'. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(10,47): error TS2304: Cannot find name 'CharacterCodes'. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(11,22): error TS2304: Cannot find name 'CharacterCodes'. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(11,47): error TS2304: Cannot find name 'CharacterCodes'. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(15,9): error TS2304: Cannot find name 'Debug'. -tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(15,22): error TS2304: Cannot find name 'isHexDigit'. -tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(16,16): error TS2304: Cannot find name 'isDecimalDigit'. +tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(15,22): error TS2662: Cannot find name 'isHexDigit'. Did you mean the static member 'CharacterInfo.isHexDigit'? +tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(16,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(17,20): error TS2304: Cannot find name 'CharacterCodes'. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(18,21): error TS2304: Cannot find name 'CharacterCodes'. tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(18,46): error TS2304: Cannot find name 'CharacterCodes'. @@ -33,7 +33,7 @@ tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(20,23): error TS2304 public static isHexDigit(c: number): boolean { return isDecimalDigit(c) || ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'isDecimalDigit'. +!!! error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? (c >= CharacterCodes.A && c <= CharacterCodes.F) || ~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'CharacterCodes'. @@ -51,10 +51,10 @@ tests/cases/conformance/scanner/ecmascript5/scannertest1.ts(20,23): error TS2304 ~~~~~ !!! error TS2304: Cannot find name 'Debug'. ~~~~~~~~~~ -!!! error TS2304: Cannot find name 'isHexDigit'. +!!! error TS2662: Cannot find name 'isHexDigit'. Did you mean the static member 'CharacterInfo.isHexDigit'? return isDecimalDigit(c) ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'isDecimalDigit'. +!!! error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? ? (c - CharacterCodes._0) ~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'CharacterCodes'. diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.errors.txt b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.errors.txt index c59171bdf0e..378e20f19b8 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.errors.txt +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(4,7): error TS2304: Cannot find name 'v'. -tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(6,7): error TS2304: Cannot find name 's'. +tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(4,7): error TS2663: Cannot find name 'v'. Did you mean the instance member 'this.v'? +tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(6,7): error TS2662: Cannot find name 's'. Did you mean the static member 'D.s'? ==== tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts (2 errors) ==== @@ -8,10 +8,10 @@ tests/cases/compiler/scopeCheckExtendedClassInsidePublicMethod2.ts(6,7): error T public c() { v = 1; ~ -!!! error TS2304: Cannot find name 'v'. +!!! error TS2663: Cannot find name 'v'. Did you mean the instance member 'this.v'? this.p = 1; s = 1; ~ -!!! error TS2304: Cannot find name 's'. +!!! error TS2662: Cannot find name 's'. Did you mean the static member 'D.s'? } } \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.errors.txt b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.errors.txt index a6ecd488278..dd3e5ef446b 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.errors.txt +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(4,7): error TS2304: Cannot find name 'v'. tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(5,12): error TS2339: Property 'p' does not exist on type 'typeof D'. -tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(6,7): error TS2304: Cannot find name 's'. +tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(6,7): error TS2662: Cannot find name 's'. Did you mean the static member 'D.s'? ==== tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts (3 errors) ==== @@ -15,6 +15,6 @@ tests/cases/compiler/scopeCheckExtendedClassInsideStaticMethod1.ts(6,7): error T !!! error TS2339: Property 'p' does not exist on type 'typeof D'. s = 1; ~ -!!! error TS2304: Cannot find name 's'. +!!! error TS2662: Cannot find name 's'. Did you mean the static member 'D.s'? } } \ No newline at end of file diff --git a/tests/baselines/reference/scopeCheckInsidePublicMethod1.errors.txt b/tests/baselines/reference/scopeCheckInsidePublicMethod1.errors.txt index 5c9473a7875..ec93fea7369 100644 --- a/tests/baselines/reference/scopeCheckInsidePublicMethod1.errors.txt +++ b/tests/baselines/reference/scopeCheckInsidePublicMethod1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/scopeCheckInsidePublicMethod1.ts(4,7): error TS2304: Cannot find name 's'. +tests/cases/compiler/scopeCheckInsidePublicMethod1.ts(4,7): error TS2662: Cannot find name 's'. Did you mean the static member 'C.s'? ==== tests/cases/compiler/scopeCheckInsidePublicMethod1.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/scopeCheckInsidePublicMethod1.ts(4,7): error TS2304: Cannot public a() { s = 1; // ERR ~ -!!! error TS2304: Cannot find name 's'. +!!! error TS2662: Cannot find name 's'. Did you mean the static member 'C.s'? } } \ No newline at end of file diff --git a/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.js b/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.js index cab16b96bc3..d52622dffc7 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.js +++ b/tests/baselines/reference/shorthandPropertyAssignmentInES6Module.js @@ -20,8 +20,8 @@ use(foo); exports.x = 1; //// [test.js] "use strict"; -var existingModule_1 = require('./existingModule'); -var missingModule_1 = require('./missingModule'); +const existingModule_1 = require('./existingModule'); +const missingModule_1 = require('./missingModule'); const test = { x: existingModule_1.x, foo: missingModule_1.foo }; use(existingModule_1.x); use(missingModule_1.foo); diff --git a/tests/baselines/reference/sourceMapSample.js.map b/tests/baselines/reference/sourceMapSample.js.map index 2429a04c88b..0617ba4c1ba 100644 --- a/tests/baselines/reference/sourceMapSample.js.map +++ b/tests/baselines/reference/sourceMapSample.js.map @@ -1,2 +1,2 @@ //// [sourceMapSample.js.map] -{"version":3,"file":"sourceMapSample.js","sourceRoot":"","sources":["sourceMapSample.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkCT;AAlCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAkCb;IAlCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,uBAA0B;iBAA1B,WAA0B,CAA1B,sBAA0B,CAA1B,IAA0B;gBAA1B,sCAA0B;;YACtD,IAAI,QAAQ,GAAc,EAAE,CAAC;YAC7B,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAlCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAkCb;AAAD,CAAC,EAlCM,GAAG,KAAH,GAAG,QAkCT"} \ No newline at end of file +{"version":3,"file":"sourceMapSample.js","sourceRoot":"","sources":["sourceMapSample.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkCT;AAlCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAkCb;IAlCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,uBAA0B;iBAA1B,WAA0B,CAA1B,sBAA0B,CAA1B,IAA0B;gBAA1B,sCAA0B;;YACtD,IAAI,QAAQ,GAAc,EAAE,CAAC;YAC7B,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAlCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAkCb;AAAD,CAAC,EAlCM,GAAG,KAAH,GAAG,QAkCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.sourcemap.txt b/tests/baselines/reference/sourceMapSample.sourcemap.txt index 0fb03dacf48..5b3251226b9 100644 --- a/tests/baselines/reference/sourceMapSample.sourcemap.txt +++ b/tests/baselines/reference/sourceMapSample.sourcemap.txt @@ -525,64 +525,61 @@ sourceFile:sourceMapSample.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^^^^^^^^^^^^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ -21> ^^-> +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ +20> ^^-> 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> restGreetings -14> . -15> length -16> ; -17> i -18> ++ -19> ) -20> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> restGreetings +13> . +14> length +15> ; +16> i +17> ++ +18> ) +19> { 1->Emitted(27, 13) Source(24, 9) + SourceIndex(0) 2 >Emitted(27, 16) Source(24, 12) + SourceIndex(0) 3 >Emitted(27, 17) Source(24, 13) + SourceIndex(0) 4 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) -5 >Emitted(27, 21) Source(24, 17) + SourceIndex(0) -6 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) -7 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) -8 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) -9 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) -10>Emitted(27, 29) Source(24, 25) + SourceIndex(0) -11>Emitted(27, 30) Source(24, 26) + SourceIndex(0) -12>Emitted(27, 33) Source(24, 29) + SourceIndex(0) -13>Emitted(27, 46) Source(24, 42) + SourceIndex(0) -14>Emitted(27, 47) Source(24, 43) + SourceIndex(0) -15>Emitted(27, 53) Source(24, 49) + SourceIndex(0) -16>Emitted(27, 55) Source(24, 51) + SourceIndex(0) -17>Emitted(27, 56) Source(24, 52) + SourceIndex(0) -18>Emitted(27, 58) Source(24, 54) + SourceIndex(0) -19>Emitted(27, 60) Source(24, 56) + SourceIndex(0) -20>Emitted(27, 61) Source(24, 57) + SourceIndex(0) +5 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) +6 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) +7 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) +8 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) +9 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) +10>Emitted(27, 30) Source(24, 26) + SourceIndex(0) +11>Emitted(27, 33) Source(24, 29) + SourceIndex(0) +12>Emitted(27, 46) Source(24, 42) + SourceIndex(0) +13>Emitted(27, 47) Source(24, 43) + SourceIndex(0) +14>Emitted(27, 53) Source(24, 49) + SourceIndex(0) +15>Emitted(27, 55) Source(24, 51) + SourceIndex(0) +16>Emitted(27, 56) Source(24, 52) + SourceIndex(0) +17>Emitted(27, 58) Source(24, 54) + SourceIndex(0) +18>Emitted(27, 60) Source(24, 56) + SourceIndex(0) +19>Emitted(27, 61) Source(24, 57) + SourceIndex(0) --- >>> greeters.push(new Greeter(restGreetings[i])); 1->^^^^^^^^^^^^^^^^ @@ -720,63 +717,60 @@ sourceFile:sourceMapSample.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > j -8 > = -9 > 0 -10> ; -11> j -12> < -13> b -14> . -15> length -16> ; -17> j -18> ++ -19> ) -20> { +5 > var +6 > j +7 > = +8 > 0 +9 > ; +10> j +11> < +12> b +13> . +14> length +15> ; +16> j +17> ++ +18> ) +19> { 1->Emitted(33, 9) Source(32, 5) + SourceIndex(0) 2 >Emitted(33, 12) Source(32, 8) + SourceIndex(0) 3 >Emitted(33, 13) Source(32, 9) + SourceIndex(0) 4 >Emitted(33, 14) Source(32, 10) + SourceIndex(0) -5 >Emitted(33, 17) Source(32, 13) + SourceIndex(0) -6 >Emitted(33, 18) Source(32, 14) + SourceIndex(0) -7 >Emitted(33, 19) Source(32, 15) + SourceIndex(0) -8 >Emitted(33, 22) Source(32, 18) + SourceIndex(0) -9 >Emitted(33, 23) Source(32, 19) + SourceIndex(0) -10>Emitted(33, 25) Source(32, 21) + SourceIndex(0) -11>Emitted(33, 26) Source(32, 22) + SourceIndex(0) -12>Emitted(33, 29) Source(32, 25) + SourceIndex(0) -13>Emitted(33, 30) Source(32, 26) + SourceIndex(0) -14>Emitted(33, 31) Source(32, 27) + SourceIndex(0) -15>Emitted(33, 37) Source(32, 33) + SourceIndex(0) -16>Emitted(33, 39) Source(32, 35) + SourceIndex(0) -17>Emitted(33, 40) Source(32, 36) + SourceIndex(0) -18>Emitted(33, 42) Source(32, 38) + SourceIndex(0) -19>Emitted(33, 44) Source(32, 40) + SourceIndex(0) -20>Emitted(33, 45) Source(32, 41) + SourceIndex(0) +5 >Emitted(33, 18) Source(32, 14) + SourceIndex(0) +6 >Emitted(33, 19) Source(32, 15) + SourceIndex(0) +7 >Emitted(33, 22) Source(32, 18) + SourceIndex(0) +8 >Emitted(33, 23) Source(32, 19) + SourceIndex(0) +9 >Emitted(33, 25) Source(32, 21) + SourceIndex(0) +10>Emitted(33, 26) Source(32, 22) + SourceIndex(0) +11>Emitted(33, 29) Source(32, 25) + SourceIndex(0) +12>Emitted(33, 30) Source(32, 26) + SourceIndex(0) +13>Emitted(33, 31) Source(32, 27) + SourceIndex(0) +14>Emitted(33, 37) Source(32, 33) + SourceIndex(0) +15>Emitted(33, 39) Source(32, 35) + SourceIndex(0) +16>Emitted(33, 40) Source(32, 36) + SourceIndex(0) +17>Emitted(33, 42) Source(32, 38) + SourceIndex(0) +18>Emitted(33, 44) Source(32, 40) + SourceIndex(0) +19>Emitted(33, 45) Source(32, 41) + SourceIndex(0) --- >>> b[j].greet(); 1 >^^^^^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationClasses.js.map b/tests/baselines/reference/sourceMapValidationClasses.js.map index 08ed68ebca7..bddc7694f10 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.js.map +++ b/tests/baselines/reference/sourceMapValidationClasses.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClasses.js.map] -{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAmCb;IAnCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,kBAAiB,mBAAmB,MAAU;iBAA9C,WAA8C,CAA9C,sBAA8C,CAA9C,IAA8C;gBAA9C,cAAiB,mBAAmB,yBAAU;;YAC1E,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,qCAAqC;QACrC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAnCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAmCb;AAAD,CAAC,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAmCb;IAnCU,WAAA,GAAG,EAAC,CAAC;QACZ,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,kBAAiB,mBAAmB,MAAU;iBAA9C,WAA8C,CAA9C,sBAA8C,CAA9C,IAA8C;gBAA9C,cAAiB,mBAAmB,yBAAU;;YAC1E,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,qCAAqC;QACrC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAnCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAmCb;AAAD,CAAC,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt index 4501ec5d872..29ad93cf74d 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -545,64 +545,61 @@ sourceFile:sourceMapValidationClasses.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^^^^^^^^^^^^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ -21> ^^-> +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ +20> ^^-> 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> restGreetings -14> . -15> length -16> ; -17> i -18> ++ -19> ) -20> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> restGreetings +13> . +14> length +15> ; +16> i +17> ++ +18> ) +19> { 1->Emitted(27, 13) Source(24, 9) + SourceIndex(0) 2 >Emitted(27, 16) Source(24, 12) + SourceIndex(0) 3 >Emitted(27, 17) Source(24, 13) + SourceIndex(0) 4 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) -5 >Emitted(27, 21) Source(24, 17) + SourceIndex(0) -6 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) -7 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) -8 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) -9 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) -10>Emitted(27, 29) Source(24, 25) + SourceIndex(0) -11>Emitted(27, 30) Source(24, 26) + SourceIndex(0) -12>Emitted(27, 33) Source(24, 29) + SourceIndex(0) -13>Emitted(27, 46) Source(24, 42) + SourceIndex(0) -14>Emitted(27, 47) Source(24, 43) + SourceIndex(0) -15>Emitted(27, 53) Source(24, 49) + SourceIndex(0) -16>Emitted(27, 55) Source(24, 51) + SourceIndex(0) -17>Emitted(27, 56) Source(24, 52) + SourceIndex(0) -18>Emitted(27, 58) Source(24, 54) + SourceIndex(0) -19>Emitted(27, 60) Source(24, 56) + SourceIndex(0) -20>Emitted(27, 61) Source(24, 57) + SourceIndex(0) +5 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) +6 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) +7 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) +8 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) +9 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) +10>Emitted(27, 30) Source(24, 26) + SourceIndex(0) +11>Emitted(27, 33) Source(24, 29) + SourceIndex(0) +12>Emitted(27, 46) Source(24, 42) + SourceIndex(0) +13>Emitted(27, 47) Source(24, 43) + SourceIndex(0) +14>Emitted(27, 53) Source(24, 49) + SourceIndex(0) +15>Emitted(27, 55) Source(24, 51) + SourceIndex(0) +16>Emitted(27, 56) Source(24, 52) + SourceIndex(0) +17>Emitted(27, 58) Source(24, 54) + SourceIndex(0) +18>Emitted(27, 60) Source(24, 56) + SourceIndex(0) +19>Emitted(27, 61) Source(24, 57) + SourceIndex(0) --- >>> greeters.push(new Greeter(restGreetings[i])); 1->^^^^^^^^^^^^^^^^ @@ -749,63 +746,60 @@ sourceFile:sourceMapValidationClasses.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^ -15> ^^^^^^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^ +14> ^^^^^^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ 1 > > 2 > for 3 > 4 > ( -5 > var -6 > -7 > j -8 > = -9 > 0 -10> ; -11> j -12> < -13> b -14> . -15> length -16> ; -17> j -18> ++ -19> ) -20> { +5 > var +6 > j +7 > = +8 > 0 +9 > ; +10> j +11> < +12> b +13> . +14> length +15> ; +16> j +17> ++ +18> ) +19> { 1 >Emitted(34, 9) Source(33, 5) + SourceIndex(0) 2 >Emitted(34, 12) Source(33, 8) + SourceIndex(0) 3 >Emitted(34, 13) Source(33, 9) + SourceIndex(0) 4 >Emitted(34, 14) Source(33, 10) + SourceIndex(0) -5 >Emitted(34, 17) Source(33, 13) + SourceIndex(0) -6 >Emitted(34, 18) Source(33, 14) + SourceIndex(0) -7 >Emitted(34, 19) Source(33, 15) + SourceIndex(0) -8 >Emitted(34, 22) Source(33, 18) + SourceIndex(0) -9 >Emitted(34, 23) Source(33, 19) + SourceIndex(0) -10>Emitted(34, 25) Source(33, 21) + SourceIndex(0) -11>Emitted(34, 26) Source(33, 22) + SourceIndex(0) -12>Emitted(34, 29) Source(33, 25) + SourceIndex(0) -13>Emitted(34, 30) Source(33, 26) + SourceIndex(0) -14>Emitted(34, 31) Source(33, 27) + SourceIndex(0) -15>Emitted(34, 37) Source(33, 33) + SourceIndex(0) -16>Emitted(34, 39) Source(33, 35) + SourceIndex(0) -17>Emitted(34, 40) Source(33, 36) + SourceIndex(0) -18>Emitted(34, 42) Source(33, 38) + SourceIndex(0) -19>Emitted(34, 44) Source(33, 40) + SourceIndex(0) -20>Emitted(34, 45) Source(33, 41) + SourceIndex(0) +5 >Emitted(34, 18) Source(33, 14) + SourceIndex(0) +6 >Emitted(34, 19) Source(33, 15) + SourceIndex(0) +7 >Emitted(34, 22) Source(33, 18) + SourceIndex(0) +8 >Emitted(34, 23) Source(33, 19) + SourceIndex(0) +9 >Emitted(34, 25) Source(33, 21) + SourceIndex(0) +10>Emitted(34, 26) Source(33, 22) + SourceIndex(0) +11>Emitted(34, 29) Source(33, 25) + SourceIndex(0) +12>Emitted(34, 30) Source(33, 26) + SourceIndex(0) +13>Emitted(34, 31) Source(33, 27) + SourceIndex(0) +14>Emitted(34, 37) Source(33, 33) + SourceIndex(0) +15>Emitted(34, 39) Source(33, 35) + SourceIndex(0) +16>Emitted(34, 40) Source(33, 36) + SourceIndex(0) +17>Emitted(34, 42) Source(33, 38) + SourceIndex(0) +18>Emitted(34, 44) Source(33, 40) + SourceIndex(0) +19>Emitted(34, 45) Source(33, 41) + SourceIndex(0) --- >>> b[j].greet(); 1 >^^^^^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js new file mode 100644 index 00000000000..407af9c08a0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js @@ -0,0 +1,177 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +for (var nameA = robotA[1], i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _a = getRobot(), nameA = _a[1], i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _b = [2, "trimmer", "trimming"], nameA = _b[1], i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var numberB = robotA[0], i = 0; i < 1; i++) { + console.log(numberB); +} +for (var numberB = getRobot()[0], i = 0; i < 1; i++) { + console.log(numberB); +} +for (var numberB = [2, "trimmer", "trimming"][0], i = 0; i < 1; i++) { + console.log(numberB); +} +for (var nameB = multiRobotA[0], i = 0; i < 1; i++) { + console.log(nameB); +} +for (var nameB = getMultiRobot()[0], i = 0; i < 1; i++) { + console.log(nameB); +} +for (var nameB = ["trimmer", ["trimming", "edging"]][0], i = 0; i < 1; i++) { + console.log(nameB); +} +for (var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _h = getRobot(), numberA2 = _h[0], nameA2 = _h[1], skillA2 = _h[2], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _j = [2, "trimmer", "trimming"], numberA2 = _j[0], nameA2 = _j[1], skillA2 = _j[2], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var nameMA = multiRobotA[0], _k = multiRobotA[1], primarySkillA = _k[0], secondarySkillA = _k[1], i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _l = getMultiRobot(), nameMA = _l[0], _m = _l[1], primarySkillA = _m[0], secondarySkillA = _m[1], i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _o = ["trimmer", ["trimming", "edging"]], nameMA = _o[0], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1], i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var numberA3 = robotA[0], robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _q = getRobot(), numberA3 = _q[0], robotAInfo = _q.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _r = [2, "trimmer", "trimming"], numberA3 = _r[0], robotAInfo = _r.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var multiRobotAInfo = multiRobotA.slice(0), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (var multiRobotAInfo = getMultiRobot().slice(0), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (var multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map new file mode 100644 index 00000000000..0ee4a2092e7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAQ,qBAAK,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA0B,EAAnB,aAAK,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAA0C,EAAnC,aAAK,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAQ,uBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAA0D,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,wCAA8E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAM,uBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,2CAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,0BAAK,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,8BAAK,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,kDAAK,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAM,wBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA4C,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAA4D,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAAgE,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,wCAAoF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAM,wBAAQ,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA0C,EAArC,gBAAQ,EAAE,wBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAA0D,EAArD,gBAAQ,EAAE,wBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAM,0CAAkB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAM,8CAAkB,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAM,kEAAkB,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..e7ee5c01f2c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt @@ -0,0 +1,2711 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>for (var nameA = robotA[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > + > +2 >for +3 > +4 > (let [, +5 > nameA +6 > ] = robotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(18, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) +5 >Emitted(10, 27) Source(18, 18) + SourceIndex(0) +6 >Emitted(10, 29) Source(18, 30) + SourceIndex(0) +7 >Emitted(10, 30) Source(18, 31) + SourceIndex(0) +8 >Emitted(10, 33) Source(18, 34) + SourceIndex(0) +9 >Emitted(10, 34) Source(18, 35) + SourceIndex(0) +10>Emitted(10, 36) Source(18, 37) + SourceIndex(0) +11>Emitted(10, 37) Source(18, 38) + SourceIndex(0) +12>Emitted(10, 40) Source(18, 41) + SourceIndex(0) +13>Emitted(10, 41) Source(18, 42) + SourceIndex(0) +14>Emitted(10, 43) Source(18, 44) + SourceIndex(0) +15>Emitted(10, 44) Source(18, 45) + SourceIndex(0) +16>Emitted(10, 46) Source(18, 47) + SourceIndex(0) +17>Emitted(10, 48) Source(18, 49) + SourceIndex(0) +18>Emitted(10, 49) Source(18, 50) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(19, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(19, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(19, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) +--- +>>>for (var _a = getRobot(), nameA = _a[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ +21> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA] = getRobot() +7 > +8 > nameA +9 > ] = getRobot(), +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) +21> { +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 6) + SourceIndex(0) +5 >Emitted(13, 10) Source(21, 6) + SourceIndex(0) +6 >Emitted(13, 25) Source(21, 32) + SourceIndex(0) +7 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) +8 >Emitted(13, 40) Source(21, 18) + SourceIndex(0) +9 >Emitted(13, 42) Source(21, 34) + SourceIndex(0) +10>Emitted(13, 43) Source(21, 35) + SourceIndex(0) +11>Emitted(13, 46) Source(21, 38) + SourceIndex(0) +12>Emitted(13, 47) Source(21, 39) + SourceIndex(0) +13>Emitted(13, 49) Source(21, 41) + SourceIndex(0) +14>Emitted(13, 50) Source(21, 42) + SourceIndex(0) +15>Emitted(13, 53) Source(21, 45) + SourceIndex(0) +16>Emitted(13, 54) Source(21, 46) + SourceIndex(0) +17>Emitted(13, 56) Source(21, 48) + SourceIndex(0) +18>Emitted(13, 57) Source(21, 49) + SourceIndex(0) +19>Emitted(13, 59) Source(21, 51) + SourceIndex(0) +20>Emitted(13, 61) Source(21, 53) + SourceIndex(0) +21>Emitted(13, 62) Source(21, 54) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _b = [2, "trimmer", "trimming"], nameA = _b[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ +21> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA] = [2, "trimmer", "trimming"] +7 > +8 > nameA +9 > ] = [2, "trimmer", "trimming"], +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) +21> { +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(16, 10) Source(24, 6) + SourceIndex(0) +6 >Emitted(16, 41) Source(24, 48) + SourceIndex(0) +7 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) +8 >Emitted(16, 56) Source(24, 18) + SourceIndex(0) +9 >Emitted(16, 58) Source(24, 50) + SourceIndex(0) +10>Emitted(16, 59) Source(24, 51) + SourceIndex(0) +11>Emitted(16, 62) Source(24, 54) + SourceIndex(0) +12>Emitted(16, 63) Source(24, 55) + SourceIndex(0) +13>Emitted(16, 65) Source(24, 57) + SourceIndex(0) +14>Emitted(16, 66) Source(24, 58) + SourceIndex(0) +15>Emitted(16, 69) Source(24, 61) + SourceIndex(0) +16>Emitted(16, 70) Source(24, 62) + SourceIndex(0) +17>Emitted(16, 72) Source(24, 64) + SourceIndex(0) +18>Emitted(16, 73) Source(24, 65) + SourceIndex(0) +19>Emitted(16, 75) Source(24, 67) + SourceIndex(0) +20>Emitted(16, 77) Source(24, 69) + SourceIndex(0) +21>Emitted(16, 78) Source(24, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(17, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(17, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(17, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(17, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(17, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(17, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(17, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(17, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(18, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let [, +5 > [primarySkillA, secondarySkillA] +6 > +7 > primarySkillA +8 > , +9 > secondarySkillA +10> ]] = multiRobotA, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) +5 >Emitted(19, 29) Source(27, 45) + SourceIndex(0) +6 >Emitted(19, 31) Source(27, 14) + SourceIndex(0) +7 >Emitted(19, 52) Source(27, 27) + SourceIndex(0) +8 >Emitted(19, 54) Source(27, 29) + SourceIndex(0) +9 >Emitted(19, 77) Source(27, 44) + SourceIndex(0) +10>Emitted(19, 79) Source(27, 62) + SourceIndex(0) +11>Emitted(19, 80) Source(27, 63) + SourceIndex(0) +12>Emitted(19, 83) Source(27, 66) + SourceIndex(0) +13>Emitted(19, 84) Source(27, 67) + SourceIndex(0) +14>Emitted(19, 86) Source(27, 69) + SourceIndex(0) +15>Emitted(19, 87) Source(27, 70) + SourceIndex(0) +16>Emitted(19, 90) Source(27, 73) + SourceIndex(0) +17>Emitted(19, 91) Source(27, 74) + SourceIndex(0) +18>Emitted(19, 93) Source(27, 76) + SourceIndex(0) +19>Emitted(19, 94) Source(27, 77) + SourceIndex(0) +20>Emitted(19, 96) Source(27, 79) + SourceIndex(0) +21>Emitted(19, 98) Source(27, 81) + SourceIndex(0) +22>Emitted(19, 99) Source(27, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(20, 30) Source(28, 30) + SourceIndex(0) +7 >Emitted(20, 31) Source(28, 31) + SourceIndex(0) +8 >Emitted(20, 32) Source(28, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(21, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(21, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for (var _d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = getMultiRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(22, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(30, 6) + SourceIndex(0) +5 >Emitted(22, 10) Source(30, 6) + SourceIndex(0) +6 >Emitted(22, 30) Source(30, 64) + SourceIndex(0) +7 >Emitted(22, 32) Source(30, 13) + SourceIndex(0) +8 >Emitted(22, 42) Source(30, 45) + SourceIndex(0) +9 >Emitted(22, 44) Source(30, 14) + SourceIndex(0) +10>Emitted(22, 65) Source(30, 27) + SourceIndex(0) +11>Emitted(22, 67) Source(30, 29) + SourceIndex(0) +12>Emitted(22, 90) Source(30, 44) + SourceIndex(0) +13>Emitted(22, 92) Source(30, 66) + SourceIndex(0) +14>Emitted(22, 93) Source(30, 67) + SourceIndex(0) +15>Emitted(22, 96) Source(30, 70) + SourceIndex(0) +16>Emitted(22, 97) Source(30, 71) + SourceIndex(0) +17>Emitted(22, 99) Source(30, 73) + SourceIndex(0) +18>Emitted(22, 100) Source(30, 74) + SourceIndex(0) +19>Emitted(22, 103) Source(30, 77) + SourceIndex(0) +20>Emitted(22, 104) Source(30, 78) + SourceIndex(0) +21>Emitted(22, 106) Source(30, 80) + SourceIndex(0) +22>Emitted(22, 107) Source(30, 81) + SourceIndex(0) +23>Emitted(22, 109) Source(30, 83) + SourceIndex(0) +24>Emitted(22, 111) Source(30, 85) + SourceIndex(0) +25>Emitted(22, 112) Source(30, 86) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(23, 30) Source(31, 30) + SourceIndex(0) +7 >Emitted(23, 31) Source(31, 31) + SourceIndex(0) +8 >Emitted(23, 32) Source(31, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for (var _f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = ["trimmer", ["trimming", "edging"]], +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(25, 10) Source(33, 6) + SourceIndex(0) +6 >Emitted(25, 50) Source(33, 84) + SourceIndex(0) +7 >Emitted(25, 52) Source(33, 13) + SourceIndex(0) +8 >Emitted(25, 62) Source(33, 45) + SourceIndex(0) +9 >Emitted(25, 64) Source(33, 14) + SourceIndex(0) +10>Emitted(25, 85) Source(33, 27) + SourceIndex(0) +11>Emitted(25, 87) Source(33, 29) + SourceIndex(0) +12>Emitted(25, 110) Source(33, 44) + SourceIndex(0) +13>Emitted(25, 112) Source(33, 86) + SourceIndex(0) +14>Emitted(25, 113) Source(33, 87) + SourceIndex(0) +15>Emitted(25, 116) Source(33, 90) + SourceIndex(0) +16>Emitted(25, 117) Source(33, 91) + SourceIndex(0) +17>Emitted(25, 119) Source(33, 93) + SourceIndex(0) +18>Emitted(25, 120) Source(33, 94) + SourceIndex(0) +19>Emitted(25, 123) Source(33, 97) + SourceIndex(0) +20>Emitted(25, 124) Source(33, 98) + SourceIndex(0) +21>Emitted(25, 126) Source(33, 100) + SourceIndex(0) +22>Emitted(25, 127) Source(33, 101) + SourceIndex(0) +23>Emitted(25, 129) Source(33, 103) + SourceIndex(0) +24>Emitted(25, 131) Source(33, 105) + SourceIndex(0) +25>Emitted(25, 132) Source(33, 106) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(26, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(26, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(26, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(27, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(27, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for (var numberB = robotA[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberB +6 > ] = robotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(28, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(37, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(37, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(37, 11) + SourceIndex(0) +5 >Emitted(28, 29) Source(37, 18) + SourceIndex(0) +6 >Emitted(28, 31) Source(37, 30) + SourceIndex(0) +7 >Emitted(28, 32) Source(37, 31) + SourceIndex(0) +8 >Emitted(28, 35) Source(37, 34) + SourceIndex(0) +9 >Emitted(28, 36) Source(37, 35) + SourceIndex(0) +10>Emitted(28, 38) Source(37, 37) + SourceIndex(0) +11>Emitted(28, 39) Source(37, 38) + SourceIndex(0) +12>Emitted(28, 42) Source(37, 41) + SourceIndex(0) +13>Emitted(28, 43) Source(37, 42) + SourceIndex(0) +14>Emitted(28, 45) Source(37, 44) + SourceIndex(0) +15>Emitted(28, 46) Source(37, 45) + SourceIndex(0) +16>Emitted(28, 48) Source(37, 47) + SourceIndex(0) +17>Emitted(28, 50) Source(37, 49) + SourceIndex(0) +18>Emitted(28, 51) Source(37, 50) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(29, 5) Source(38, 5) + SourceIndex(0) +2 >Emitted(29, 12) Source(38, 12) + SourceIndex(0) +3 >Emitted(29, 13) Source(38, 13) + SourceIndex(0) +4 >Emitted(29, 16) Source(38, 16) + SourceIndex(0) +5 >Emitted(29, 17) Source(38, 17) + SourceIndex(0) +6 >Emitted(29, 24) Source(38, 24) + SourceIndex(0) +7 >Emitted(29, 25) Source(38, 25) + SourceIndex(0) +8 >Emitted(29, 26) Source(38, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(30, 2) Source(39, 2) + SourceIndex(0) +--- +>>>for (var numberB = getRobot()[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB +6 > ] = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(31, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(31, 4) Source(40, 4) + SourceIndex(0) +3 >Emitted(31, 5) Source(40, 5) + SourceIndex(0) +4 >Emitted(31, 6) Source(40, 11) + SourceIndex(0) +5 >Emitted(31, 33) Source(40, 18) + SourceIndex(0) +6 >Emitted(31, 35) Source(40, 34) + SourceIndex(0) +7 >Emitted(31, 36) Source(40, 35) + SourceIndex(0) +8 >Emitted(31, 39) Source(40, 38) + SourceIndex(0) +9 >Emitted(31, 40) Source(40, 39) + SourceIndex(0) +10>Emitted(31, 42) Source(40, 41) + SourceIndex(0) +11>Emitted(31, 43) Source(40, 42) + SourceIndex(0) +12>Emitted(31, 46) Source(40, 45) + SourceIndex(0) +13>Emitted(31, 47) Source(40, 46) + SourceIndex(0) +14>Emitted(31, 49) Source(40, 48) + SourceIndex(0) +15>Emitted(31, 50) Source(40, 49) + SourceIndex(0) +16>Emitted(31, 52) Source(40, 51) + SourceIndex(0) +17>Emitted(31, 54) Source(40, 53) + SourceIndex(0) +18>Emitted(31, 55) Source(40, 54) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(32, 5) Source(41, 5) + SourceIndex(0) +2 >Emitted(32, 12) Source(41, 12) + SourceIndex(0) +3 >Emitted(32, 13) Source(41, 13) + SourceIndex(0) +4 >Emitted(32, 16) Source(41, 16) + SourceIndex(0) +5 >Emitted(32, 17) Source(41, 17) + SourceIndex(0) +6 >Emitted(32, 24) Source(41, 24) + SourceIndex(0) +7 >Emitted(32, 25) Source(41, 25) + SourceIndex(0) +8 >Emitted(32, 26) Source(41, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(33, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(33, 2) Source(42, 2) + SourceIndex(0) +--- +>>>for (var numberB = [2, "trimmer", "trimming"][0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB +6 > ] = [2, "trimmer", "trimming"], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(34, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(34, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(34, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(34, 6) Source(43, 11) + SourceIndex(0) +5 >Emitted(34, 49) Source(43, 18) + SourceIndex(0) +6 >Emitted(34, 51) Source(43, 50) + SourceIndex(0) +7 >Emitted(34, 52) Source(43, 51) + SourceIndex(0) +8 >Emitted(34, 55) Source(43, 54) + SourceIndex(0) +9 >Emitted(34, 56) Source(43, 55) + SourceIndex(0) +10>Emitted(34, 58) Source(43, 57) + SourceIndex(0) +11>Emitted(34, 59) Source(43, 58) + SourceIndex(0) +12>Emitted(34, 62) Source(43, 61) + SourceIndex(0) +13>Emitted(34, 63) Source(43, 62) + SourceIndex(0) +14>Emitted(34, 65) Source(43, 64) + SourceIndex(0) +15>Emitted(34, 66) Source(43, 65) + SourceIndex(0) +16>Emitted(34, 68) Source(43, 67) + SourceIndex(0) +17>Emitted(34, 70) Source(43, 69) + SourceIndex(0) +18>Emitted(34, 71) Source(43, 70) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(35, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(35, 24) Source(44, 24) + SourceIndex(0) +7 >Emitted(35, 25) Source(44, 25) + SourceIndex(0) +8 >Emitted(35, 26) Source(44, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(36, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(36, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var nameB = multiRobotA[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB +6 > ] = multiRobotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(37, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(46, 11) + SourceIndex(0) +5 >Emitted(37, 32) Source(46, 16) + SourceIndex(0) +6 >Emitted(37, 34) Source(46, 33) + SourceIndex(0) +7 >Emitted(37, 35) Source(46, 34) + SourceIndex(0) +8 >Emitted(37, 38) Source(46, 37) + SourceIndex(0) +9 >Emitted(37, 39) Source(46, 38) + SourceIndex(0) +10>Emitted(37, 41) Source(46, 40) + SourceIndex(0) +11>Emitted(37, 42) Source(46, 41) + SourceIndex(0) +12>Emitted(37, 45) Source(46, 44) + SourceIndex(0) +13>Emitted(37, 46) Source(46, 45) + SourceIndex(0) +14>Emitted(37, 48) Source(46, 47) + SourceIndex(0) +15>Emitted(37, 49) Source(46, 48) + SourceIndex(0) +16>Emitted(37, 51) Source(46, 50) + SourceIndex(0) +17>Emitted(37, 53) Source(46, 52) + SourceIndex(0) +18>Emitted(37, 54) Source(46, 53) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(38, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(38, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(38, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(38, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(38, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(38, 22) Source(47, 22) + SourceIndex(0) +7 >Emitted(38, 23) Source(47, 23) + SourceIndex(0) +8 >Emitted(38, 24) Source(47, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(39, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(39, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var nameB = getMultiRobot()[0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB +6 > ] = getMultiRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(40, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(40, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(40, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(40, 6) Source(49, 11) + SourceIndex(0) +5 >Emitted(40, 36) Source(49, 16) + SourceIndex(0) +6 >Emitted(40, 38) Source(49, 37) + SourceIndex(0) +7 >Emitted(40, 39) Source(49, 38) + SourceIndex(0) +8 >Emitted(40, 42) Source(49, 41) + SourceIndex(0) +9 >Emitted(40, 43) Source(49, 42) + SourceIndex(0) +10>Emitted(40, 45) Source(49, 44) + SourceIndex(0) +11>Emitted(40, 46) Source(49, 45) + SourceIndex(0) +12>Emitted(40, 49) Source(49, 48) + SourceIndex(0) +13>Emitted(40, 50) Source(49, 49) + SourceIndex(0) +14>Emitted(40, 52) Source(49, 51) + SourceIndex(0) +15>Emitted(40, 53) Source(49, 52) + SourceIndex(0) +16>Emitted(40, 55) Source(49, 54) + SourceIndex(0) +17>Emitted(40, 57) Source(49, 56) + SourceIndex(0) +18>Emitted(40, 58) Source(49, 57) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(41, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(42, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(42, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var nameB = ["trimmer", ["trimming", "edging"]][0], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB +6 > ] = ["trimmer", ["trimming", "edging"]], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(43, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(52, 11) + SourceIndex(0) +5 >Emitted(43, 56) Source(52, 16) + SourceIndex(0) +6 >Emitted(43, 58) Source(52, 57) + SourceIndex(0) +7 >Emitted(43, 59) Source(52, 58) + SourceIndex(0) +8 >Emitted(43, 62) Source(52, 61) + SourceIndex(0) +9 >Emitted(43, 63) Source(52, 62) + SourceIndex(0) +10>Emitted(43, 65) Source(52, 64) + SourceIndex(0) +11>Emitted(43, 66) Source(52, 65) + SourceIndex(0) +12>Emitted(43, 69) Source(52, 68) + SourceIndex(0) +13>Emitted(43, 70) Source(52, 69) + SourceIndex(0) +14>Emitted(43, 72) Source(52, 71) + SourceIndex(0) +15>Emitted(43, 73) Source(52, 72) + SourceIndex(0) +16>Emitted(43, 75) Source(52, 74) + SourceIndex(0) +17>Emitted(43, 77) Source(52, 76) + SourceIndex(0) +18>Emitted(43, 78) Source(52, 77) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(44, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(44, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(44, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(44, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(44, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(44, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(44, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(44, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(45, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(45, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA2 +6 > , +7 > nameA2 +8 > , +9 > skillA2 +10> ] = robotA, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(46, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(46, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(46, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(46, 6) Source(56, 11) + SourceIndex(0) +5 >Emitted(46, 30) Source(56, 19) + SourceIndex(0) +6 >Emitted(46, 32) Source(56, 21) + SourceIndex(0) +7 >Emitted(46, 50) Source(56, 27) + SourceIndex(0) +8 >Emitted(46, 52) Source(56, 29) + SourceIndex(0) +9 >Emitted(46, 71) Source(56, 36) + SourceIndex(0) +10>Emitted(46, 73) Source(56, 48) + SourceIndex(0) +11>Emitted(46, 74) Source(56, 49) + SourceIndex(0) +12>Emitted(46, 77) Source(56, 52) + SourceIndex(0) +13>Emitted(46, 78) Source(56, 53) + SourceIndex(0) +14>Emitted(46, 80) Source(56, 55) + SourceIndex(0) +15>Emitted(46, 81) Source(56, 56) + SourceIndex(0) +16>Emitted(46, 84) Source(56, 59) + SourceIndex(0) +17>Emitted(46, 85) Source(56, 60) + SourceIndex(0) +18>Emitted(46, 87) Source(56, 62) + SourceIndex(0) +19>Emitted(46, 88) Source(56, 63) + SourceIndex(0) +20>Emitted(46, 90) Source(56, 65) + SourceIndex(0) +21>Emitted(46, 92) Source(56, 67) + SourceIndex(0) +22>Emitted(46, 93) Source(56, 68) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(47, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(47, 23) Source(57, 23) + SourceIndex(0) +7 >Emitted(47, 24) Source(57, 24) + SourceIndex(0) +8 >Emitted(47, 25) Source(57, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _h = getRobot(), numberA2 = _h[0], nameA2 = _h[1], skillA2 = _h[2], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2, nameA2, skillA2] = getRobot() +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = getRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(49, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(59, 6) + SourceIndex(0) +5 >Emitted(49, 10) Source(59, 6) + SourceIndex(0) +6 >Emitted(49, 25) Source(59, 50) + SourceIndex(0) +7 >Emitted(49, 27) Source(59, 11) + SourceIndex(0) +8 >Emitted(49, 43) Source(59, 19) + SourceIndex(0) +9 >Emitted(49, 45) Source(59, 21) + SourceIndex(0) +10>Emitted(49, 59) Source(59, 27) + SourceIndex(0) +11>Emitted(49, 61) Source(59, 29) + SourceIndex(0) +12>Emitted(49, 76) Source(59, 36) + SourceIndex(0) +13>Emitted(49, 78) Source(59, 52) + SourceIndex(0) +14>Emitted(49, 79) Source(59, 53) + SourceIndex(0) +15>Emitted(49, 82) Source(59, 56) + SourceIndex(0) +16>Emitted(49, 83) Source(59, 57) + SourceIndex(0) +17>Emitted(49, 85) Source(59, 59) + SourceIndex(0) +18>Emitted(49, 86) Source(59, 60) + SourceIndex(0) +19>Emitted(49, 89) Source(59, 63) + SourceIndex(0) +20>Emitted(49, 90) Source(59, 64) + SourceIndex(0) +21>Emitted(49, 92) Source(59, 66) + SourceIndex(0) +22>Emitted(49, 93) Source(59, 67) + SourceIndex(0) +23>Emitted(49, 95) Source(59, 69) + SourceIndex(0) +24>Emitted(49, 97) Source(59, 71) + SourceIndex(0) +25>Emitted(49, 98) Source(59, 72) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(50, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(50, 23) Source(60, 23) + SourceIndex(0) +7 >Emitted(50, 24) Source(60, 24) + SourceIndex(0) +8 >Emitted(50, 25) Source(60, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _j = [2, "trimmer", "trimming"], numberA2 = _j[0], nameA2 = _j[1], skillA2 = _j[2], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = [2, "trimmer", "trimming"], +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(52, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(62, 6) + SourceIndex(0) +5 >Emitted(52, 10) Source(62, 6) + SourceIndex(0) +6 >Emitted(52, 41) Source(62, 66) + SourceIndex(0) +7 >Emitted(52, 43) Source(62, 11) + SourceIndex(0) +8 >Emitted(52, 59) Source(62, 19) + SourceIndex(0) +9 >Emitted(52, 61) Source(62, 21) + SourceIndex(0) +10>Emitted(52, 75) Source(62, 27) + SourceIndex(0) +11>Emitted(52, 77) Source(62, 29) + SourceIndex(0) +12>Emitted(52, 92) Source(62, 36) + SourceIndex(0) +13>Emitted(52, 94) Source(62, 68) + SourceIndex(0) +14>Emitted(52, 95) Source(62, 69) + SourceIndex(0) +15>Emitted(52, 98) Source(62, 72) + SourceIndex(0) +16>Emitted(52, 99) Source(62, 73) + SourceIndex(0) +17>Emitted(52, 101) Source(62, 75) + SourceIndex(0) +18>Emitted(52, 102) Source(62, 76) + SourceIndex(0) +19>Emitted(52, 105) Source(62, 79) + SourceIndex(0) +20>Emitted(52, 106) Source(62, 80) + SourceIndex(0) +21>Emitted(52, 108) Source(62, 82) + SourceIndex(0) +22>Emitted(52, 109) Source(62, 83) + SourceIndex(0) +23>Emitted(52, 111) Source(62, 85) + SourceIndex(0) +24>Emitted(52, 113) Source(62, 87) + SourceIndex(0) +25>Emitted(52, 114) Source(62, 88) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(53, 23) Source(63, 23) + SourceIndex(0) +7 >Emitted(53, 24) Source(63, 24) + SourceIndex(0) +8 >Emitted(53, 25) Source(63, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for (var nameMA = multiRobotA[0], _k = multiRobotA[1], primarySkillA = _k[0], secondarySkillA = _k[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameMA +6 > , +7 > [primarySkillA, secondarySkillA] +8 > +9 > primarySkillA +10> , +11> secondarySkillA +12> ]] = multiRobotA, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(55, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(65, 11) + SourceIndex(0) +5 >Emitted(55, 33) Source(65, 17) + SourceIndex(0) +6 >Emitted(55, 35) Source(65, 19) + SourceIndex(0) +7 >Emitted(55, 54) Source(65, 51) + SourceIndex(0) +8 >Emitted(55, 56) Source(65, 20) + SourceIndex(0) +9 >Emitted(55, 77) Source(65, 33) + SourceIndex(0) +10>Emitted(55, 79) Source(65, 35) + SourceIndex(0) +11>Emitted(55, 102) Source(65, 50) + SourceIndex(0) +12>Emitted(55, 104) Source(65, 68) + SourceIndex(0) +13>Emitted(55, 105) Source(65, 69) + SourceIndex(0) +14>Emitted(55, 108) Source(65, 72) + SourceIndex(0) +15>Emitted(55, 109) Source(65, 73) + SourceIndex(0) +16>Emitted(55, 111) Source(65, 75) + SourceIndex(0) +17>Emitted(55, 112) Source(65, 76) + SourceIndex(0) +18>Emitted(55, 115) Source(65, 79) + SourceIndex(0) +19>Emitted(55, 116) Source(65, 80) + SourceIndex(0) +20>Emitted(55, 118) Source(65, 82) + SourceIndex(0) +21>Emitted(55, 119) Source(65, 83) + SourceIndex(0) +22>Emitted(55, 121) Source(65, 85) + SourceIndex(0) +23>Emitted(55, 123) Source(65, 87) + SourceIndex(0) +24>Emitted(55, 124) Source(65, 88) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(56, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(56, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(56, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for (var _l = getMultiRobot(), nameMA = _l[0], _m = _l[1], primarySkillA = _m[0], secondarySkillA = _m[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = getMultiRobot(), +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(58, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(58, 10) Source(68, 6) + SourceIndex(0) +6 >Emitted(58, 30) Source(68, 70) + SourceIndex(0) +7 >Emitted(58, 32) Source(68, 11) + SourceIndex(0) +8 >Emitted(58, 46) Source(68, 17) + SourceIndex(0) +9 >Emitted(58, 48) Source(68, 19) + SourceIndex(0) +10>Emitted(58, 58) Source(68, 51) + SourceIndex(0) +11>Emitted(58, 60) Source(68, 20) + SourceIndex(0) +12>Emitted(58, 81) Source(68, 33) + SourceIndex(0) +13>Emitted(58, 83) Source(68, 35) + SourceIndex(0) +14>Emitted(58, 106) Source(68, 50) + SourceIndex(0) +15>Emitted(58, 108) Source(68, 72) + SourceIndex(0) +16>Emitted(58, 109) Source(68, 73) + SourceIndex(0) +17>Emitted(58, 112) Source(68, 76) + SourceIndex(0) +18>Emitted(58, 113) Source(68, 77) + SourceIndex(0) +19>Emitted(58, 115) Source(68, 79) + SourceIndex(0) +20>Emitted(58, 116) Source(68, 80) + SourceIndex(0) +21>Emitted(58, 119) Source(68, 83) + SourceIndex(0) +22>Emitted(58, 120) Source(68, 84) + SourceIndex(0) +23>Emitted(58, 122) Source(68, 86) + SourceIndex(0) +24>Emitted(58, 123) Source(68, 87) + SourceIndex(0) +25>Emitted(58, 125) Source(68, 89) + SourceIndex(0) +26>Emitted(58, 127) Source(68, 91) + SourceIndex(0) +27>Emitted(58, 128) Source(68, 92) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(59, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(59, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(59, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _o = ["trimmer", ["trimming", "edging"]], nameMA = _o[0], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1], i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = ["trimmer", ["trimming", "edging"]], +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(61, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(61, 10) Source(71, 6) + SourceIndex(0) +6 >Emitted(61, 50) Source(71, 90) + SourceIndex(0) +7 >Emitted(61, 52) Source(71, 11) + SourceIndex(0) +8 >Emitted(61, 66) Source(71, 17) + SourceIndex(0) +9 >Emitted(61, 68) Source(71, 19) + SourceIndex(0) +10>Emitted(61, 78) Source(71, 51) + SourceIndex(0) +11>Emitted(61, 80) Source(71, 20) + SourceIndex(0) +12>Emitted(61, 101) Source(71, 33) + SourceIndex(0) +13>Emitted(61, 103) Source(71, 35) + SourceIndex(0) +14>Emitted(61, 126) Source(71, 50) + SourceIndex(0) +15>Emitted(61, 128) Source(71, 92) + SourceIndex(0) +16>Emitted(61, 129) Source(71, 93) + SourceIndex(0) +17>Emitted(61, 132) Source(71, 96) + SourceIndex(0) +18>Emitted(61, 133) Source(71, 97) + SourceIndex(0) +19>Emitted(61, 135) Source(71, 99) + SourceIndex(0) +20>Emitted(61, 136) Source(71, 100) + SourceIndex(0) +21>Emitted(61, 139) Source(71, 103) + SourceIndex(0) +22>Emitted(61, 140) Source(71, 104) + SourceIndex(0) +23>Emitted(61, 142) Source(71, 106) + SourceIndex(0) +24>Emitted(61, 143) Source(71, 107) + SourceIndex(0) +25>Emitted(61, 145) Source(71, 109) + SourceIndex(0) +26>Emitted(61, 147) Source(71, 111) + SourceIndex(0) +27>Emitted(61, 148) Source(71, 112) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(62, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(62, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(62, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var numberA3 = robotA[0], robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA3 +6 > , +7 > ...robotAInfo +8 > ] = robotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(64, 1) Source(75, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(75, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(75, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(75, 11) + SourceIndex(0) +5 >Emitted(64, 30) Source(75, 19) + SourceIndex(0) +6 >Emitted(64, 32) Source(75, 21) + SourceIndex(0) +7 >Emitted(64, 60) Source(75, 34) + SourceIndex(0) +8 >Emitted(64, 62) Source(75, 46) + SourceIndex(0) +9 >Emitted(64, 63) Source(75, 47) + SourceIndex(0) +10>Emitted(64, 66) Source(75, 50) + SourceIndex(0) +11>Emitted(64, 67) Source(75, 51) + SourceIndex(0) +12>Emitted(64, 69) Source(75, 53) + SourceIndex(0) +13>Emitted(64, 70) Source(75, 54) + SourceIndex(0) +14>Emitted(64, 73) Source(75, 57) + SourceIndex(0) +15>Emitted(64, 74) Source(75, 58) + SourceIndex(0) +16>Emitted(64, 76) Source(75, 60) + SourceIndex(0) +17>Emitted(64, 77) Source(75, 61) + SourceIndex(0) +18>Emitted(64, 79) Source(75, 63) + SourceIndex(0) +19>Emitted(64, 81) Source(75, 65) + SourceIndex(0) +20>Emitted(64, 82) Source(75, 66) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(65, 5) Source(76, 5) + SourceIndex(0) +2 >Emitted(65, 12) Source(76, 12) + SourceIndex(0) +3 >Emitted(65, 13) Source(76, 13) + SourceIndex(0) +4 >Emitted(65, 16) Source(76, 16) + SourceIndex(0) +5 >Emitted(65, 17) Source(76, 17) + SourceIndex(0) +6 >Emitted(65, 25) Source(76, 25) + SourceIndex(0) +7 >Emitted(65, 26) Source(76, 26) + SourceIndex(0) +8 >Emitted(65, 27) Source(76, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(66, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(66, 2) Source(77, 2) + SourceIndex(0) +--- +>>>for (var _q = getRobot(), numberA3 = _q[0], robotAInfo = _q.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3, ...robotAInfo] = getRobot() +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(67, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(67, 4) Source(78, 4) + SourceIndex(0) +3 >Emitted(67, 5) Source(78, 5) + SourceIndex(0) +4 >Emitted(67, 6) Source(78, 6) + SourceIndex(0) +5 >Emitted(67, 10) Source(78, 6) + SourceIndex(0) +6 >Emitted(67, 25) Source(78, 48) + SourceIndex(0) +7 >Emitted(67, 27) Source(78, 11) + SourceIndex(0) +8 >Emitted(67, 43) Source(78, 19) + SourceIndex(0) +9 >Emitted(67, 45) Source(78, 21) + SourceIndex(0) +10>Emitted(67, 69) Source(78, 34) + SourceIndex(0) +11>Emitted(67, 71) Source(78, 50) + SourceIndex(0) +12>Emitted(67, 72) Source(78, 51) + SourceIndex(0) +13>Emitted(67, 75) Source(78, 54) + SourceIndex(0) +14>Emitted(67, 76) Source(78, 55) + SourceIndex(0) +15>Emitted(67, 78) Source(78, 57) + SourceIndex(0) +16>Emitted(67, 79) Source(78, 58) + SourceIndex(0) +17>Emitted(67, 82) Source(78, 61) + SourceIndex(0) +18>Emitted(67, 83) Source(78, 62) + SourceIndex(0) +19>Emitted(67, 85) Source(78, 64) + SourceIndex(0) +20>Emitted(67, 86) Source(78, 65) + SourceIndex(0) +21>Emitted(67, 88) Source(78, 67) + SourceIndex(0) +22>Emitted(67, 90) Source(78, 69) + SourceIndex(0) +23>Emitted(67, 91) Source(78, 70) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(68, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(68, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(68, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(68, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(69, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(69, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _r = [2, "trimmer", "trimming"], numberA3 = _r[0], robotAInfo = _r.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = [2, "trimmer", "trimming"], +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(70, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(70, 10) Source(81, 6) + SourceIndex(0) +6 >Emitted(70, 41) Source(81, 64) + SourceIndex(0) +7 >Emitted(70, 43) Source(81, 11) + SourceIndex(0) +8 >Emitted(70, 59) Source(81, 19) + SourceIndex(0) +9 >Emitted(70, 61) Source(81, 21) + SourceIndex(0) +10>Emitted(70, 85) Source(81, 34) + SourceIndex(0) +11>Emitted(70, 87) Source(81, 66) + SourceIndex(0) +12>Emitted(70, 88) Source(81, 67) + SourceIndex(0) +13>Emitted(70, 91) Source(81, 70) + SourceIndex(0) +14>Emitted(70, 92) Source(81, 71) + SourceIndex(0) +15>Emitted(70, 94) Source(81, 73) + SourceIndex(0) +16>Emitted(70, 95) Source(81, 74) + SourceIndex(0) +17>Emitted(70, 98) Source(81, 77) + SourceIndex(0) +18>Emitted(70, 99) Source(81, 78) + SourceIndex(0) +19>Emitted(70, 101) Source(81, 80) + SourceIndex(0) +20>Emitted(70, 102) Source(81, 81) + SourceIndex(0) +21>Emitted(70, 104) Source(81, 83) + SourceIndex(0) +22>Emitted(70, 106) Source(81, 85) + SourceIndex(0) +23>Emitted(70, 107) Source(81, 86) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(71, 25) Source(82, 25) + SourceIndex(0) +7 >Emitted(71, 26) Source(82, 26) + SourceIndex(0) +8 >Emitted(71, 27) Source(82, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(72, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(72, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for (var multiRobotAInfo = multiRobotA.slice(0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > ...multiRobotAInfo +6 > ] = multiRobotA, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(73, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(84, 11) + SourceIndex(0) +5 >Emitted(73, 48) Source(84, 29) + SourceIndex(0) +6 >Emitted(73, 50) Source(84, 46) + SourceIndex(0) +7 >Emitted(73, 51) Source(84, 47) + SourceIndex(0) +8 >Emitted(73, 54) Source(84, 50) + SourceIndex(0) +9 >Emitted(73, 55) Source(84, 51) + SourceIndex(0) +10>Emitted(73, 57) Source(84, 53) + SourceIndex(0) +11>Emitted(73, 58) Source(84, 54) + SourceIndex(0) +12>Emitted(73, 61) Source(84, 57) + SourceIndex(0) +13>Emitted(73, 62) Source(84, 58) + SourceIndex(0) +14>Emitted(73, 64) Source(84, 60) + SourceIndex(0) +15>Emitted(73, 65) Source(84, 61) + SourceIndex(0) +16>Emitted(73, 67) Source(84, 63) + SourceIndex(0) +17>Emitted(73, 69) Source(84, 65) + SourceIndex(0) +18>Emitted(73, 70) Source(84, 66) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(74, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(74, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(74, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(74, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(74, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(74, 32) Source(85, 32) + SourceIndex(0) +7 >Emitted(74, 33) Source(85, 33) + SourceIndex(0) +8 >Emitted(74, 34) Source(85, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(75, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(75, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for (var multiRobotAInfo = getMultiRobot().slice(0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > ...multiRobotAInfo +6 > ] = getMultiRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(76, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(76, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(76, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(76, 6) Source(87, 11) + SourceIndex(0) +5 >Emitted(76, 52) Source(87, 29) + SourceIndex(0) +6 >Emitted(76, 54) Source(87, 50) + SourceIndex(0) +7 >Emitted(76, 55) Source(87, 51) + SourceIndex(0) +8 >Emitted(76, 58) Source(87, 54) + SourceIndex(0) +9 >Emitted(76, 59) Source(87, 55) + SourceIndex(0) +10>Emitted(76, 61) Source(87, 57) + SourceIndex(0) +11>Emitted(76, 62) Source(87, 58) + SourceIndex(0) +12>Emitted(76, 65) Source(87, 61) + SourceIndex(0) +13>Emitted(76, 66) Source(87, 62) + SourceIndex(0) +14>Emitted(76, 68) Source(87, 64) + SourceIndex(0) +15>Emitted(76, 69) Source(87, 65) + SourceIndex(0) +16>Emitted(76, 71) Source(87, 67) + SourceIndex(0) +17>Emitted(76, 73) Source(87, 69) + SourceIndex(0) +18>Emitted(76, 74) Source(87, 70) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(77, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(77, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(77, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(77, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(77, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(77, 32) Source(88, 32) + SourceIndex(0) +7 >Emitted(77, 33) Source(88, 33) + SourceIndex(0) +8 >Emitted(77, 34) Source(88, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(78, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(78, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for (var multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > ...multiRobotAInfo +6 > ] = ["trimmer", ["trimming", "edging"]], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(79, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(79, 4) Source(90, 4) + SourceIndex(0) +3 >Emitted(79, 5) Source(90, 5) + SourceIndex(0) +4 >Emitted(79, 6) Source(90, 11) + SourceIndex(0) +5 >Emitted(79, 72) Source(90, 29) + SourceIndex(0) +6 >Emitted(79, 74) Source(90, 70) + SourceIndex(0) +7 >Emitted(79, 75) Source(90, 71) + SourceIndex(0) +8 >Emitted(79, 78) Source(90, 74) + SourceIndex(0) +9 >Emitted(79, 79) Source(90, 75) + SourceIndex(0) +10>Emitted(79, 81) Source(90, 77) + SourceIndex(0) +11>Emitted(79, 82) Source(90, 78) + SourceIndex(0) +12>Emitted(79, 85) Source(90, 81) + SourceIndex(0) +13>Emitted(79, 86) Source(90, 82) + SourceIndex(0) +14>Emitted(79, 88) Source(90, 84) + SourceIndex(0) +15>Emitted(79, 89) Source(90, 85) + SourceIndex(0) +16>Emitted(79, 91) Source(90, 87) + SourceIndex(0) +17>Emitted(79, 93) Source(90, 89) + SourceIndex(0) +18>Emitted(79, 94) Source(90, 90) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(80, 5) Source(91, 5) + SourceIndex(0) +2 >Emitted(80, 12) Source(91, 12) + SourceIndex(0) +3 >Emitted(80, 13) Source(91, 13) + SourceIndex(0) +4 >Emitted(80, 16) Source(91, 16) + SourceIndex(0) +5 >Emitted(80, 17) Source(91, 17) + SourceIndex(0) +6 >Emitted(80, 32) Source(91, 32) + SourceIndex(0) +7 >Emitted(80, 33) Source(91, 33) + SourceIndex(0) +8 >Emitted(80, 34) Source(91, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(81, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(81, 2) Source(92, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.symbols new file mode 100644 index 00000000000..4e2131ff295 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.symbols @@ -0,0 +1,365 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 28)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 17, 11)) +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 11)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 32)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 20, 11)) +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 11)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 48)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 23, 11)) +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 27)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 60)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 26, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 27)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 64)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 29, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 27)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 84)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 32, 13)) +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 28)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 28)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 36, 10)) +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 32)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 39, 10)) +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 48)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 42, 10)) +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 31)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 31)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 31)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 45, 10)) +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 10)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 35)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 35)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 35)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 48, 10)) +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 55)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 55)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 55)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 51, 10)) +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 27)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 46)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 46)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 46)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 55, 19)) +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 27)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 50)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 50)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 50)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 58, 19)) +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 27)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 66)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 61, 19)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 33)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 66)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 64, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 33)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 70)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 67, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 33)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 90)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 70, 10)) +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 19)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 44)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 74, 10)) +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 19)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 48)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 77, 10)) +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 19)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 64)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 80, 10)) +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 44)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 83, 10)) +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 10)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 48)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 86, 10)) +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 68)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern.ts, 89, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types new file mode 100644 index 00000000000..fbe264eeeae --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types @@ -0,0 +1,549 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, [string, string]] + + return multiRobotA; +>multiRobotA : [string, [string, string]] +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { +> : undefined +>nameA : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { +> : undefined +>nameA : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +> : undefined +>nameA : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { +>numberB : number +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { +>numberB : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { +>nameB : string +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : number +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : (number | string)[] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number | string +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>multiRobotAInfo : (string | string[])[] +>["trimmer", ["trimming", "edging"]] : (string | string[])[] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | string[])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js new file mode 100644 index 00000000000..aad4d79ddd1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js @@ -0,0 +1,189 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForArrayBindingPattern2.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +var i; +for ((nameA = robotA[1], robotA), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_a = getRobot(), nameA = _a[1], _a), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = [2, "trimmer", "trimming"], nameA = _b[1], _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], multiRobotA), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], _d), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], _f), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((numberB = robotA[0], robotA), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_h = getRobot(), numberB = _h[0], _h), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_j = [2, "trimmer", "trimming"], numberB = _j[0], _j), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((nameB = multiRobotA[0], multiRobotA), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_k = getMultiRobot(), nameB = _k[0], _k), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_l = ["trimmer", ["trimming", "edging"]], nameB = _l[0], _l), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], robotA), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_m = getRobot(), numberA2 = _m[0], nameA2 = _m[1], skillA2 = _m[2], _m), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_o = [2, "trimmer", "trimming"], numberA2 = _o[0], nameA2 = _o[1], skillA2 = _o[2], _o), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((nameMA = multiRobotA[0], _p = multiRobotA[1], primarySkillA = _p[0], secondarySkillA = _p[1], multiRobotA), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_q = getMultiRobot(), nameMA = _q[0], _r = _q[1], primarySkillA = _r[0], secondarySkillA = _r[1], _q), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_s = ["trimmer", ["trimming", "edging"]], nameMA = _s[0], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1], _s), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((numberA3 = robotA[0], robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_u = getRobot(), numberA3 = _u[0], robotAInfo = _u.slice(1), _u), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_v = [2, "trimmer", "trimming"], numberA3 = _v[0], robotAInfo = _v.slice(1), _v), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((multiRobotAInfo = multiRobotA.slice(0), multiRobotA), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ((_w = getMultiRobot(), multiRobotAInfo = _w.slice(0), _w), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ((_x = ["trimmer", ["trimming", "edging"]], multiRobotAInfo = _x.slice(0), _x), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map new file mode 100644 index 00000000000..046cd61ad40 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,GAAG,CAAC,CAAC,CAAG,iBAAK,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsB,EAAnB,aAAK,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAAsC,EAAnC,aAAK,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAG,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAsD,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAoB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAA0E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAwC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,mBAAO,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsB,EAArB,eAAO,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAAsC,EAArC,eAAO,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,sBAAK,EAAI,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAyB,EAAxB,aAAK,KAAmB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAA6C,EAA5C,aAAK,KAAuC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAwC,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAAwD,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAA4D,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAoB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,KAAwC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,oBAAQ,EAAE,4BAAa,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsC,EAArC,gBAAQ,EAAE,wBAAa,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAA6D,EAA5D,gBAAQ,EAAE,wBAAa,KAAqC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,sCAAkB,EAAI,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAsC,EAArC,6BAAkB,KAAmB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAA6E,EAA5E,6BAAkB,KAA0D,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..186dc717e61 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,3037 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(18, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(18, 20) + SourceIndex(0) +5 >Emitted(10, 25) Source(18, 41) + SourceIndex(0) +6 >Emitted(10, 27) Source(18, 43) + SourceIndex(0) +7 >Emitted(10, 42) Source(18, 66) + SourceIndex(0) +8 >Emitted(10, 43) Source(18, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +3 >Emitted(11, 12) Source(19, 20) + SourceIndex(0) +4 >Emitted(11, 14) Source(19, 22) + SourceIndex(0) +5 >Emitted(11, 19) Source(19, 35) + SourceIndex(0) +6 >Emitted(11, 20) Source(19, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(20, 5) + SourceIndex(0) +3 >Emitted(12, 13) Source(20, 21) + SourceIndex(0) +4 >Emitted(12, 15) Source(20, 23) + SourceIndex(0) +5 >Emitted(12, 21) Source(20, 37) + SourceIndex(0) +6 >Emitted(12, 23) Source(20, 39) + SourceIndex(0) +7 >Emitted(12, 30) Source(20, 54) + SourceIndex(0) +8 >Emitted(12, 32) Source(20, 56) + SourceIndex(0) +9 >Emitted(12, 38) Source(20, 70) + SourceIndex(0) +10>Emitted(12, 39) Source(20, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 13) Source(21, 21) + SourceIndex(0) +4 >Emitted(13, 15) Source(21, 23) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 54) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 56) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 102) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 103) + SourceIndex(0) +--- +>>>var i; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > i: number +4 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(22, 14) + SourceIndex(0) +4 >Emitted(14, 7) Source(22, 15) + SourceIndex(0) +--- +>>>for ((nameA = robotA[1], robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [, +6 > nameA +7 > ] = +8 > robotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(15, 7) Source(24, 9) + SourceIndex(0) +6 >Emitted(15, 24) Source(24, 14) + SourceIndex(0) +7 >Emitted(15, 26) Source(24, 18) + SourceIndex(0) +8 >Emitted(15, 32) Source(24, 24) + SourceIndex(0) +9 >Emitted(15, 33) Source(24, 24) + SourceIndex(0) +10>Emitted(15, 35) Source(24, 26) + SourceIndex(0) +11>Emitted(15, 36) Source(24, 27) + SourceIndex(0) +12>Emitted(15, 39) Source(24, 30) + SourceIndex(0) +13>Emitted(15, 40) Source(24, 31) + SourceIndex(0) +14>Emitted(15, 42) Source(24, 33) + SourceIndex(0) +15>Emitted(15, 43) Source(24, 34) + SourceIndex(0) +16>Emitted(15, 46) Source(24, 37) + SourceIndex(0) +17>Emitted(15, 47) Source(24, 38) + SourceIndex(0) +18>Emitted(15, 49) Source(24, 40) + SourceIndex(0) +19>Emitted(15, 50) Source(24, 41) + SourceIndex(0) +20>Emitted(15, 52) Source(24, 43) + SourceIndex(0) +21>Emitted(15, 54) Source(24, 45) + SourceIndex(0) +22>Emitted(15, 55) Source(24, 46) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for ((_a = getRobot(), nameA = _a[1], _a), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA] = getRobot() +7 > +8 > nameA +9 > ] = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(18, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) +5 >Emitted(18, 7) Source(27, 6) + SourceIndex(0) +6 >Emitted(18, 22) Source(27, 28) + SourceIndex(0) +7 >Emitted(18, 24) Source(27, 9) + SourceIndex(0) +8 >Emitted(18, 37) Source(27, 14) + SourceIndex(0) +9 >Emitted(18, 42) Source(27, 28) + SourceIndex(0) +10>Emitted(18, 44) Source(27, 30) + SourceIndex(0) +11>Emitted(18, 45) Source(27, 31) + SourceIndex(0) +12>Emitted(18, 48) Source(27, 34) + SourceIndex(0) +13>Emitted(18, 49) Source(27, 35) + SourceIndex(0) +14>Emitted(18, 51) Source(27, 37) + SourceIndex(0) +15>Emitted(18, 52) Source(27, 38) + SourceIndex(0) +16>Emitted(18, 55) Source(27, 41) + SourceIndex(0) +17>Emitted(18, 56) Source(27, 42) + SourceIndex(0) +18>Emitted(18, 58) Source(27, 44) + SourceIndex(0) +19>Emitted(18, 59) Source(27, 45) + SourceIndex(0) +20>Emitted(18, 61) Source(27, 47) + SourceIndex(0) +21>Emitted(18, 63) Source(27, 49) + SourceIndex(0) +22>Emitted(18, 64) Source(27, 50) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for ((_b = [2, "trimmer", "trimming"], nameA = _b[1], _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA] = [2, "trimmer", "trimming"] +7 > +8 > nameA +9 > ] = [2, "trimmer", "trimming"] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(21, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) +5 >Emitted(21, 7) Source(30, 6) + SourceIndex(0) +6 >Emitted(21, 38) Source(30, 44) + SourceIndex(0) +7 >Emitted(21, 40) Source(30, 9) + SourceIndex(0) +8 >Emitted(21, 53) Source(30, 14) + SourceIndex(0) +9 >Emitted(21, 58) Source(30, 44) + SourceIndex(0) +10>Emitted(21, 60) Source(30, 46) + SourceIndex(0) +11>Emitted(21, 61) Source(30, 47) + SourceIndex(0) +12>Emitted(21, 64) Source(30, 50) + SourceIndex(0) +13>Emitted(21, 65) Source(30, 51) + SourceIndex(0) +14>Emitted(21, 67) Source(30, 53) + SourceIndex(0) +15>Emitted(21, 68) Source(30, 54) + SourceIndex(0) +16>Emitted(21, 71) Source(30, 57) + SourceIndex(0) +17>Emitted(21, 72) Source(30, 58) + SourceIndex(0) +18>Emitted(21, 74) Source(30, 60) + SourceIndex(0) +19>Emitted(21, 75) Source(30, 61) + SourceIndex(0) +20>Emitted(21, 77) Source(30, 63) + SourceIndex(0) +21>Emitted(21, 79) Source(30, 65) + SourceIndex(0) +22>Emitted(21, 80) Source(30, 66) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(31, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(31, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(31, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for ((_c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [, +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +11> ]] = +12> multiRobotA +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(24, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(24, 7) Source(33, 9) + SourceIndex(0) +6 >Emitted(24, 26) Source(33, 41) + SourceIndex(0) +7 >Emitted(24, 28) Source(33, 10) + SourceIndex(0) +8 >Emitted(24, 49) Source(33, 23) + SourceIndex(0) +9 >Emitted(24, 51) Source(33, 25) + SourceIndex(0) +10>Emitted(24, 74) Source(33, 40) + SourceIndex(0) +11>Emitted(24, 76) Source(33, 45) + SourceIndex(0) +12>Emitted(24, 87) Source(33, 56) + SourceIndex(0) +13>Emitted(24, 88) Source(33, 56) + SourceIndex(0) +14>Emitted(24, 90) Source(33, 58) + SourceIndex(0) +15>Emitted(24, 91) Source(33, 59) + SourceIndex(0) +16>Emitted(24, 94) Source(33, 62) + SourceIndex(0) +17>Emitted(24, 95) Source(33, 63) + SourceIndex(0) +18>Emitted(24, 97) Source(33, 65) + SourceIndex(0) +19>Emitted(24, 98) Source(33, 66) + SourceIndex(0) +20>Emitted(24, 101) Source(33, 69) + SourceIndex(0) +21>Emitted(24, 102) Source(33, 70) + SourceIndex(0) +22>Emitted(24, 104) Source(33, 72) + SourceIndex(0) +23>Emitted(24, 105) Source(33, 73) + SourceIndex(0) +24>Emitted(24, 107) Source(33, 75) + SourceIndex(0) +25>Emitted(24, 109) Source(33, 77) + SourceIndex(0) +26>Emitted(24, 110) Source(33, 78) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(25, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(25, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(25, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for ((_d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = getMultiRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(27, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(36, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(36, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(36, 6) + SourceIndex(0) +5 >Emitted(27, 7) Source(36, 6) + SourceIndex(0) +6 >Emitted(27, 27) Source(36, 60) + SourceIndex(0) +7 >Emitted(27, 29) Source(36, 9) + SourceIndex(0) +8 >Emitted(27, 39) Source(36, 41) + SourceIndex(0) +9 >Emitted(27, 41) Source(36, 10) + SourceIndex(0) +10>Emitted(27, 62) Source(36, 23) + SourceIndex(0) +11>Emitted(27, 64) Source(36, 25) + SourceIndex(0) +12>Emitted(27, 87) Source(36, 40) + SourceIndex(0) +13>Emitted(27, 92) Source(36, 60) + SourceIndex(0) +14>Emitted(27, 94) Source(36, 62) + SourceIndex(0) +15>Emitted(27, 95) Source(36, 63) + SourceIndex(0) +16>Emitted(27, 98) Source(36, 66) + SourceIndex(0) +17>Emitted(27, 99) Source(36, 67) + SourceIndex(0) +18>Emitted(27, 101) Source(36, 69) + SourceIndex(0) +19>Emitted(27, 102) Source(36, 70) + SourceIndex(0) +20>Emitted(27, 105) Source(36, 73) + SourceIndex(0) +21>Emitted(27, 106) Source(36, 74) + SourceIndex(0) +22>Emitted(27, 108) Source(36, 76) + SourceIndex(0) +23>Emitted(27, 109) Source(36, 77) + SourceIndex(0) +24>Emitted(27, 111) Source(36, 79) + SourceIndex(0) +25>Emitted(27, 113) Source(36, 81) + SourceIndex(0) +26>Emitted(27, 114) Source(36, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(28, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(28, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(28, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for ((_f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], _f), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = ["trimmer", ["trimming", "edging"]] +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(30, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(39, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(39, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(39, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(39, 6) + SourceIndex(0) +6 >Emitted(30, 47) Source(39, 80) + SourceIndex(0) +7 >Emitted(30, 49) Source(39, 9) + SourceIndex(0) +8 >Emitted(30, 59) Source(39, 41) + SourceIndex(0) +9 >Emitted(30, 61) Source(39, 10) + SourceIndex(0) +10>Emitted(30, 82) Source(39, 23) + SourceIndex(0) +11>Emitted(30, 84) Source(39, 25) + SourceIndex(0) +12>Emitted(30, 107) Source(39, 40) + SourceIndex(0) +13>Emitted(30, 112) Source(39, 80) + SourceIndex(0) +14>Emitted(30, 114) Source(39, 82) + SourceIndex(0) +15>Emitted(30, 115) Source(39, 83) + SourceIndex(0) +16>Emitted(30, 118) Source(39, 86) + SourceIndex(0) +17>Emitted(30, 119) Source(39, 87) + SourceIndex(0) +18>Emitted(30, 121) Source(39, 89) + SourceIndex(0) +19>Emitted(30, 122) Source(39, 90) + SourceIndex(0) +20>Emitted(30, 125) Source(39, 93) + SourceIndex(0) +21>Emitted(30, 126) Source(39, 94) + SourceIndex(0) +22>Emitted(30, 128) Source(39, 96) + SourceIndex(0) +23>Emitted(30, 129) Source(39, 97) + SourceIndex(0) +24>Emitted(30, 131) Source(39, 99) + SourceIndex(0) +25>Emitted(30, 133) Source(39, 101) + SourceIndex(0) +26>Emitted(30, 134) Source(39, 102) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(40, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(40, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(40, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(40, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(40, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(40, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(40, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(40, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(41, 2) + SourceIndex(0) +--- +>>>for ((numberB = robotA[0], robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberB +7 > ] = +8 > robotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(33, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(43, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(43, 7) + SourceIndex(0) +6 >Emitted(33, 26) Source(43, 14) + SourceIndex(0) +7 >Emitted(33, 28) Source(43, 18) + SourceIndex(0) +8 >Emitted(33, 34) Source(43, 24) + SourceIndex(0) +9 >Emitted(33, 35) Source(43, 24) + SourceIndex(0) +10>Emitted(33, 37) Source(43, 26) + SourceIndex(0) +11>Emitted(33, 38) Source(43, 27) + SourceIndex(0) +12>Emitted(33, 41) Source(43, 30) + SourceIndex(0) +13>Emitted(33, 42) Source(43, 31) + SourceIndex(0) +14>Emitted(33, 44) Source(43, 33) + SourceIndex(0) +15>Emitted(33, 45) Source(43, 34) + SourceIndex(0) +16>Emitted(33, 48) Source(43, 37) + SourceIndex(0) +17>Emitted(33, 49) Source(43, 38) + SourceIndex(0) +18>Emitted(33, 51) Source(43, 40) + SourceIndex(0) +19>Emitted(33, 52) Source(43, 41) + SourceIndex(0) +20>Emitted(33, 54) Source(43, 43) + SourceIndex(0) +21>Emitted(33, 56) Source(43, 45) + SourceIndex(0) +22>Emitted(33, 57) Source(43, 46) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(34, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(34, 24) Source(44, 24) + SourceIndex(0) +7 >Emitted(34, 25) Source(44, 25) + SourceIndex(0) +8 >Emitted(34, 26) Source(44, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for ((_h = getRobot(), numberB = _h[0], _h), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB] = getRobot() +7 > +8 > numberB +9 > ] = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(36, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(46, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(46, 6) + SourceIndex(0) +6 >Emitted(36, 22) Source(46, 28) + SourceIndex(0) +7 >Emitted(36, 24) Source(46, 7) + SourceIndex(0) +8 >Emitted(36, 39) Source(46, 14) + SourceIndex(0) +9 >Emitted(36, 44) Source(46, 28) + SourceIndex(0) +10>Emitted(36, 46) Source(46, 30) + SourceIndex(0) +11>Emitted(36, 47) Source(46, 31) + SourceIndex(0) +12>Emitted(36, 50) Source(46, 34) + SourceIndex(0) +13>Emitted(36, 51) Source(46, 35) + SourceIndex(0) +14>Emitted(36, 53) Source(46, 37) + SourceIndex(0) +15>Emitted(36, 54) Source(46, 38) + SourceIndex(0) +16>Emitted(36, 57) Source(46, 41) + SourceIndex(0) +17>Emitted(36, 58) Source(46, 42) + SourceIndex(0) +18>Emitted(36, 60) Source(46, 44) + SourceIndex(0) +19>Emitted(36, 61) Source(46, 45) + SourceIndex(0) +20>Emitted(36, 63) Source(46, 47) + SourceIndex(0) +21>Emitted(36, 65) Source(46, 49) + SourceIndex(0) +22>Emitted(36, 66) Source(46, 50) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(37, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(37, 24) Source(47, 24) + SourceIndex(0) +7 >Emitted(37, 25) Source(47, 25) + SourceIndex(0) +8 >Emitted(37, 26) Source(47, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for ((_j = [2, "trimmer", "trimming"], numberB = _j[0], _j), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB] = [2, "trimmer", "trimming"] +7 > +8 > numberB +9 > ] = [2, "trimmer", "trimming"] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(39, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(49, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(49, 6) + SourceIndex(0) +6 >Emitted(39, 38) Source(49, 44) + SourceIndex(0) +7 >Emitted(39, 40) Source(49, 7) + SourceIndex(0) +8 >Emitted(39, 55) Source(49, 14) + SourceIndex(0) +9 >Emitted(39, 60) Source(49, 44) + SourceIndex(0) +10>Emitted(39, 62) Source(49, 46) + SourceIndex(0) +11>Emitted(39, 63) Source(49, 47) + SourceIndex(0) +12>Emitted(39, 66) Source(49, 50) + SourceIndex(0) +13>Emitted(39, 67) Source(49, 51) + SourceIndex(0) +14>Emitted(39, 69) Source(49, 53) + SourceIndex(0) +15>Emitted(39, 70) Source(49, 54) + SourceIndex(0) +16>Emitted(39, 73) Source(49, 57) + SourceIndex(0) +17>Emitted(39, 74) Source(49, 58) + SourceIndex(0) +18>Emitted(39, 76) Source(49, 60) + SourceIndex(0) +19>Emitted(39, 77) Source(49, 61) + SourceIndex(0) +20>Emitted(39, 79) Source(49, 63) + SourceIndex(0) +21>Emitted(39, 81) Source(49, 65) + SourceIndex(0) +22>Emitted(39, 82) Source(49, 66) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(40, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(40, 24) Source(50, 24) + SourceIndex(0) +7 >Emitted(40, 25) Source(50, 25) + SourceIndex(0) +8 >Emitted(40, 26) Source(50, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for ((nameB = multiRobotA[0], multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > nameB +7 > ] = +8 > multiRobotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(42, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(52, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(52, 7) + SourceIndex(0) +6 >Emitted(42, 29) Source(52, 12) + SourceIndex(0) +7 >Emitted(42, 31) Source(52, 16) + SourceIndex(0) +8 >Emitted(42, 42) Source(52, 27) + SourceIndex(0) +9 >Emitted(42, 43) Source(52, 27) + SourceIndex(0) +10>Emitted(42, 45) Source(52, 29) + SourceIndex(0) +11>Emitted(42, 46) Source(52, 30) + SourceIndex(0) +12>Emitted(42, 49) Source(52, 33) + SourceIndex(0) +13>Emitted(42, 50) Source(52, 34) + SourceIndex(0) +14>Emitted(42, 52) Source(52, 36) + SourceIndex(0) +15>Emitted(42, 53) Source(52, 37) + SourceIndex(0) +16>Emitted(42, 56) Source(52, 40) + SourceIndex(0) +17>Emitted(42, 57) Source(52, 41) + SourceIndex(0) +18>Emitted(42, 59) Source(52, 43) + SourceIndex(0) +19>Emitted(42, 60) Source(52, 44) + SourceIndex(0) +20>Emitted(42, 62) Source(52, 46) + SourceIndex(0) +21>Emitted(42, 64) Source(52, 48) + SourceIndex(0) +22>Emitted(42, 65) Source(52, 49) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for ((_k = getMultiRobot(), nameB = _k[0], _k), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB] = getMultiRobot() +7 > +8 > nameB +9 > ] = getMultiRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(45, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(55, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(55, 6) + SourceIndex(0) +6 >Emitted(45, 27) Source(55, 31) + SourceIndex(0) +7 >Emitted(45, 29) Source(55, 7) + SourceIndex(0) +8 >Emitted(45, 42) Source(55, 12) + SourceIndex(0) +9 >Emitted(45, 47) Source(55, 31) + SourceIndex(0) +10>Emitted(45, 49) Source(55, 33) + SourceIndex(0) +11>Emitted(45, 50) Source(55, 34) + SourceIndex(0) +12>Emitted(45, 53) Source(55, 37) + SourceIndex(0) +13>Emitted(45, 54) Source(55, 38) + SourceIndex(0) +14>Emitted(45, 56) Source(55, 40) + SourceIndex(0) +15>Emitted(45, 57) Source(55, 41) + SourceIndex(0) +16>Emitted(45, 60) Source(55, 44) + SourceIndex(0) +17>Emitted(45, 61) Source(55, 45) + SourceIndex(0) +18>Emitted(45, 63) Source(55, 47) + SourceIndex(0) +19>Emitted(45, 64) Source(55, 48) + SourceIndex(0) +20>Emitted(45, 66) Source(55, 50) + SourceIndex(0) +21>Emitted(45, 68) Source(55, 52) + SourceIndex(0) +22>Emitted(45, 69) Source(55, 53) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(46, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(46, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(46, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(46, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(46, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(46, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(46, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(46, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(47, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(47, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for ((_l = ["trimmer", ["trimming", "edging"]], nameB = _l[0], _l), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameB +9 > ] = ["trimmer", ["trimming", "edging"]] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(48, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(48, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(48, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(48, 6) Source(58, 6) + SourceIndex(0) +5 >Emitted(48, 7) Source(58, 6) + SourceIndex(0) +6 >Emitted(48, 47) Source(58, 51) + SourceIndex(0) +7 >Emitted(48, 49) Source(58, 7) + SourceIndex(0) +8 >Emitted(48, 62) Source(58, 12) + SourceIndex(0) +9 >Emitted(48, 67) Source(58, 51) + SourceIndex(0) +10>Emitted(48, 69) Source(58, 53) + SourceIndex(0) +11>Emitted(48, 70) Source(58, 54) + SourceIndex(0) +12>Emitted(48, 73) Source(58, 57) + SourceIndex(0) +13>Emitted(48, 74) Source(58, 58) + SourceIndex(0) +14>Emitted(48, 76) Source(58, 60) + SourceIndex(0) +15>Emitted(48, 77) Source(58, 61) + SourceIndex(0) +16>Emitted(48, 80) Source(58, 64) + SourceIndex(0) +17>Emitted(48, 81) Source(58, 65) + SourceIndex(0) +18>Emitted(48, 83) Source(58, 67) + SourceIndex(0) +19>Emitted(48, 84) Source(58, 68) + SourceIndex(0) +20>Emitted(48, 86) Source(58, 70) + SourceIndex(0) +21>Emitted(48, 88) Source(58, 72) + SourceIndex(0) +22>Emitted(48, 89) Source(58, 73) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(49, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(50, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(50, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for ((numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA2 +7 > , +8 > nameA2 +9 > , +10> skillA2 +11> ] = +12> robotA +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(51, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(62, 6) + SourceIndex(0) +5 >Emitted(51, 7) Source(62, 7) + SourceIndex(0) +6 >Emitted(51, 27) Source(62, 15) + SourceIndex(0) +7 >Emitted(51, 29) Source(62, 17) + SourceIndex(0) +8 >Emitted(51, 47) Source(62, 23) + SourceIndex(0) +9 >Emitted(51, 49) Source(62, 25) + SourceIndex(0) +10>Emitted(51, 68) Source(62, 32) + SourceIndex(0) +11>Emitted(51, 70) Source(62, 36) + SourceIndex(0) +12>Emitted(51, 76) Source(62, 42) + SourceIndex(0) +13>Emitted(51, 77) Source(62, 42) + SourceIndex(0) +14>Emitted(51, 79) Source(62, 44) + SourceIndex(0) +15>Emitted(51, 80) Source(62, 45) + SourceIndex(0) +16>Emitted(51, 83) Source(62, 48) + SourceIndex(0) +17>Emitted(51, 84) Source(62, 49) + SourceIndex(0) +18>Emitted(51, 86) Source(62, 51) + SourceIndex(0) +19>Emitted(51, 87) Source(62, 52) + SourceIndex(0) +20>Emitted(51, 90) Source(62, 55) + SourceIndex(0) +21>Emitted(51, 91) Source(62, 56) + SourceIndex(0) +22>Emitted(51, 93) Source(62, 58) + SourceIndex(0) +23>Emitted(51, 94) Source(62, 59) + SourceIndex(0) +24>Emitted(51, 96) Source(62, 61) + SourceIndex(0) +25>Emitted(51, 98) Source(62, 63) + SourceIndex(0) +26>Emitted(51, 99) Source(62, 64) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(52, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(52, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(52, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(52, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(52, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(52, 23) Source(63, 23) + SourceIndex(0) +7 >Emitted(52, 24) Source(63, 24) + SourceIndex(0) +8 >Emitted(52, 25) Source(63, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(53, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(53, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for ((_m = getRobot(), numberA2 = _m[0], nameA2 = _m[1], skillA2 = _m[2], _m), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2, nameA2, skillA2] = getRobot() +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = getRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(54, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(54, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(54, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(54, 6) Source(65, 6) + SourceIndex(0) +5 >Emitted(54, 7) Source(65, 6) + SourceIndex(0) +6 >Emitted(54, 22) Source(65, 46) + SourceIndex(0) +7 >Emitted(54, 24) Source(65, 7) + SourceIndex(0) +8 >Emitted(54, 40) Source(65, 15) + SourceIndex(0) +9 >Emitted(54, 42) Source(65, 17) + SourceIndex(0) +10>Emitted(54, 56) Source(65, 23) + SourceIndex(0) +11>Emitted(54, 58) Source(65, 25) + SourceIndex(0) +12>Emitted(54, 73) Source(65, 32) + SourceIndex(0) +13>Emitted(54, 78) Source(65, 46) + SourceIndex(0) +14>Emitted(54, 80) Source(65, 48) + SourceIndex(0) +15>Emitted(54, 81) Source(65, 49) + SourceIndex(0) +16>Emitted(54, 84) Source(65, 52) + SourceIndex(0) +17>Emitted(54, 85) Source(65, 53) + SourceIndex(0) +18>Emitted(54, 87) Source(65, 55) + SourceIndex(0) +19>Emitted(54, 88) Source(65, 56) + SourceIndex(0) +20>Emitted(54, 91) Source(65, 59) + SourceIndex(0) +21>Emitted(54, 92) Source(65, 60) + SourceIndex(0) +22>Emitted(54, 94) Source(65, 62) + SourceIndex(0) +23>Emitted(54, 95) Source(65, 63) + SourceIndex(0) +24>Emitted(54, 97) Source(65, 65) + SourceIndex(0) +25>Emitted(54, 99) Source(65, 67) + SourceIndex(0) +26>Emitted(54, 100) Source(65, 68) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(55, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(55, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(55, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(55, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(56, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(56, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for ((_o = [2, "trimmer", "trimming"], numberA2 = _o[0], nameA2 = _o[1], skillA2 = _o[2], _o), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 +9 > , +10> nameA2 +11> , +12> skillA2 +13> ] = [2, "trimmer", "trimming"] +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(57, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(57, 7) Source(68, 6) + SourceIndex(0) +6 >Emitted(57, 38) Source(68, 62) + SourceIndex(0) +7 >Emitted(57, 40) Source(68, 7) + SourceIndex(0) +8 >Emitted(57, 56) Source(68, 15) + SourceIndex(0) +9 >Emitted(57, 58) Source(68, 17) + SourceIndex(0) +10>Emitted(57, 72) Source(68, 23) + SourceIndex(0) +11>Emitted(57, 74) Source(68, 25) + SourceIndex(0) +12>Emitted(57, 89) Source(68, 32) + SourceIndex(0) +13>Emitted(57, 94) Source(68, 62) + SourceIndex(0) +14>Emitted(57, 96) Source(68, 64) + SourceIndex(0) +15>Emitted(57, 97) Source(68, 65) + SourceIndex(0) +16>Emitted(57, 100) Source(68, 68) + SourceIndex(0) +17>Emitted(57, 101) Source(68, 69) + SourceIndex(0) +18>Emitted(57, 103) Source(68, 71) + SourceIndex(0) +19>Emitted(57, 104) Source(68, 72) + SourceIndex(0) +20>Emitted(57, 107) Source(68, 75) + SourceIndex(0) +21>Emitted(57, 108) Source(68, 76) + SourceIndex(0) +22>Emitted(57, 110) Source(68, 78) + SourceIndex(0) +23>Emitted(57, 111) Source(68, 79) + SourceIndex(0) +24>Emitted(57, 113) Source(68, 81) + SourceIndex(0) +25>Emitted(57, 115) Source(68, 83) + SourceIndex(0) +26>Emitted(57, 116) Source(68, 84) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(58, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(58, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(58, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(58, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(59, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(59, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for ((nameMA = multiRobotA[0], _p = multiRobotA[1], primarySkillA = _p[0], secondarySkillA = _p[1], multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > nameMA +7 > , +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = +14> multiRobotA +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(60, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(60, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(60, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(60, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(60, 7) Source(71, 7) + SourceIndex(0) +6 >Emitted(60, 30) Source(71, 13) + SourceIndex(0) +7 >Emitted(60, 32) Source(71, 15) + SourceIndex(0) +8 >Emitted(60, 51) Source(71, 47) + SourceIndex(0) +9 >Emitted(60, 53) Source(71, 16) + SourceIndex(0) +10>Emitted(60, 74) Source(71, 29) + SourceIndex(0) +11>Emitted(60, 76) Source(71, 31) + SourceIndex(0) +12>Emitted(60, 99) Source(71, 46) + SourceIndex(0) +13>Emitted(60, 101) Source(71, 51) + SourceIndex(0) +14>Emitted(60, 112) Source(71, 62) + SourceIndex(0) +15>Emitted(60, 113) Source(71, 62) + SourceIndex(0) +16>Emitted(60, 115) Source(71, 64) + SourceIndex(0) +17>Emitted(60, 116) Source(71, 65) + SourceIndex(0) +18>Emitted(60, 119) Source(71, 68) + SourceIndex(0) +19>Emitted(60, 120) Source(71, 69) + SourceIndex(0) +20>Emitted(60, 122) Source(71, 71) + SourceIndex(0) +21>Emitted(60, 123) Source(71, 72) + SourceIndex(0) +22>Emitted(60, 126) Source(71, 75) + SourceIndex(0) +23>Emitted(60, 127) Source(71, 76) + SourceIndex(0) +24>Emitted(60, 129) Source(71, 78) + SourceIndex(0) +25>Emitted(60, 130) Source(71, 79) + SourceIndex(0) +26>Emitted(60, 132) Source(71, 81) + SourceIndex(0) +27>Emitted(60, 134) Source(71, 83) + SourceIndex(0) +28>Emitted(60, 135) Source(71, 84) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(61, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(61, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(61, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(61, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(61, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(61, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(61, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(61, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(62, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(62, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for ((_q = getMultiRobot(), nameMA = _q[0], _r = _q[1], primarySkillA = _r[0], secondarySkillA = _r[1], _q), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = getMultiRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(63, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(63, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(63, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(63, 6) Source(74, 6) + SourceIndex(0) +5 >Emitted(63, 7) Source(74, 6) + SourceIndex(0) +6 >Emitted(63, 27) Source(74, 66) + SourceIndex(0) +7 >Emitted(63, 29) Source(74, 7) + SourceIndex(0) +8 >Emitted(63, 43) Source(74, 13) + SourceIndex(0) +9 >Emitted(63, 45) Source(74, 15) + SourceIndex(0) +10>Emitted(63, 55) Source(74, 47) + SourceIndex(0) +11>Emitted(63, 57) Source(74, 16) + SourceIndex(0) +12>Emitted(63, 78) Source(74, 29) + SourceIndex(0) +13>Emitted(63, 80) Source(74, 31) + SourceIndex(0) +14>Emitted(63, 103) Source(74, 46) + SourceIndex(0) +15>Emitted(63, 108) Source(74, 66) + SourceIndex(0) +16>Emitted(63, 110) Source(74, 68) + SourceIndex(0) +17>Emitted(63, 111) Source(74, 69) + SourceIndex(0) +18>Emitted(63, 114) Source(74, 72) + SourceIndex(0) +19>Emitted(63, 115) Source(74, 73) + SourceIndex(0) +20>Emitted(63, 117) Source(74, 75) + SourceIndex(0) +21>Emitted(63, 118) Source(74, 76) + SourceIndex(0) +22>Emitted(63, 121) Source(74, 79) + SourceIndex(0) +23>Emitted(63, 122) Source(74, 80) + SourceIndex(0) +24>Emitted(63, 124) Source(74, 82) + SourceIndex(0) +25>Emitted(63, 125) Source(74, 83) + SourceIndex(0) +26>Emitted(63, 127) Source(74, 85) + SourceIndex(0) +27>Emitted(63, 129) Source(74, 87) + SourceIndex(0) +28>Emitted(63, 130) Source(74, 88) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(64, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(64, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(64, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(65, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(65, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for ((_s = ["trimmer", ["trimming", "edging"]], nameMA = _s[0], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1], _s), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA +9 > , +10> [primarySkillA, secondarySkillA] +11> +12> primarySkillA +13> , +14> secondarySkillA +15> ]] = ["trimmer", ["trimming", "edging"]] +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(66, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(66, 7) Source(77, 6) + SourceIndex(0) +6 >Emitted(66, 47) Source(77, 86) + SourceIndex(0) +7 >Emitted(66, 49) Source(77, 7) + SourceIndex(0) +8 >Emitted(66, 63) Source(77, 13) + SourceIndex(0) +9 >Emitted(66, 65) Source(77, 15) + SourceIndex(0) +10>Emitted(66, 75) Source(77, 47) + SourceIndex(0) +11>Emitted(66, 77) Source(77, 16) + SourceIndex(0) +12>Emitted(66, 98) Source(77, 29) + SourceIndex(0) +13>Emitted(66, 100) Source(77, 31) + SourceIndex(0) +14>Emitted(66, 123) Source(77, 46) + SourceIndex(0) +15>Emitted(66, 128) Source(77, 86) + SourceIndex(0) +16>Emitted(66, 130) Source(77, 88) + SourceIndex(0) +17>Emitted(66, 131) Source(77, 89) + SourceIndex(0) +18>Emitted(66, 134) Source(77, 92) + SourceIndex(0) +19>Emitted(66, 135) Source(77, 93) + SourceIndex(0) +20>Emitted(66, 137) Source(77, 95) + SourceIndex(0) +21>Emitted(66, 138) Source(77, 96) + SourceIndex(0) +22>Emitted(66, 141) Source(77, 99) + SourceIndex(0) +23>Emitted(66, 142) Source(77, 100) + SourceIndex(0) +24>Emitted(66, 144) Source(77, 102) + SourceIndex(0) +25>Emitted(66, 145) Source(77, 103) + SourceIndex(0) +26>Emitted(66, 147) Source(77, 105) + SourceIndex(0) +27>Emitted(66, 149) Source(77, 107) + SourceIndex(0) +28>Emitted(66, 150) Source(77, 108) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(67, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(78, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(78, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(78, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(68, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(68, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for ((numberA3 = robotA[0], robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA3 +7 > , +8 > ...robotAInfo +9 > ] = +10> robotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(69, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(69, 7) Source(81, 7) + SourceIndex(0) +6 >Emitted(69, 27) Source(81, 15) + SourceIndex(0) +7 >Emitted(69, 29) Source(81, 17) + SourceIndex(0) +8 >Emitted(69, 57) Source(81, 30) + SourceIndex(0) +9 >Emitted(69, 59) Source(81, 34) + SourceIndex(0) +10>Emitted(69, 65) Source(81, 40) + SourceIndex(0) +11>Emitted(69, 66) Source(81, 40) + SourceIndex(0) +12>Emitted(69, 68) Source(81, 42) + SourceIndex(0) +13>Emitted(69, 69) Source(81, 43) + SourceIndex(0) +14>Emitted(69, 72) Source(81, 46) + SourceIndex(0) +15>Emitted(69, 73) Source(81, 47) + SourceIndex(0) +16>Emitted(69, 75) Source(81, 49) + SourceIndex(0) +17>Emitted(69, 76) Source(81, 50) + SourceIndex(0) +18>Emitted(69, 79) Source(81, 53) + SourceIndex(0) +19>Emitted(69, 80) Source(81, 54) + SourceIndex(0) +20>Emitted(69, 82) Source(81, 56) + SourceIndex(0) +21>Emitted(69, 83) Source(81, 57) + SourceIndex(0) +22>Emitted(69, 85) Source(81, 59) + SourceIndex(0) +23>Emitted(69, 87) Source(81, 61) + SourceIndex(0) +24>Emitted(69, 88) Source(81, 62) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(70, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(70, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(70, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(70, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(70, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(70, 25) Source(82, 25) + SourceIndex(0) +7 >Emitted(70, 26) Source(82, 26) + SourceIndex(0) +8 >Emitted(70, 27) Source(82, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(71, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(71, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for ((_u = getRobot(), numberA3 = _u[0], robotAInfo = _u.slice(1), _u), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3, ...robotAInfo] = getRobot() +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(72, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(72, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(72, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(72, 6) Source(84, 6) + SourceIndex(0) +5 >Emitted(72, 7) Source(84, 6) + SourceIndex(0) +6 >Emitted(72, 22) Source(84, 44) + SourceIndex(0) +7 >Emitted(72, 24) Source(84, 7) + SourceIndex(0) +8 >Emitted(72, 40) Source(84, 15) + SourceIndex(0) +9 >Emitted(72, 42) Source(84, 17) + SourceIndex(0) +10>Emitted(72, 66) Source(84, 30) + SourceIndex(0) +11>Emitted(72, 71) Source(84, 44) + SourceIndex(0) +12>Emitted(72, 73) Source(84, 46) + SourceIndex(0) +13>Emitted(72, 74) Source(84, 47) + SourceIndex(0) +14>Emitted(72, 77) Source(84, 50) + SourceIndex(0) +15>Emitted(72, 78) Source(84, 51) + SourceIndex(0) +16>Emitted(72, 80) Source(84, 53) + SourceIndex(0) +17>Emitted(72, 81) Source(84, 54) + SourceIndex(0) +18>Emitted(72, 84) Source(84, 57) + SourceIndex(0) +19>Emitted(72, 85) Source(84, 58) + SourceIndex(0) +20>Emitted(72, 87) Source(84, 60) + SourceIndex(0) +21>Emitted(72, 88) Source(84, 61) + SourceIndex(0) +22>Emitted(72, 90) Source(84, 63) + SourceIndex(0) +23>Emitted(72, 92) Source(84, 65) + SourceIndex(0) +24>Emitted(72, 93) Source(84, 66) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(73, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(73, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(73, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(73, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(73, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(73, 25) Source(85, 25) + SourceIndex(0) +7 >Emitted(73, 26) Source(85, 26) + SourceIndex(0) +8 >Emitted(73, 27) Source(85, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(74, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(74, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for ((_v = [2, "trimmer", "trimming"], numberA3 = _v[0], robotAInfo = _v.slice(1), _v), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 +9 > , +10> ...robotAInfo +11> ] = [2, "trimmer", "trimming"] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(75, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(75, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(75, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(75, 6) Source(87, 6) + SourceIndex(0) +5 >Emitted(75, 7) Source(87, 6) + SourceIndex(0) +6 >Emitted(75, 38) Source(87, 67) + SourceIndex(0) +7 >Emitted(75, 40) Source(87, 7) + SourceIndex(0) +8 >Emitted(75, 56) Source(87, 15) + SourceIndex(0) +9 >Emitted(75, 58) Source(87, 17) + SourceIndex(0) +10>Emitted(75, 82) Source(87, 30) + SourceIndex(0) +11>Emitted(75, 87) Source(87, 67) + SourceIndex(0) +12>Emitted(75, 89) Source(87, 69) + SourceIndex(0) +13>Emitted(75, 90) Source(87, 70) + SourceIndex(0) +14>Emitted(75, 93) Source(87, 73) + SourceIndex(0) +15>Emitted(75, 94) Source(87, 74) + SourceIndex(0) +16>Emitted(75, 96) Source(87, 76) + SourceIndex(0) +17>Emitted(75, 97) Source(87, 77) + SourceIndex(0) +18>Emitted(75, 100) Source(87, 80) + SourceIndex(0) +19>Emitted(75, 101) Source(87, 81) + SourceIndex(0) +20>Emitted(75, 103) Source(87, 83) + SourceIndex(0) +21>Emitted(75, 104) Source(87, 84) + SourceIndex(0) +22>Emitted(75, 106) Source(87, 86) + SourceIndex(0) +23>Emitted(75, 108) Source(87, 88) + SourceIndex(0) +24>Emitted(75, 109) Source(87, 89) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(76, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(76, 25) Source(88, 25) + SourceIndex(0) +7 >Emitted(76, 26) Source(88, 26) + SourceIndex(0) +8 >Emitted(76, 27) Source(88, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(77, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(77, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for ((multiRobotAInfo = multiRobotA.slice(0), multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > ...multiRobotAInfo +7 > ] = +8 > multiRobotA +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(78, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(78, 4) Source(90, 4) + SourceIndex(0) +3 >Emitted(78, 5) Source(90, 5) + SourceIndex(0) +4 >Emitted(78, 6) Source(90, 6) + SourceIndex(0) +5 >Emitted(78, 7) Source(90, 7) + SourceIndex(0) +6 >Emitted(78, 45) Source(90, 25) + SourceIndex(0) +7 >Emitted(78, 47) Source(90, 29) + SourceIndex(0) +8 >Emitted(78, 58) Source(90, 40) + SourceIndex(0) +9 >Emitted(78, 59) Source(90, 40) + SourceIndex(0) +10>Emitted(78, 61) Source(90, 42) + SourceIndex(0) +11>Emitted(78, 62) Source(90, 43) + SourceIndex(0) +12>Emitted(78, 65) Source(90, 46) + SourceIndex(0) +13>Emitted(78, 66) Source(90, 47) + SourceIndex(0) +14>Emitted(78, 68) Source(90, 49) + SourceIndex(0) +15>Emitted(78, 69) Source(90, 50) + SourceIndex(0) +16>Emitted(78, 72) Source(90, 53) + SourceIndex(0) +17>Emitted(78, 73) Source(90, 54) + SourceIndex(0) +18>Emitted(78, 75) Source(90, 56) + SourceIndex(0) +19>Emitted(78, 76) Source(90, 57) + SourceIndex(0) +20>Emitted(78, 78) Source(90, 59) + SourceIndex(0) +21>Emitted(78, 80) Source(90, 61) + SourceIndex(0) +22>Emitted(78, 81) Source(90, 62) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(79, 5) Source(91, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(91, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(91, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(91, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(91, 17) + SourceIndex(0) +6 >Emitted(79, 32) Source(91, 32) + SourceIndex(0) +7 >Emitted(79, 33) Source(91, 33) + SourceIndex(0) +8 >Emitted(79, 34) Source(91, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(80, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(80, 2) Source(92, 2) + SourceIndex(0) +--- +>>>for ((_w = getMultiRobot(), multiRobotAInfo = _w.slice(0), _w), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [...multiRobotAInfo] = getMultiRobot() +7 > +8 > ...multiRobotAInfo +9 > ] = getMultiRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(81, 1) Source(93, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(93, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(93, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(93, 6) + SourceIndex(0) +5 >Emitted(81, 7) Source(93, 6) + SourceIndex(0) +6 >Emitted(81, 27) Source(93, 44) + SourceIndex(0) +7 >Emitted(81, 29) Source(93, 7) + SourceIndex(0) +8 >Emitted(81, 58) Source(93, 25) + SourceIndex(0) +9 >Emitted(81, 63) Source(93, 44) + SourceIndex(0) +10>Emitted(81, 65) Source(93, 46) + SourceIndex(0) +11>Emitted(81, 66) Source(93, 47) + SourceIndex(0) +12>Emitted(81, 69) Source(93, 50) + SourceIndex(0) +13>Emitted(81, 70) Source(93, 51) + SourceIndex(0) +14>Emitted(81, 72) Source(93, 53) + SourceIndex(0) +15>Emitted(81, 73) Source(93, 54) + SourceIndex(0) +16>Emitted(81, 76) Source(93, 57) + SourceIndex(0) +17>Emitted(81, 77) Source(93, 58) + SourceIndex(0) +18>Emitted(81, 79) Source(93, 60) + SourceIndex(0) +19>Emitted(81, 80) Source(93, 61) + SourceIndex(0) +20>Emitted(81, 82) Source(93, 63) + SourceIndex(0) +21>Emitted(81, 84) Source(93, 65) + SourceIndex(0) +22>Emitted(81, 85) Source(93, 66) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(82, 5) Source(94, 5) + SourceIndex(0) +2 >Emitted(82, 12) Source(94, 12) + SourceIndex(0) +3 >Emitted(82, 13) Source(94, 13) + SourceIndex(0) +4 >Emitted(82, 16) Source(94, 16) + SourceIndex(0) +5 >Emitted(82, 17) Source(94, 17) + SourceIndex(0) +6 >Emitted(82, 32) Source(94, 32) + SourceIndex(0) +7 >Emitted(82, 33) Source(94, 33) + SourceIndex(0) +8 >Emitted(82, 34) Source(94, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(83, 1) Source(95, 1) + SourceIndex(0) +2 >Emitted(83, 2) Source(95, 2) + SourceIndex(0) +--- +>>>for ((_x = ["trimmer", ["trimming", "edging"]], multiRobotAInfo = _x.slice(0), _x), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] +7 > +8 > ...multiRobotAInfo +9 > ] = ["trimmer", ["trimming", "edging"]] +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(84, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(84, 4) Source(96, 4) + SourceIndex(0) +3 >Emitted(84, 5) Source(96, 5) + SourceIndex(0) +4 >Emitted(84, 6) Source(96, 6) + SourceIndex(0) +5 >Emitted(84, 7) Source(96, 6) + SourceIndex(0) +6 >Emitted(84, 47) Source(96, 83) + SourceIndex(0) +7 >Emitted(84, 49) Source(96, 7) + SourceIndex(0) +8 >Emitted(84, 78) Source(96, 25) + SourceIndex(0) +9 >Emitted(84, 83) Source(96, 83) + SourceIndex(0) +10>Emitted(84, 85) Source(96, 85) + SourceIndex(0) +11>Emitted(84, 86) Source(96, 86) + SourceIndex(0) +12>Emitted(84, 89) Source(96, 89) + SourceIndex(0) +13>Emitted(84, 90) Source(96, 90) + SourceIndex(0) +14>Emitted(84, 92) Source(96, 92) + SourceIndex(0) +15>Emitted(84, 93) Source(96, 93) + SourceIndex(0) +16>Emitted(84, 96) Source(96, 96) + SourceIndex(0) +17>Emitted(84, 97) Source(96, 97) + SourceIndex(0) +18>Emitted(84, 99) Source(96, 99) + SourceIndex(0) +19>Emitted(84, 100) Source(96, 100) + SourceIndex(0) +20>Emitted(84, 102) Source(96, 102) + SourceIndex(0) +21>Emitted(84, 104) Source(96, 104) + SourceIndex(0) +22>Emitted(84, 105) Source(96, 105) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(85, 5) Source(97, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(97, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(97, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(97, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(97, 17) + SourceIndex(0) +6 >Emitted(85, 32) Source(97, 32) + SourceIndex(0) +7 >Emitted(85, 33) Source(97, 33) + SourceIndex(0) +8 >Emitted(85, 34) Source(97, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(86, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(86, 2) Source(98, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.symbols new file mode 100644 index 00000000000..5c269a42043 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.symbols @@ -0,0 +1,390 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) + +let i: number; +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + +for ([, nameA] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 3)) +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 3)) +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 18, 20)) +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 21)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 17, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 19, 54)) +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 21)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 2, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 3)) +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 3, 38)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 21, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPattern2.ts, 20, 54)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types new file mode 100644 index 00000000000..a50f506262d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types @@ -0,0 +1,684 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, [string, string]] + + return multiRobotA; +>multiRobotA : [string, [string, string]] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +let i: number; +>i : number + +for ([, nameA] = robotA, i = 0; i < 1; i++) { +>[, nameA] = robotA, i = 0 : number +>[, nameA] = robotA : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { +>[, nameA] = getRobot(), i = 0 : number +>[, nameA] = getRobot() : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[, nameA] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>[, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] +>[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] +> : undefined +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>[, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] +>[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] +> : undefined +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] +> : undefined +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { +>[numberB] = robotA, i = 0 : number +>[numberB] = robotA : [number, string, string] +>[numberB] : [number] +>numberB : number +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { +>[numberB] = getRobot(), i = 0 : number +>[numberB] = getRobot() : [number, string, string] +>[numberB] : [number] +>numberB : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberB] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB] : [number] +>numberB : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { +>[nameB] = multiRobotA, i = 0 : number +>[nameB] = multiRobotA : [string, [string, string]] +>[nameB] : [string] +>nameB : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { +>[nameB] = getMultiRobot(), i = 0 : number +>[nameB] = getMultiRobot() : [string, [string, string]] +>[nameB] : [string] +>nameB : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[nameB] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameB] : [string] +>nameB : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +>[numberA2, nameA2, skillA2] = robotA, i = 0 : number +>[numberA2, nameA2, skillA2] = robotA : [number, string, string] +>[numberA2, nameA2, skillA2] : [number, string, string] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +>[numberA2, nameA2, skillA2] = getRobot(), i = 0 : number +>[numberA2, nameA2, skillA2] = getRobot() : [number, string, string] +>[numberA2, nameA2, skillA2] : [number, string, string] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA2, nameA2, skillA2] : [number, string, string] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +>[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] +>[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] +>nameMA : string +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +>[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] +>[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] +>nameMA : string +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] +>nameMA : string +>[primarySkillA, secondarySkillA] : [string, string] +>primarySkillA : string +>secondarySkillA : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>[numberA3, ...robotAInfo] = robotA, i = 0 : number +>[numberA3, ...robotAInfo] = robotA : [number, string, string] +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>[numberA3, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3, ...robotAInfo] = getRobot() : [number, string, string] +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +>[...multiRobotAInfo] = multiRobotA, i = 0 : number +>[...multiRobotAInfo] = multiRobotA : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +>[...multiRobotAInfo] = getMultiRobot(), i = 0 : number +>[...multiRobotAInfo] = getMultiRobot() : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..24701d01b08 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js @@ -0,0 +1,184 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +for (var _a = robotA[1], nameA = _a === void 0 ? "name" : _a, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (var _v = robotA[0], numberB = _v === void 0 ? -1 : _v, i = 0; i < 1; i++) { + console.log(numberB); +} +for (var _w = getRobot()[0], numberB = _w === void 0 ? -1 : _w, i = 0; i < 1; i++) { + console.log(numberB); +} +for (var _x = [2, "trimmer", "trimming"][0], numberB = _x === void 0 ? -1 : _x, i = 0; i < 1; i++) { + console.log(numberB); +} +for (var _y = multiRobotA[0], nameB = _y === void 0 ? "name" : _y, i = 0; i < 1; i++) { + console.log(nameB); +} +for (var _z = getMultiRobot()[0], nameB = _z === void 0 ? "name" : _z, i = 0; i < 1; i++) { + console.log(nameB); +} +for (var _0 = ["trimmer", ["trimming", "edging"]][0], nameB = _0 === void 0 ? "name" : _0, i = 0; i < 1; i++) { + console.log(nameB); +} +for (var _1 = robotA[0], numberA2 = _1 === void 0 ? -1 : _1, _2 = robotA[1], nameA2 = _2 === void 0 ? "name" : _2, _3 = robotA[2], skillA2 = _3 === void 0 ? "skill" : _3, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _4 = getRobot(), _5 = _4[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = _4[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = _4[2], skillA2 = _7 === void 0 ? "skill" : _7, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _8 = [2, "trimmer", "trimming"], _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _12 = multiRobotA[0], nameMA = _12 === void 0 ? "noName" : _12, _13 = multiRobotA[1], _14 = _13 === void 0 ? ["none", "none"] : _13, _15 = _14[0], primarySkillA = _15 === void 0 ? "primary" : _15, _16 = _14[1], secondarySkillA = _16 === void 0 ? "secondary" : _16, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _17 = getMultiRobot(), _18 = _17[0], nameMA = _18 === void 0 ? "noName" : _18, _19 = _17[1], _20 = _19 === void 0 ? ["none", "none"] : _19, _21 = _20[0], primarySkillA = _21 === void 0 ? "primary" : _21, _22 = _20[1], secondarySkillA = _22 === void 0 ? "secondary" : _22, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _23 = ["trimmer", ["trimming", "edging"]], _24 = _23[0], nameMA = _24 === void 0 ? "noName" : _24, _25 = _23[1], _26 = _25 === void 0 ? ["none", "none"] : _25, _27 = _26[0], primarySkillA = _27 === void 0 ? "primary" : _27, _28 = _26[1], secondarySkillA = _28 === void 0 ? "secondary" : _28, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (var _29 = robotA[0], numberA3 = _29 === void 0 ? -1 : _29, robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _30 = getRobot(), _31 = _30[0], numberA3 = _31 === void 0 ? -1 : _31, robotAInfo = _30.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (var _32 = [2, "trimmer", "trimming"], _33 = _32[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = _32.slice(1), i = 0; i < 1; i++) { + console.log(numberA3); +} +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..28053eaf603 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAQ,kBAAa,EAAb,mCAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAAmC,EAA5B,UAAc,EAAd,mCAAc,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAAmD,EAA5C,UAAc,EAAd,mCAAc,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAQ,uBAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAGkC,EAH3B,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,wCAGsD,EAH/C,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EAC4B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAM,kBAAY,EAAZ,iCAAY,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,sBAAY,EAAZ,iCAAY,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,sCAAY,EAAZ,iCAAY,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,uBAAc,EAAd,mCAAc,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAc,EAAd,mCAAc,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,+CAAc,EAAd,mCAAc,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAM,kBAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAAoE,EAA/D,UAAa,EAAb,kCAAa,EAAE,UAAe,EAAf,oCAAe,EAAE,UAAiB,EAAjB,sCAAiB,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+BAAoF,EAA/E,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CACC,wBAAiB,EAAjB,wCAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEpB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,qBAKe,EALV,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEf,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,yCAKmC,EAL9B,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAM,mBAAa,EAAb,oCAAa,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,gBAA+C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,gCAA+D,EAA1D,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..764825e68a2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,2752 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, string[]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>for (var _a = robotA[1], nameA = _a === void 0 ? "name" : _a, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let [, +5 > nameA ="name" +6 > +7 > nameA ="name" +8 > ] = robotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(18, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) +5 >Emitted(10, 24) Source(18, 26) + SourceIndex(0) +6 >Emitted(10, 26) Source(18, 13) + SourceIndex(0) +7 >Emitted(10, 61) Source(18, 26) + SourceIndex(0) +8 >Emitted(10, 63) Source(18, 38) + SourceIndex(0) +9 >Emitted(10, 64) Source(18, 39) + SourceIndex(0) +10>Emitted(10, 67) Source(18, 42) + SourceIndex(0) +11>Emitted(10, 68) Source(18, 43) + SourceIndex(0) +12>Emitted(10, 70) Source(18, 45) + SourceIndex(0) +13>Emitted(10, 71) Source(18, 46) + SourceIndex(0) +14>Emitted(10, 74) Source(18, 49) + SourceIndex(0) +15>Emitted(10, 75) Source(18, 50) + SourceIndex(0) +16>Emitted(10, 77) Source(18, 52) + SourceIndex(0) +17>Emitted(10, 78) Source(18, 53) + SourceIndex(0) +18>Emitted(10, 80) Source(18, 55) + SourceIndex(0) +19>Emitted(10, 82) Source(18, 57) + SourceIndex(0) +20>Emitted(10, 83) Source(18, 58) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(19, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(19, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(19, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) +--- +>>>for (var _b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA = "name"] = getRobot() +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 6) + SourceIndex(0) +5 >Emitted(13, 10) Source(21, 6) + SourceIndex(0) +6 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) +7 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) +8 >Emitted(13, 37) Source(21, 27) + SourceIndex(0) +9 >Emitted(13, 39) Source(21, 13) + SourceIndex(0) +10>Emitted(13, 74) Source(21, 27) + SourceIndex(0) +11>Emitted(13, 76) Source(21, 43) + SourceIndex(0) +12>Emitted(13, 77) Source(21, 44) + SourceIndex(0) +13>Emitted(13, 80) Source(21, 47) + SourceIndex(0) +14>Emitted(13, 81) Source(21, 48) + SourceIndex(0) +15>Emitted(13, 83) Source(21, 50) + SourceIndex(0) +16>Emitted(13, 84) Source(21, 51) + SourceIndex(0) +17>Emitted(13, 87) Source(21, 54) + SourceIndex(0) +18>Emitted(13, 88) Source(21, 55) + SourceIndex(0) +19>Emitted(13, 90) Source(21, 57) + SourceIndex(0) +20>Emitted(13, 91) Source(21, 58) + SourceIndex(0) +21>Emitted(13, 93) Source(21, 60) + SourceIndex(0) +22>Emitted(13, 95) Source(21, 62) + SourceIndex(0) +23>Emitted(13, 96) Source(21, 63) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, nameA = "name"] = [2, "trimmer", "trimming"] +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = [2, "trimmer", "trimming"], +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(16, 10) Source(24, 6) + SourceIndex(0) +6 >Emitted(16, 41) Source(24, 57) + SourceIndex(0) +7 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) +8 >Emitted(16, 53) Source(24, 27) + SourceIndex(0) +9 >Emitted(16, 55) Source(24, 13) + SourceIndex(0) +10>Emitted(16, 90) Source(24, 27) + SourceIndex(0) +11>Emitted(16, 92) Source(24, 59) + SourceIndex(0) +12>Emitted(16, 93) Source(24, 60) + SourceIndex(0) +13>Emitted(16, 96) Source(24, 63) + SourceIndex(0) +14>Emitted(16, 97) Source(24, 64) + SourceIndex(0) +15>Emitted(16, 99) Source(24, 66) + SourceIndex(0) +16>Emitted(16, 100) Source(24, 67) + SourceIndex(0) +17>Emitted(16, 103) Source(24, 70) + SourceIndex(0) +18>Emitted(16, 104) Source(24, 71) + SourceIndex(0) +19>Emitted(16, 106) Source(24, 73) + SourceIndex(0) +20>Emitted(16, 107) Source(24, 74) + SourceIndex(0) +21>Emitted(16, 109) Source(24, 76) + SourceIndex(0) +22>Emitted(16, 111) Source(24, 78) + SourceIndex(0) +23>Emitted(16, 112) Source(24, 79) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(17, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(17, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(17, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(17, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(17, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(17, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(17, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(17, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(18, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let [, +5 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +6 > +7 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +8 > +9 > primarySkillA = "primary" +10> +11> primarySkillA = "primary" +12> , + > +13> secondarySkillA = "secondary" +14> +15> secondarySkillA = "secondary" +16> + > ] = ["none", "none"]] = multiRobotA, +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) +5 >Emitted(19, 29) Source(30, 21) + SourceIndex(0) +6 >Emitted(19, 31) Source(27, 13) + SourceIndex(0) +7 >Emitted(19, 73) Source(30, 21) + SourceIndex(0) +8 >Emitted(19, 75) Source(28, 5) + SourceIndex(0) +9 >Emitted(19, 85) Source(28, 30) + SourceIndex(0) +10>Emitted(19, 87) Source(28, 5) + SourceIndex(0) +11>Emitted(19, 133) Source(28, 30) + SourceIndex(0) +12>Emitted(19, 135) Source(29, 5) + SourceIndex(0) +13>Emitted(19, 145) Source(29, 34) + SourceIndex(0) +14>Emitted(19, 147) Source(29, 5) + SourceIndex(0) +15>Emitted(19, 197) Source(29, 34) + SourceIndex(0) +16>Emitted(19, 199) Source(30, 38) + SourceIndex(0) +17>Emitted(19, 200) Source(30, 39) + SourceIndex(0) +18>Emitted(19, 203) Source(30, 42) + SourceIndex(0) +19>Emitted(19, 204) Source(30, 43) + SourceIndex(0) +20>Emitted(19, 206) Source(30, 45) + SourceIndex(0) +21>Emitted(19, 207) Source(30, 46) + SourceIndex(0) +22>Emitted(19, 210) Source(30, 49) + SourceIndex(0) +23>Emitted(19, 211) Source(30, 50) + SourceIndex(0) +24>Emitted(19, 213) Source(30, 52) + SourceIndex(0) +25>Emitted(19, 214) Source(30, 53) + SourceIndex(0) +26>Emitted(19, 216) Source(30, 55) + SourceIndex(0) +27>Emitted(19, 218) Source(30, 57) + SourceIndex(0) +28>Emitted(19, 219) Source(30, 58) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(20, 30) Source(31, 30) + SourceIndex(0) +7 >Emitted(20, 31) Source(31, 31) + SourceIndex(0) +8 >Emitted(20, 32) Source(31, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(21, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(21, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for (var _k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = getMultiRobot() +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = getMultiRobot(), +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(22, 10) Source(33, 6) + SourceIndex(0) +6 >Emitted(22, 30) Source(36, 40) + SourceIndex(0) +7 >Emitted(22, 32) Source(33, 13) + SourceIndex(0) +8 >Emitted(22, 42) Source(36, 21) + SourceIndex(0) +9 >Emitted(22, 44) Source(33, 13) + SourceIndex(0) +10>Emitted(22, 86) Source(36, 21) + SourceIndex(0) +11>Emitted(22, 88) Source(34, 5) + SourceIndex(0) +12>Emitted(22, 98) Source(34, 30) + SourceIndex(0) +13>Emitted(22, 100) Source(34, 5) + SourceIndex(0) +14>Emitted(22, 146) Source(34, 30) + SourceIndex(0) +15>Emitted(22, 148) Source(35, 5) + SourceIndex(0) +16>Emitted(22, 158) Source(35, 34) + SourceIndex(0) +17>Emitted(22, 160) Source(35, 5) + SourceIndex(0) +18>Emitted(22, 210) Source(35, 34) + SourceIndex(0) +19>Emitted(22, 212) Source(36, 42) + SourceIndex(0) +20>Emitted(22, 213) Source(36, 43) + SourceIndex(0) +21>Emitted(22, 216) Source(36, 46) + SourceIndex(0) +22>Emitted(22, 217) Source(36, 47) + SourceIndex(0) +23>Emitted(22, 219) Source(36, 49) + SourceIndex(0) +24>Emitted(22, 220) Source(36, 50) + SourceIndex(0) +25>Emitted(22, 223) Source(36, 53) + SourceIndex(0) +26>Emitted(22, 224) Source(36, 54) + SourceIndex(0) +27>Emitted(22, 226) Source(36, 56) + SourceIndex(0) +28>Emitted(22, 227) Source(36, 57) + SourceIndex(0) +29>Emitted(22, 229) Source(36, 59) + SourceIndex(0) +30>Emitted(22, 231) Source(36, 61) + SourceIndex(0) +31>Emitted(22, 232) Source(36, 62) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(23, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(23, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(23, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(24, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(24, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for (var _q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(25, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(39, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(39, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(39, 6) + SourceIndex(0) +5 >Emitted(25, 10) Source(39, 6) + SourceIndex(0) +6 >Emitted(25, 50) Source(42, 60) + SourceIndex(0) +7 >Emitted(25, 52) Source(39, 13) + SourceIndex(0) +8 >Emitted(25, 62) Source(42, 21) + SourceIndex(0) +9 >Emitted(25, 64) Source(39, 13) + SourceIndex(0) +10>Emitted(25, 106) Source(42, 21) + SourceIndex(0) +11>Emitted(25, 108) Source(40, 5) + SourceIndex(0) +12>Emitted(25, 118) Source(40, 30) + SourceIndex(0) +13>Emitted(25, 120) Source(40, 5) + SourceIndex(0) +14>Emitted(25, 166) Source(40, 30) + SourceIndex(0) +15>Emitted(25, 168) Source(41, 5) + SourceIndex(0) +16>Emitted(25, 178) Source(41, 34) + SourceIndex(0) +17>Emitted(25, 180) Source(41, 5) + SourceIndex(0) +18>Emitted(25, 230) Source(41, 34) + SourceIndex(0) +19>Emitted(25, 232) Source(42, 62) + SourceIndex(0) +20>Emitted(25, 233) Source(42, 63) + SourceIndex(0) +21>Emitted(25, 236) Source(42, 66) + SourceIndex(0) +22>Emitted(25, 237) Source(42, 67) + SourceIndex(0) +23>Emitted(25, 239) Source(42, 69) + SourceIndex(0) +24>Emitted(25, 240) Source(42, 70) + SourceIndex(0) +25>Emitted(25, 243) Source(42, 73) + SourceIndex(0) +26>Emitted(25, 244) Source(42, 74) + SourceIndex(0) +27>Emitted(25, 246) Source(42, 76) + SourceIndex(0) +28>Emitted(25, 247) Source(42, 77) + SourceIndex(0) +29>Emitted(25, 249) Source(42, 79) + SourceIndex(0) +30>Emitted(25, 251) Source(42, 81) + SourceIndex(0) +31>Emitted(25, 252) Source(42, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(43, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(43, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(43, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(43, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(43, 17) + SourceIndex(0) +6 >Emitted(26, 30) Source(43, 30) + SourceIndex(0) +7 >Emitted(26, 31) Source(43, 31) + SourceIndex(0) +8 >Emitted(26, 32) Source(43, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(27, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(27, 2) Source(44, 2) + SourceIndex(0) +--- +>>>for (var _v = robotA[0], numberB = _v === void 0 ? -1 : _v, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = robotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(28, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(46, 11) + SourceIndex(0) +5 >Emitted(28, 24) Source(46, 23) + SourceIndex(0) +6 >Emitted(28, 26) Source(46, 11) + SourceIndex(0) +7 >Emitted(28, 59) Source(46, 23) + SourceIndex(0) +8 >Emitted(28, 61) Source(46, 35) + SourceIndex(0) +9 >Emitted(28, 62) Source(46, 36) + SourceIndex(0) +10>Emitted(28, 65) Source(46, 39) + SourceIndex(0) +11>Emitted(28, 66) Source(46, 40) + SourceIndex(0) +12>Emitted(28, 68) Source(46, 42) + SourceIndex(0) +13>Emitted(28, 69) Source(46, 43) + SourceIndex(0) +14>Emitted(28, 72) Source(46, 46) + SourceIndex(0) +15>Emitted(28, 73) Source(46, 47) + SourceIndex(0) +16>Emitted(28, 75) Source(46, 49) + SourceIndex(0) +17>Emitted(28, 76) Source(46, 50) + SourceIndex(0) +18>Emitted(28, 78) Source(46, 52) + SourceIndex(0) +19>Emitted(28, 80) Source(46, 54) + SourceIndex(0) +20>Emitted(28, 81) Source(46, 55) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(29, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(29, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(29, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(29, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(29, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(29, 24) Source(47, 24) + SourceIndex(0) +7 >Emitted(29, 25) Source(47, 25) + SourceIndex(0) +8 >Emitted(29, 26) Source(47, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(30, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(30, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var _w = getRobot()[0], numberB = _w === void 0 ? -1 : _w, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(31, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(31, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(31, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(31, 6) Source(49, 11) + SourceIndex(0) +5 >Emitted(31, 28) Source(49, 23) + SourceIndex(0) +6 >Emitted(31, 30) Source(49, 11) + SourceIndex(0) +7 >Emitted(31, 63) Source(49, 23) + SourceIndex(0) +8 >Emitted(31, 65) Source(49, 39) + SourceIndex(0) +9 >Emitted(31, 66) Source(49, 40) + SourceIndex(0) +10>Emitted(31, 69) Source(49, 43) + SourceIndex(0) +11>Emitted(31, 70) Source(49, 44) + SourceIndex(0) +12>Emitted(31, 72) Source(49, 46) + SourceIndex(0) +13>Emitted(31, 73) Source(49, 47) + SourceIndex(0) +14>Emitted(31, 76) Source(49, 50) + SourceIndex(0) +15>Emitted(31, 77) Source(49, 51) + SourceIndex(0) +16>Emitted(31, 79) Source(49, 53) + SourceIndex(0) +17>Emitted(31, 80) Source(49, 54) + SourceIndex(0) +18>Emitted(31, 82) Source(49, 56) + SourceIndex(0) +19>Emitted(31, 84) Source(49, 58) + SourceIndex(0) +20>Emitted(31, 85) Source(49, 59) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(32, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(32, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(32, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(32, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(32, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(32, 24) Source(50, 24) + SourceIndex(0) +7 >Emitted(32, 25) Source(50, 25) + SourceIndex(0) +8 >Emitted(32, 26) Source(50, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(33, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(33, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _x = [2, "trimmer", "trimming"][0], numberB = _x === void 0 ? -1 : _x, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = [2, "trimmer", "trimming"], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(34, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(34, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(34, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(34, 6) Source(52, 11) + SourceIndex(0) +5 >Emitted(34, 44) Source(52, 23) + SourceIndex(0) +6 >Emitted(34, 46) Source(52, 11) + SourceIndex(0) +7 >Emitted(34, 79) Source(52, 23) + SourceIndex(0) +8 >Emitted(34, 81) Source(52, 55) + SourceIndex(0) +9 >Emitted(34, 82) Source(52, 56) + SourceIndex(0) +10>Emitted(34, 85) Source(52, 59) + SourceIndex(0) +11>Emitted(34, 86) Source(52, 60) + SourceIndex(0) +12>Emitted(34, 88) Source(52, 62) + SourceIndex(0) +13>Emitted(34, 89) Source(52, 63) + SourceIndex(0) +14>Emitted(34, 92) Source(52, 66) + SourceIndex(0) +15>Emitted(34, 93) Source(52, 67) + SourceIndex(0) +16>Emitted(34, 95) Source(52, 69) + SourceIndex(0) +17>Emitted(34, 96) Source(52, 70) + SourceIndex(0) +18>Emitted(34, 98) Source(52, 72) + SourceIndex(0) +19>Emitted(34, 100) Source(52, 74) + SourceIndex(0) +20>Emitted(34, 101) Source(52, 75) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(35, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(35, 24) Source(53, 24) + SourceIndex(0) +7 >Emitted(35, 25) Source(53, 25) + SourceIndex(0) +8 >Emitted(35, 26) Source(53, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(36, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(36, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _y = multiRobotA[0], nameB = _y === void 0 ? "name" : _y, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = multiRobotA, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(37, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(55, 11) + SourceIndex(0) +5 >Emitted(37, 29) Source(55, 25) + SourceIndex(0) +6 >Emitted(37, 31) Source(55, 11) + SourceIndex(0) +7 >Emitted(37, 66) Source(55, 25) + SourceIndex(0) +8 >Emitted(37, 68) Source(55, 42) + SourceIndex(0) +9 >Emitted(37, 69) Source(55, 43) + SourceIndex(0) +10>Emitted(37, 72) Source(55, 46) + SourceIndex(0) +11>Emitted(37, 73) Source(55, 47) + SourceIndex(0) +12>Emitted(37, 75) Source(55, 49) + SourceIndex(0) +13>Emitted(37, 76) Source(55, 50) + SourceIndex(0) +14>Emitted(37, 79) Source(55, 53) + SourceIndex(0) +15>Emitted(37, 80) Source(55, 54) + SourceIndex(0) +16>Emitted(37, 82) Source(55, 56) + SourceIndex(0) +17>Emitted(37, 83) Source(55, 57) + SourceIndex(0) +18>Emitted(37, 85) Source(55, 59) + SourceIndex(0) +19>Emitted(37, 87) Source(55, 61) + SourceIndex(0) +20>Emitted(37, 88) Source(55, 62) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(38, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(38, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(38, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(38, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(38, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(38, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(38, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(38, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(39, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(39, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _z = getMultiRobot()[0], nameB = _z === void 0 ? "name" : _z, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = getMultiRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(40, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(40, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(40, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(40, 6) Source(58, 11) + SourceIndex(0) +5 >Emitted(40, 33) Source(58, 25) + SourceIndex(0) +6 >Emitted(40, 35) Source(58, 11) + SourceIndex(0) +7 >Emitted(40, 70) Source(58, 25) + SourceIndex(0) +8 >Emitted(40, 72) Source(58, 46) + SourceIndex(0) +9 >Emitted(40, 73) Source(58, 47) + SourceIndex(0) +10>Emitted(40, 76) Source(58, 50) + SourceIndex(0) +11>Emitted(40, 77) Source(58, 51) + SourceIndex(0) +12>Emitted(40, 79) Source(58, 53) + SourceIndex(0) +13>Emitted(40, 80) Source(58, 54) + SourceIndex(0) +14>Emitted(40, 83) Source(58, 57) + SourceIndex(0) +15>Emitted(40, 84) Source(58, 58) + SourceIndex(0) +16>Emitted(40, 86) Source(58, 60) + SourceIndex(0) +17>Emitted(40, 87) Source(58, 61) + SourceIndex(0) +18>Emitted(40, 89) Source(58, 63) + SourceIndex(0) +19>Emitted(40, 91) Source(58, 65) + SourceIndex(0) +20>Emitted(40, 92) Source(58, 66) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(41, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(42, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(42, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for (var _0 = ["trimmer", ["trimming", "edging"]][0], nameB = _0 === void 0 ? "name" : _0, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let [ +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = ["trimmer", ["trimming", "edging"]], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(43, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(61, 11) + SourceIndex(0) +5 >Emitted(43, 53) Source(61, 25) + SourceIndex(0) +6 >Emitted(43, 55) Source(61, 11) + SourceIndex(0) +7 >Emitted(43, 90) Source(61, 25) + SourceIndex(0) +8 >Emitted(43, 92) Source(61, 66) + SourceIndex(0) +9 >Emitted(43, 93) Source(61, 67) + SourceIndex(0) +10>Emitted(43, 96) Source(61, 70) + SourceIndex(0) +11>Emitted(43, 97) Source(61, 71) + SourceIndex(0) +12>Emitted(43, 99) Source(61, 73) + SourceIndex(0) +13>Emitted(43, 100) Source(61, 74) + SourceIndex(0) +14>Emitted(43, 103) Source(61, 77) + SourceIndex(0) +15>Emitted(43, 104) Source(61, 78) + SourceIndex(0) +16>Emitted(43, 106) Source(61, 80) + SourceIndex(0) +17>Emitted(43, 107) Source(61, 81) + SourceIndex(0) +18>Emitted(43, 109) Source(61, 83) + SourceIndex(0) +19>Emitted(43, 111) Source(61, 85) + SourceIndex(0) +20>Emitted(43, 112) Source(61, 86) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(44, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(44, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(44, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(44, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(44, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(44, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(44, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(44, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(45, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(45, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _1 = robotA[0], numberA2 = _1 === void 0 ? -1 : _1, _2 = robotA[1], nameA2 = _2 === void 0 ? "name" : _2, _3 = robotA[2], skillA2 = _3 === void 0 ? "skill" : _3, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA2 = -1 +6 > +7 > numberA2 = -1 +8 > , +9 > nameA2 = "name" +10> +11> nameA2 = "name" +12> , +13> skillA2 = "skill" +14> +15> skillA2 = "skill" +16> ] = robotA, +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(46, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(46, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(46, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(46, 6) Source(65, 11) + SourceIndex(0) +5 >Emitted(46, 24) Source(65, 24) + SourceIndex(0) +6 >Emitted(46, 26) Source(65, 11) + SourceIndex(0) +7 >Emitted(46, 60) Source(65, 24) + SourceIndex(0) +8 >Emitted(46, 62) Source(65, 26) + SourceIndex(0) +9 >Emitted(46, 76) Source(65, 41) + SourceIndex(0) +10>Emitted(46, 78) Source(65, 26) + SourceIndex(0) +11>Emitted(46, 114) Source(65, 41) + SourceIndex(0) +12>Emitted(46, 116) Source(65, 43) + SourceIndex(0) +13>Emitted(46, 130) Source(65, 60) + SourceIndex(0) +14>Emitted(46, 132) Source(65, 43) + SourceIndex(0) +15>Emitted(46, 170) Source(65, 60) + SourceIndex(0) +16>Emitted(46, 172) Source(65, 72) + SourceIndex(0) +17>Emitted(46, 173) Source(65, 73) + SourceIndex(0) +18>Emitted(46, 176) Source(65, 76) + SourceIndex(0) +19>Emitted(46, 177) Source(65, 77) + SourceIndex(0) +20>Emitted(46, 179) Source(65, 79) + SourceIndex(0) +21>Emitted(46, 180) Source(65, 80) + SourceIndex(0) +22>Emitted(46, 183) Source(65, 83) + SourceIndex(0) +23>Emitted(46, 184) Source(65, 84) + SourceIndex(0) +24>Emitted(46, 186) Source(65, 86) + SourceIndex(0) +25>Emitted(46, 187) Source(65, 87) + SourceIndex(0) +26>Emitted(46, 189) Source(65, 89) + SourceIndex(0) +27>Emitted(46, 191) Source(65, 91) + SourceIndex(0) +28>Emitted(46, 192) Source(65, 92) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(47, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(47, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(47, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(47, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for (var _4 = getRobot(), _5 = _4[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = _4[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = _4[2], skillA2 = _7 === void 0 ? "skill" : _7, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = getRobot(), +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(49, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(49, 10) Source(68, 6) + SourceIndex(0) +6 >Emitted(49, 25) Source(68, 74) + SourceIndex(0) +7 >Emitted(49, 27) Source(68, 11) + SourceIndex(0) +8 >Emitted(49, 37) Source(68, 24) + SourceIndex(0) +9 >Emitted(49, 39) Source(68, 11) + SourceIndex(0) +10>Emitted(49, 73) Source(68, 24) + SourceIndex(0) +11>Emitted(49, 75) Source(68, 26) + SourceIndex(0) +12>Emitted(49, 85) Source(68, 41) + SourceIndex(0) +13>Emitted(49, 87) Source(68, 26) + SourceIndex(0) +14>Emitted(49, 123) Source(68, 41) + SourceIndex(0) +15>Emitted(49, 125) Source(68, 43) + SourceIndex(0) +16>Emitted(49, 135) Source(68, 60) + SourceIndex(0) +17>Emitted(49, 137) Source(68, 43) + SourceIndex(0) +18>Emitted(49, 175) Source(68, 60) + SourceIndex(0) +19>Emitted(49, 177) Source(68, 76) + SourceIndex(0) +20>Emitted(49, 178) Source(68, 77) + SourceIndex(0) +21>Emitted(49, 181) Source(68, 80) + SourceIndex(0) +22>Emitted(49, 182) Source(68, 81) + SourceIndex(0) +23>Emitted(49, 184) Source(68, 83) + SourceIndex(0) +24>Emitted(49, 185) Source(68, 84) + SourceIndex(0) +25>Emitted(49, 188) Source(68, 87) + SourceIndex(0) +26>Emitted(49, 189) Source(68, 88) + SourceIndex(0) +27>Emitted(49, 191) Source(68, 90) + SourceIndex(0) +28>Emitted(49, 192) Source(68, 91) + SourceIndex(0) +29>Emitted(49, 194) Source(68, 93) + SourceIndex(0) +30>Emitted(49, 196) Source(68, 95) + SourceIndex(0) +31>Emitted(49, 197) Source(68, 96) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(50, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(50, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(50, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(50, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _8 = [2, "trimmer", "trimming"], _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ +31> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = [2, "trimmer", "trimming"], +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) +31> { +1->Emitted(52, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(52, 10) Source(71, 6) + SourceIndex(0) +6 >Emitted(52, 41) Source(71, 90) + SourceIndex(0) +7 >Emitted(52, 43) Source(71, 11) + SourceIndex(0) +8 >Emitted(52, 53) Source(71, 24) + SourceIndex(0) +9 >Emitted(52, 55) Source(71, 11) + SourceIndex(0) +10>Emitted(52, 89) Source(71, 24) + SourceIndex(0) +11>Emitted(52, 91) Source(71, 26) + SourceIndex(0) +12>Emitted(52, 102) Source(71, 41) + SourceIndex(0) +13>Emitted(52, 104) Source(71, 26) + SourceIndex(0) +14>Emitted(52, 142) Source(71, 41) + SourceIndex(0) +15>Emitted(52, 144) Source(71, 43) + SourceIndex(0) +16>Emitted(52, 155) Source(71, 60) + SourceIndex(0) +17>Emitted(52, 157) Source(71, 43) + SourceIndex(0) +18>Emitted(52, 197) Source(71, 60) + SourceIndex(0) +19>Emitted(52, 199) Source(71, 92) + SourceIndex(0) +20>Emitted(52, 200) Source(71, 93) + SourceIndex(0) +21>Emitted(52, 203) Source(71, 96) + SourceIndex(0) +22>Emitted(52, 204) Source(71, 97) + SourceIndex(0) +23>Emitted(52, 206) Source(71, 99) + SourceIndex(0) +24>Emitted(52, 207) Source(71, 100) + SourceIndex(0) +25>Emitted(52, 210) Source(71, 103) + SourceIndex(0) +26>Emitted(52, 211) Source(71, 104) + SourceIndex(0) +27>Emitted(52, 213) Source(71, 106) + SourceIndex(0) +28>Emitted(52, 214) Source(71, 107) + SourceIndex(0) +29>Emitted(52, 216) Source(71, 109) + SourceIndex(0) +30>Emitted(52, 218) Source(71, 111) + SourceIndex(0) +31>Emitted(52, 219) Source(71, 112) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(53, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(53, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(53, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(53, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var _12 = multiRobotA[0], nameMA = _12 === void 0 ? "noName" : _12, _13 = multiRobotA[1], _14 = _13 === void 0 ? ["none", "none"] : _13, _15 = _14[0], primarySkillA = _15 === void 0 ? "primary" : _15, _16 = _14[1], secondarySkillA = _16 === void 0 ? "secondary" : _16, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let + > [ +5 > nameMA = "noName" +6 > +7 > nameMA = "noName" +8 > , + > +9 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +10> +11> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +12> +13> primarySkillA = "primary" +14> +15> primarySkillA = "primary" +16> , + > +17> secondarySkillA = "secondary" +18> +19> secondarySkillA = "secondary" +20> + > ] = ["none", "none"] + > ] = multiRobotA, +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(55, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(75, 6) + SourceIndex(0) +5 >Emitted(55, 30) Source(75, 23) + SourceIndex(0) +6 >Emitted(55, 32) Source(75, 6) + SourceIndex(0) +7 >Emitted(55, 72) Source(75, 23) + SourceIndex(0) +8 >Emitted(55, 74) Source(76, 9) + SourceIndex(0) +9 >Emitted(55, 94) Source(79, 29) + SourceIndex(0) +10>Emitted(55, 96) Source(76, 9) + SourceIndex(0) +11>Emitted(55, 141) Source(79, 29) + SourceIndex(0) +12>Emitted(55, 143) Source(77, 13) + SourceIndex(0) +13>Emitted(55, 155) Source(77, 38) + SourceIndex(0) +14>Emitted(55, 157) Source(77, 13) + SourceIndex(0) +15>Emitted(55, 205) Source(77, 38) + SourceIndex(0) +16>Emitted(55, 207) Source(78, 13) + SourceIndex(0) +17>Emitted(55, 219) Source(78, 42) + SourceIndex(0) +18>Emitted(55, 221) Source(78, 13) + SourceIndex(0) +19>Emitted(55, 273) Source(78, 42) + SourceIndex(0) +20>Emitted(55, 275) Source(80, 22) + SourceIndex(0) +21>Emitted(55, 276) Source(80, 23) + SourceIndex(0) +22>Emitted(55, 279) Source(80, 26) + SourceIndex(0) +23>Emitted(55, 280) Source(80, 27) + SourceIndex(0) +24>Emitted(55, 282) Source(80, 29) + SourceIndex(0) +25>Emitted(55, 283) Source(80, 30) + SourceIndex(0) +26>Emitted(55, 286) Source(80, 33) + SourceIndex(0) +27>Emitted(55, 287) Source(80, 34) + SourceIndex(0) +28>Emitted(55, 289) Source(80, 36) + SourceIndex(0) +29>Emitted(55, 290) Source(80, 37) + SourceIndex(0) +30>Emitted(55, 292) Source(80, 39) + SourceIndex(0) +31>Emitted(55, 294) Source(80, 41) + SourceIndex(0) +32>Emitted(55, 295) Source(80, 42) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(81, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(81, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(81, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(81, 17) + SourceIndex(0) +6 >Emitted(56, 23) Source(81, 23) + SourceIndex(0) +7 >Emitted(56, 24) Source(81, 24) + SourceIndex(0) +8 >Emitted(56, 25) Source(81, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(82, 2) + SourceIndex(0) +--- +>>>for (var _17 = getMultiRobot(), _18 = _17[0], nameMA = _18 === void 0 ? "noName" : _18, _19 = _17[1], _20 = _19 === void 0 ? ["none", "none"] : _19, _21 = _20[0], primarySkillA = _21 === void 0 ? "primary" : _21, _22 = _20[1], secondarySkillA = _22 === void 0 ? "secondary" : _22, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = getMultiRobot() +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = getMultiRobot(), +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(58, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(83, 6) + SourceIndex(0) +5 >Emitted(58, 10) Source(83, 6) + SourceIndex(0) +6 >Emitted(58, 31) Source(88, 21) + SourceIndex(0) +7 >Emitted(58, 33) Source(83, 11) + SourceIndex(0) +8 >Emitted(58, 45) Source(83, 28) + SourceIndex(0) +9 >Emitted(58, 47) Source(83, 11) + SourceIndex(0) +10>Emitted(58, 87) Source(83, 28) + SourceIndex(0) +11>Emitted(58, 89) Source(84, 5) + SourceIndex(0) +12>Emitted(58, 101) Source(87, 25) + SourceIndex(0) +13>Emitted(58, 103) Source(84, 5) + SourceIndex(0) +14>Emitted(58, 148) Source(87, 25) + SourceIndex(0) +15>Emitted(58, 150) Source(85, 9) + SourceIndex(0) +16>Emitted(58, 162) Source(85, 34) + SourceIndex(0) +17>Emitted(58, 164) Source(85, 9) + SourceIndex(0) +18>Emitted(58, 212) Source(85, 34) + SourceIndex(0) +19>Emitted(58, 214) Source(86, 9) + SourceIndex(0) +20>Emitted(58, 226) Source(86, 38) + SourceIndex(0) +21>Emitted(58, 228) Source(86, 9) + SourceIndex(0) +22>Emitted(58, 280) Source(86, 38) + SourceIndex(0) +23>Emitted(58, 282) Source(88, 23) + SourceIndex(0) +24>Emitted(58, 283) Source(88, 24) + SourceIndex(0) +25>Emitted(58, 286) Source(88, 27) + SourceIndex(0) +26>Emitted(58, 287) Source(88, 28) + SourceIndex(0) +27>Emitted(58, 289) Source(88, 30) + SourceIndex(0) +28>Emitted(58, 290) Source(88, 31) + SourceIndex(0) +29>Emitted(58, 293) Source(88, 34) + SourceIndex(0) +30>Emitted(58, 294) Source(88, 35) + SourceIndex(0) +31>Emitted(58, 296) Source(88, 37) + SourceIndex(0) +32>Emitted(58, 297) Source(88, 38) + SourceIndex(0) +33>Emitted(58, 299) Source(88, 40) + SourceIndex(0) +34>Emitted(58, 301) Source(88, 42) + SourceIndex(0) +35>Emitted(58, 302) Source(88, 43) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(89, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(89, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(89, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(89, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(89, 17) + SourceIndex(0) +6 >Emitted(59, 23) Source(89, 23) + SourceIndex(0) +7 >Emitted(59, 24) Source(89, 24) + SourceIndex(0) +8 >Emitted(59, 25) Source(89, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(90, 2) + SourceIndex(0) +--- +>>>for (var _23 = ["trimmer", ["trimming", "edging"]], _24 = _23[0], nameMA = _24 === void 0 ? "noName" : _24, _25 = _23[1], _26 = _25 === void 0 ? ["none", "none"] : _25, _27 = _26[0], primarySkillA = _27 === void 0 ? "primary" : _27, _28 = _26[1], secondarySkillA = _28 === void 0 ? "secondary" : _28, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]], +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(61, 1) Source(91, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(91, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(91, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(91, 6) + SourceIndex(0) +5 >Emitted(61, 10) Source(91, 6) + SourceIndex(0) +6 >Emitted(61, 51) Source(96, 41) + SourceIndex(0) +7 >Emitted(61, 53) Source(91, 11) + SourceIndex(0) +8 >Emitted(61, 65) Source(91, 28) + SourceIndex(0) +9 >Emitted(61, 67) Source(91, 11) + SourceIndex(0) +10>Emitted(61, 107) Source(91, 28) + SourceIndex(0) +11>Emitted(61, 109) Source(92, 5) + SourceIndex(0) +12>Emitted(61, 121) Source(95, 25) + SourceIndex(0) +13>Emitted(61, 123) Source(92, 5) + SourceIndex(0) +14>Emitted(61, 168) Source(95, 25) + SourceIndex(0) +15>Emitted(61, 170) Source(93, 9) + SourceIndex(0) +16>Emitted(61, 182) Source(93, 34) + SourceIndex(0) +17>Emitted(61, 184) Source(93, 9) + SourceIndex(0) +18>Emitted(61, 232) Source(93, 34) + SourceIndex(0) +19>Emitted(61, 234) Source(94, 9) + SourceIndex(0) +20>Emitted(61, 246) Source(94, 38) + SourceIndex(0) +21>Emitted(61, 248) Source(94, 9) + SourceIndex(0) +22>Emitted(61, 300) Source(94, 38) + SourceIndex(0) +23>Emitted(61, 302) Source(96, 43) + SourceIndex(0) +24>Emitted(61, 303) Source(96, 44) + SourceIndex(0) +25>Emitted(61, 306) Source(96, 47) + SourceIndex(0) +26>Emitted(61, 307) Source(96, 48) + SourceIndex(0) +27>Emitted(61, 309) Source(96, 50) + SourceIndex(0) +28>Emitted(61, 310) Source(96, 51) + SourceIndex(0) +29>Emitted(61, 313) Source(96, 54) + SourceIndex(0) +30>Emitted(61, 314) Source(96, 55) + SourceIndex(0) +31>Emitted(61, 316) Source(96, 57) + SourceIndex(0) +32>Emitted(61, 317) Source(96, 58) + SourceIndex(0) +33>Emitted(61, 319) Source(96, 60) + SourceIndex(0) +34>Emitted(61, 321) Source(96, 62) + SourceIndex(0) +35>Emitted(61, 322) Source(96, 63) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(97, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(97, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(97, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(97, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(97, 17) + SourceIndex(0) +6 >Emitted(62, 23) Source(97, 23) + SourceIndex(0) +7 >Emitted(62, 24) Source(97, 24) + SourceIndex(0) +8 >Emitted(62, 25) Source(97, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(98, 2) + SourceIndex(0) +--- +>>>for (var _29 = robotA[0], numberA3 = _29 === void 0 ? -1 : _29, robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > (let [ +5 > numberA3 = -1 +6 > +7 > numberA3 = -1 +8 > , +9 > ...robotAInfo +10> ] = robotA, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(64, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(100, 11) + SourceIndex(0) +5 >Emitted(64, 25) Source(100, 24) + SourceIndex(0) +6 >Emitted(64, 27) Source(100, 11) + SourceIndex(0) +7 >Emitted(64, 63) Source(100, 24) + SourceIndex(0) +8 >Emitted(64, 65) Source(100, 26) + SourceIndex(0) +9 >Emitted(64, 93) Source(100, 39) + SourceIndex(0) +10>Emitted(64, 95) Source(100, 51) + SourceIndex(0) +11>Emitted(64, 96) Source(100, 52) + SourceIndex(0) +12>Emitted(64, 99) Source(100, 55) + SourceIndex(0) +13>Emitted(64, 100) Source(100, 56) + SourceIndex(0) +14>Emitted(64, 102) Source(100, 58) + SourceIndex(0) +15>Emitted(64, 103) Source(100, 59) + SourceIndex(0) +16>Emitted(64, 106) Source(100, 62) + SourceIndex(0) +17>Emitted(64, 107) Source(100, 63) + SourceIndex(0) +18>Emitted(64, 109) Source(100, 65) + SourceIndex(0) +19>Emitted(64, 110) Source(100, 66) + SourceIndex(0) +20>Emitted(64, 112) Source(100, 68) + SourceIndex(0) +21>Emitted(64, 114) Source(100, 70) + SourceIndex(0) +22>Emitted(64, 115) Source(100, 71) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(65, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(65, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(65, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(65, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(65, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(65, 25) Source(101, 25) + SourceIndex(0) +7 >Emitted(65, 26) Source(101, 26) + SourceIndex(0) +8 >Emitted(65, 27) Source(101, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(66, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(66, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for (var _30 = getRobot(), _31 = _30[0], numberA3 = _31 === void 0 ? -1 : _31, robotAInfo = _30.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3 = -1, ...robotAInfo] = getRobot() +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = getRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(67, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(67, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(67, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(67, 6) Source(103, 6) + SourceIndex(0) +5 >Emitted(67, 10) Source(103, 6) + SourceIndex(0) +6 >Emitted(67, 26) Source(103, 53) + SourceIndex(0) +7 >Emitted(67, 28) Source(103, 11) + SourceIndex(0) +8 >Emitted(67, 40) Source(103, 24) + SourceIndex(0) +9 >Emitted(67, 42) Source(103, 11) + SourceIndex(0) +10>Emitted(67, 78) Source(103, 24) + SourceIndex(0) +11>Emitted(67, 80) Source(103, 26) + SourceIndex(0) +12>Emitted(67, 105) Source(103, 39) + SourceIndex(0) +13>Emitted(67, 107) Source(103, 55) + SourceIndex(0) +14>Emitted(67, 108) Source(103, 56) + SourceIndex(0) +15>Emitted(67, 111) Source(103, 59) + SourceIndex(0) +16>Emitted(67, 112) Source(103, 60) + SourceIndex(0) +17>Emitted(67, 114) Source(103, 62) + SourceIndex(0) +18>Emitted(67, 115) Source(103, 63) + SourceIndex(0) +19>Emitted(67, 118) Source(103, 66) + SourceIndex(0) +20>Emitted(67, 119) Source(103, 67) + SourceIndex(0) +21>Emitted(67, 121) Source(103, 69) + SourceIndex(0) +22>Emitted(67, 122) Source(103, 70) + SourceIndex(0) +23>Emitted(67, 124) Source(103, 72) + SourceIndex(0) +24>Emitted(67, 126) Source(103, 74) + SourceIndex(0) +25>Emitted(67, 127) Source(103, 75) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(68, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(68, 25) Source(104, 25) + SourceIndex(0) +7 >Emitted(68, 26) Source(104, 26) + SourceIndex(0) +8 >Emitted(68, 27) Source(104, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(69, 1) Source(105, 1) + SourceIndex(0) +2 >Emitted(69, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for (var _32 = [2, "trimmer", "trimming"], _33 = _32[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = _32.slice(1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ +25> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = [2, "trimmer", "trimming"], +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) +25> { +1->Emitted(70, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(70, 10) Source(106, 6) + SourceIndex(0) +6 >Emitted(70, 42) Source(106, 69) + SourceIndex(0) +7 >Emitted(70, 44) Source(106, 11) + SourceIndex(0) +8 >Emitted(70, 56) Source(106, 24) + SourceIndex(0) +9 >Emitted(70, 58) Source(106, 11) + SourceIndex(0) +10>Emitted(70, 94) Source(106, 24) + SourceIndex(0) +11>Emitted(70, 96) Source(106, 26) + SourceIndex(0) +12>Emitted(70, 121) Source(106, 39) + SourceIndex(0) +13>Emitted(70, 123) Source(106, 71) + SourceIndex(0) +14>Emitted(70, 124) Source(106, 72) + SourceIndex(0) +15>Emitted(70, 127) Source(106, 75) + SourceIndex(0) +16>Emitted(70, 128) Source(106, 76) + SourceIndex(0) +17>Emitted(70, 130) Source(106, 78) + SourceIndex(0) +18>Emitted(70, 131) Source(106, 79) + SourceIndex(0) +19>Emitted(70, 134) Source(106, 82) + SourceIndex(0) +20>Emitted(70, 135) Source(106, 83) + SourceIndex(0) +21>Emitted(70, 137) Source(106, 85) + SourceIndex(0) +22>Emitted(70, 138) Source(106, 86) + SourceIndex(0) +23>Emitted(70, 140) Source(106, 88) + SourceIndex(0) +24>Emitted(70, 142) Source(106, 90) + SourceIndex(0) +25>Emitted(70, 143) Source(106, 91) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(107, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(107, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(107, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(71, 25) Source(107, 25) + SourceIndex(0) +7 >Emitted(71, 26) Source(107, 26) + SourceIndex(0) +8 >Emitted(71, 27) Source(107, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(72, 1) Source(108, 1) + SourceIndex(0) +2 >Emitted(72, 2) Source(108, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..523cde331fc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,367 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 2, 1)) + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 36)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 17, 11)) +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 11)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 41)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 20, 11)) +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 11)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 57)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 57)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 57)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 23, 11)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 26, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 27, 30)) + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 29, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 29, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 29, 36)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 26, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 32, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 33, 30)) + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 35, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 35, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 35, 40)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 32, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 38, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 39, 30)) + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 41, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 41, 60)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 41, 60)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 38, 13)) +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 33)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 33)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 33)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 45, 10)) +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 37)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 48, 10)) +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 53)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 51, 10)) +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 40)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 40)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 54, 10)) +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 10)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 44)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 44)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 57, 10)) +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 10)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 64)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 64)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 60, 10)) +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 41)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 70)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 70)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 64, 24)) +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 41)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 74)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 74)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 74)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 67, 24)) +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 90)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 70, 24)) +} +for (let + [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 74, 5)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 75, 9)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 76, 38)) + + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 79, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 79, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 79, 20)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 74, 5)) +} +for (let [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 82, 10)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 83, 5)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 84, 34)) + + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 87, 21)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 87, 21)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 87, 21)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 82, 10)) +} +for (let [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 90, 10)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 91, 5)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 92, 34)) + + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 95, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 95, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 95, 41)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 90, 10)) +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 24)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 49)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 49)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 49)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 99, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 24)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 53)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 53)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 102, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 24)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 69)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 69)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 69)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts, 105, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..245328296eb --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types @@ -0,0 +1,599 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : [string, string[]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["mower", ["mowing", ""]] : [string, string[]] +>"mower" : string +>["mowing", ""] : string[] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, string[]] + + return multiRobotA; +>multiRobotA : [string, string[]] +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { +> : undefined +>nameA : string +>"name" : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +> : undefined +>nameA : string +>"name" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +> : undefined +>nameA : string +>"name" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>multiRobotA : [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>getMultiRobot() : [string, string[]] +>getMultiRobot : () => [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { +>numberB : number +>-1 : number +>1 : number +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>numberB : number +>-1 : number +>1 : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : number +>-1 : number +>1 : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>nameB : string +>"name" : string +>multiRobotA : [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : string +>"name" : string +>getMultiRobot() : [string, string[]] +>getMultiRobot : () => [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : string +>"name" : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let + [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : [string, string[]] +>getMultiRobot : () => [string, string[]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : number | string +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : (number | string)[] +>2 : number +>"trimmer" : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number | string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..fb2fa4f81f8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js @@ -0,0 +1,196 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js] +var robotA = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +var i; +for ((_a = robotA[1], nameA = _a === void 0 ? "name" : _a, robotA), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, _d), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, multiRobotA), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, _q), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ((_v = robotA[0], numberB = _v === void 0 ? -1 : _v, robotA), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_w = getRobot(), _x = _w[0], numberB = _x === void 0 ? -1 : _x, _w), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_y = [2, "trimmer", "trimming"], _z = _y[0], numberB = _z === void 0 ? -1 : _z, _y), i = 0; i < 1; i++) { + console.log(numberB); +} +for ((_0 = multiRobotA[0], nameB = _0 === void 0 ? "name" : _0, multiRobotA), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_1 = getMultiRobot(), _2 = _1[0], nameB = _2 === void 0 ? "name" : _2, _1), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_3 = ["trimmer", ["trimming", "edging"]], _4 = _3[0], nameB = _4 === void 0 ? "name" : _4, _3), i = 0; i < 1; i++) { + console.log(nameB); +} +for ((_5 = robotA[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = robotA[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = robotA[2], skillA2 = _7 === void 0 ? "skill" : _7, robotA), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_8 = getRobot(), _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, _8), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ((_12 = [2, "trimmer", "trimming"], _13 = _12[0], numberA2 = _13 === void 0 ? -1 : _13, _14 = _12[1], nameA2 = _14 === void 0 ? "name" : _14, _15 = _12[2], skillA2 = _15 === void 0 ? "skill" : _15, _12), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (var _16 = multiRobotA[0], nameMA_1 = _16 === void 0 ? "noName" : _16, _17 = multiRobotA[1], _18 = _17 === void 0 ? ["none", "none"] : _17, _19 = _18[0], primarySkillA_1 = _19 === void 0 ? "primary" : _19, _20 = _18[1], secondarySkillA_1 = _20 === void 0 ? "secondary" : _20, i_1 = 0; i_1 < 1; i_1++) { + console.log(nameMA_1); +} +for ((_21 = getMultiRobot(), _22 = _21[0], nameMA = _22 === void 0 ? "noName" : _22, _23 = _21[1], _24 = _23 === void 0 ? ["none", "none"] : _23, _25 = _24[0], primarySkillA = _25 === void 0 ? "primary" : _25, _26 = _24[1], secondarySkillA = _26 === void 0 ? "secondary" : _26, _21), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_27 = ["trimmer", ["trimming", "edging"]], _28 = _27[0], nameMA = _28 === void 0 ? "noName" : _28, _29 = _27[1], _30 = _29 === void 0 ? ["none", "none"] : _29, _31 = _30[0], primarySkillA = _31 === void 0 ? "primary" : _31, _32 = _30[1], secondarySkillA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ((_33 = robotA[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_34 = getRobot(), _35 = _34[0], numberA3 = _35 === void 0 ? -1 : _35, robotAInfo = _34.slice(1), _34), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ((_36 = [2, "trimmer", "trimming"], _37 = _36[0], numberA3 = _37 === void 0 ? -1 : _37, robotAInfo = _36.slice(1), _36), i = 0; i < 1; i++) { + console.log(numberA3); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37; +//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..6446d14319e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,GAAG,CAAC,CAAC,CAAG,cAAc,EAAd,mCAAc,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA+B,EAA5B,UAAc,EAAd,mCAAc,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAA+C,EAA5C,UAAc,EAAd,mCAAc,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAG,mBAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACT,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAGkC,EAH/B,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,KACM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAGsD,EAHnD,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,KAC0B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,cAAY,EAAZ,iCAAY,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA2B,EAA1B,UAAY,EAAZ,iCAAY,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+BAA2C,EAA1C,UAAY,EAAZ,iCAAY,KAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,mBAAc,EAAd,mCAAc,EAAI,WAAW,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAkC,EAAjC,UAAc,EAAd,mCAAc,KAAmB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,wCAAsD,EAArD,UAAc,EAAd,mCAAc,KAAuC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,cAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAgE,EAA/D,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,KAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gCAAgF,EAA/E,YAAa,EAAb,oCAAa,EAAE,YAAe,EAAf,sCAAe,EAAE,YAAiB,EAAjB,wCAAiB,MAA8B,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CACC,wBAAiB,EAAjB,0CAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,kDAAyB,EACzB,YAA6B,EAA7B,sDAA6B,EAEpB,GAAC,GAAG,CAAC,EAAE,GAAC,GAAG,CAAC,EAAE,GAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,qBAKc,EALb,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,MAElB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,yCAKkC,EALjC,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,MAEE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAC,CAAC,eAAa,EAAb,oCAAa,EAAE,4BAAa,EAAI,MAAM,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gBAA2C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,MAAc,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gCAAkE,EAAjE,YAAa,EAAb,oCAAa,EAAE,yBAAa,MAAqC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..bab5f369194 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,3030 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0) +--- +>>> return robotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robotA +5 > ; +1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) +2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(10, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +4 >Emitted(5, 19) Source(12, 38) + SourceIndex(0) +5 >Emitted(5, 20) Source(12, 39) + SourceIndex(0) +6 >Emitted(5, 27) Source(12, 46) + SourceIndex(0) +7 >Emitted(5, 29) Source(12, 48) + SourceIndex(0) +8 >Emitted(5, 30) Source(12, 49) + SourceIndex(0) +9 >Emitted(5, 38) Source(12, 57) + SourceIndex(0) +10>Emitted(5, 40) Source(12, 59) + SourceIndex(0) +11>Emitted(5, 42) Source(12, 61) + SourceIndex(0) +12>Emitted(5, 43) Source(12, 62) + SourceIndex(0) +13>Emitted(5, 44) Source(12, 63) + SourceIndex(0) +14>Emitted(5, 45) Source(12, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(13, 38) + SourceIndex(0) +5 >Emitted(6, 20) Source(13, 39) + SourceIndex(0) +6 >Emitted(6, 29) Source(13, 48) + SourceIndex(0) +7 >Emitted(6, 31) Source(13, 50) + SourceIndex(0) +8 >Emitted(6, 32) Source(13, 51) + SourceIndex(0) +9 >Emitted(6, 42) Source(13, 61) + SourceIndex(0) +10>Emitted(6, 44) Source(13, 63) + SourceIndex(0) +11>Emitted(6, 52) Source(13, 71) + SourceIndex(0) +12>Emitted(6, 53) Source(13, 72) + SourceIndex(0) +13>Emitted(6, 54) Source(13, 73) + SourceIndex(0) +14>Emitted(6, 55) Source(13, 74) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +--- +>>> return multiRobotA; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobotA +5 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(18, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(18, 20) + SourceIndex(0) +5 >Emitted(10, 25) Source(18, 41) + SourceIndex(0) +6 >Emitted(10, 27) Source(18, 43) + SourceIndex(0) +7 >Emitted(10, 42) Source(18, 66) + SourceIndex(0) +8 >Emitted(10, 43) Source(18, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(19, 5) + SourceIndex(0) +3 >Emitted(11, 12) Source(19, 20) + SourceIndex(0) +4 >Emitted(11, 14) Source(19, 22) + SourceIndex(0) +5 >Emitted(11, 19) Source(19, 35) + SourceIndex(0) +6 >Emitted(11, 20) Source(19, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(12, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(20, 5) + SourceIndex(0) +3 >Emitted(12, 13) Source(20, 21) + SourceIndex(0) +4 >Emitted(12, 15) Source(20, 23) + SourceIndex(0) +5 >Emitted(12, 21) Source(20, 37) + SourceIndex(0) +6 >Emitted(12, 23) Source(20, 39) + SourceIndex(0) +7 >Emitted(12, 30) Source(20, 54) + SourceIndex(0) +8 >Emitted(12, 32) Source(20, 56) + SourceIndex(0) +9 >Emitted(12, 38) Source(20, 70) + SourceIndex(0) +10>Emitted(12, 39) Source(20, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 13) Source(21, 21) + SourceIndex(0) +4 >Emitted(13, 15) Source(21, 23) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 54) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 56) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 102) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 103) + SourceIndex(0) +--- +>>>var i; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > i: number +4 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(22, 14) + SourceIndex(0) +4 >Emitted(14, 7) Source(22, 15) + SourceIndex(0) +--- +>>>for ((_a = robotA[1], nameA = _a === void 0 ? "name" : _a, robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [, +6 > nameA = "name" +7 > +8 > nameA = "name" +9 > ] = +10> robotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(24, 6) + SourceIndex(0) +5 >Emitted(15, 7) Source(24, 9) + SourceIndex(0) +6 >Emitted(15, 21) Source(24, 23) + SourceIndex(0) +7 >Emitted(15, 23) Source(24, 9) + SourceIndex(0) +8 >Emitted(15, 58) Source(24, 23) + SourceIndex(0) +9 >Emitted(15, 60) Source(24, 27) + SourceIndex(0) +10>Emitted(15, 66) Source(24, 33) + SourceIndex(0) +11>Emitted(15, 67) Source(24, 33) + SourceIndex(0) +12>Emitted(15, 69) Source(24, 35) + SourceIndex(0) +13>Emitted(15, 70) Source(24, 36) + SourceIndex(0) +14>Emitted(15, 73) Source(24, 39) + SourceIndex(0) +15>Emitted(15, 74) Source(24, 40) + SourceIndex(0) +16>Emitted(15, 76) Source(24, 42) + SourceIndex(0) +17>Emitted(15, 77) Source(24, 43) + SourceIndex(0) +18>Emitted(15, 80) Source(24, 46) + SourceIndex(0) +19>Emitted(15, 81) Source(24, 47) + SourceIndex(0) +20>Emitted(15, 83) Source(24, 49) + SourceIndex(0) +21>Emitted(15, 84) Source(24, 50) + SourceIndex(0) +22>Emitted(15, 86) Source(24, 52) + SourceIndex(0) +23>Emitted(15, 88) Source(24, 54) + SourceIndex(0) +24>Emitted(15, 89) Source(24, 55) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for ((_b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA = "name"] = getRobot() +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(18, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) +5 >Emitted(18, 7) Source(27, 6) + SourceIndex(0) +6 >Emitted(18, 22) Source(27, 37) + SourceIndex(0) +7 >Emitted(18, 24) Source(27, 9) + SourceIndex(0) +8 >Emitted(18, 34) Source(27, 23) + SourceIndex(0) +9 >Emitted(18, 36) Source(27, 9) + SourceIndex(0) +10>Emitted(18, 71) Source(27, 23) + SourceIndex(0) +11>Emitted(18, 76) Source(27, 37) + SourceIndex(0) +12>Emitted(18, 78) Source(27, 39) + SourceIndex(0) +13>Emitted(18, 79) Source(27, 40) + SourceIndex(0) +14>Emitted(18, 82) Source(27, 43) + SourceIndex(0) +15>Emitted(18, 83) Source(27, 44) + SourceIndex(0) +16>Emitted(18, 85) Source(27, 46) + SourceIndex(0) +17>Emitted(18, 86) Source(27, 47) + SourceIndex(0) +18>Emitted(18, 89) Source(27, 50) + SourceIndex(0) +19>Emitted(18, 90) Source(27, 51) + SourceIndex(0) +20>Emitted(18, 92) Source(27, 53) + SourceIndex(0) +21>Emitted(18, 93) Source(27, 54) + SourceIndex(0) +22>Emitted(18, 95) Source(27, 56) + SourceIndex(0) +23>Emitted(18, 97) Source(27, 58) + SourceIndex(0) +24>Emitted(18, 98) Source(27, 59) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for ((_d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, nameA = "name"] = [2, "trimmer", "trimming"] +7 > +8 > nameA = "name" +9 > +10> nameA = "name" +11> ] = [2, "trimmer", "trimming"] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(21, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) +5 >Emitted(21, 7) Source(30, 6) + SourceIndex(0) +6 >Emitted(21, 38) Source(30, 53) + SourceIndex(0) +7 >Emitted(21, 40) Source(30, 9) + SourceIndex(0) +8 >Emitted(21, 50) Source(30, 23) + SourceIndex(0) +9 >Emitted(21, 52) Source(30, 9) + SourceIndex(0) +10>Emitted(21, 87) Source(30, 23) + SourceIndex(0) +11>Emitted(21, 92) Source(30, 53) + SourceIndex(0) +12>Emitted(21, 94) Source(30, 55) + SourceIndex(0) +13>Emitted(21, 95) Source(30, 56) + SourceIndex(0) +14>Emitted(21, 98) Source(30, 59) + SourceIndex(0) +15>Emitted(21, 99) Source(30, 60) + SourceIndex(0) +16>Emitted(21, 101) Source(30, 62) + SourceIndex(0) +17>Emitted(21, 102) Source(30, 63) + SourceIndex(0) +18>Emitted(21, 105) Source(30, 66) + SourceIndex(0) +19>Emitted(21, 106) Source(30, 67) + SourceIndex(0) +20>Emitted(21, 108) Source(30, 69) + SourceIndex(0) +21>Emitted(21, 109) Source(30, 70) + SourceIndex(0) +22>Emitted(21, 111) Source(30, 72) + SourceIndex(0) +23>Emitted(21, 113) Source(30, 74) + SourceIndex(0) +24>Emitted(21, 114) Source(30, 75) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(31, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(31, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(31, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for ((_f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [, +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> primarySkillA = "primary" +11> +12> primarySkillA = "primary" +13> , + > +14> secondarySkillA = "secondary" +15> +16> secondarySkillA = "secondary" +17> + > ] = ["none", "none"]] = +18> multiRobotA +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(24, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(33, 6) + SourceIndex(0) +5 >Emitted(24, 7) Source(33, 9) + SourceIndex(0) +6 >Emitted(24, 26) Source(36, 21) + SourceIndex(0) +7 >Emitted(24, 28) Source(33, 9) + SourceIndex(0) +8 >Emitted(24, 70) Source(36, 21) + SourceIndex(0) +9 >Emitted(24, 72) Source(34, 5) + SourceIndex(0) +10>Emitted(24, 82) Source(34, 30) + SourceIndex(0) +11>Emitted(24, 84) Source(34, 5) + SourceIndex(0) +12>Emitted(24, 130) Source(34, 30) + SourceIndex(0) +13>Emitted(24, 132) Source(35, 5) + SourceIndex(0) +14>Emitted(24, 142) Source(35, 34) + SourceIndex(0) +15>Emitted(24, 144) Source(35, 5) + SourceIndex(0) +16>Emitted(24, 194) Source(35, 34) + SourceIndex(0) +17>Emitted(24, 196) Source(36, 25) + SourceIndex(0) +18>Emitted(24, 207) Source(36, 36) + SourceIndex(0) +19>Emitted(24, 208) Source(36, 36) + SourceIndex(0) +20>Emitted(24, 210) Source(36, 38) + SourceIndex(0) +21>Emitted(24, 211) Source(36, 39) + SourceIndex(0) +22>Emitted(24, 214) Source(36, 42) + SourceIndex(0) +23>Emitted(24, 215) Source(36, 43) + SourceIndex(0) +24>Emitted(24, 217) Source(36, 45) + SourceIndex(0) +25>Emitted(24, 218) Source(36, 46) + SourceIndex(0) +26>Emitted(24, 221) Source(36, 49) + SourceIndex(0) +27>Emitted(24, 222) Source(36, 50) + SourceIndex(0) +28>Emitted(24, 224) Source(36, 52) + SourceIndex(0) +29>Emitted(24, 225) Source(36, 53) + SourceIndex(0) +30>Emitted(24, 227) Source(36, 55) + SourceIndex(0) +31>Emitted(24, 229) Source(36, 57) + SourceIndex(0) +32>Emitted(24, 230) Source(36, 58) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(25, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(25, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(25, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for ((_k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = getMultiRobot() +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = getMultiRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(27, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(39, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(39, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(39, 6) + SourceIndex(0) +5 >Emitted(27, 7) Source(39, 6) + SourceIndex(0) +6 >Emitted(27, 27) Source(42, 40) + SourceIndex(0) +7 >Emitted(27, 29) Source(39, 9) + SourceIndex(0) +8 >Emitted(27, 39) Source(42, 21) + SourceIndex(0) +9 >Emitted(27, 41) Source(39, 9) + SourceIndex(0) +10>Emitted(27, 83) Source(42, 21) + SourceIndex(0) +11>Emitted(27, 85) Source(40, 5) + SourceIndex(0) +12>Emitted(27, 95) Source(40, 30) + SourceIndex(0) +13>Emitted(27, 97) Source(40, 5) + SourceIndex(0) +14>Emitted(27, 143) Source(40, 30) + SourceIndex(0) +15>Emitted(27, 145) Source(41, 5) + SourceIndex(0) +16>Emitted(27, 155) Source(41, 34) + SourceIndex(0) +17>Emitted(27, 157) Source(41, 5) + SourceIndex(0) +18>Emitted(27, 207) Source(41, 34) + SourceIndex(0) +19>Emitted(27, 212) Source(42, 40) + SourceIndex(0) +20>Emitted(27, 214) Source(42, 42) + SourceIndex(0) +21>Emitted(27, 215) Source(42, 43) + SourceIndex(0) +22>Emitted(27, 218) Source(42, 46) + SourceIndex(0) +23>Emitted(27, 219) Source(42, 47) + SourceIndex(0) +24>Emitted(27, 221) Source(42, 49) + SourceIndex(0) +25>Emitted(27, 222) Source(42, 50) + SourceIndex(0) +26>Emitted(27, 225) Source(42, 53) + SourceIndex(0) +27>Emitted(27, 226) Source(42, 54) + SourceIndex(0) +28>Emitted(27, 228) Source(42, 56) + SourceIndex(0) +29>Emitted(27, 229) Source(42, 57) + SourceIndex(0) +30>Emitted(27, 231) Source(42, 59) + SourceIndex(0) +31>Emitted(27, 233) Source(42, 61) + SourceIndex(0) +32>Emitted(27, 234) Source(42, 62) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(43, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(43, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(43, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(43, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(43, 17) + SourceIndex(0) +6 >Emitted(28, 30) Source(43, 30) + SourceIndex(0) +7 >Emitted(28, 31) Source(43, 31) + SourceIndex(0) +8 >Emitted(28, 32) Source(43, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(44, 2) + SourceIndex(0) +--- +>>>for ((_q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, _q), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> + > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(30, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(45, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(45, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(45, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(45, 6) + SourceIndex(0) +6 >Emitted(30, 47) Source(48, 60) + SourceIndex(0) +7 >Emitted(30, 49) Source(45, 9) + SourceIndex(0) +8 >Emitted(30, 59) Source(48, 21) + SourceIndex(0) +9 >Emitted(30, 61) Source(45, 9) + SourceIndex(0) +10>Emitted(30, 103) Source(48, 21) + SourceIndex(0) +11>Emitted(30, 105) Source(46, 5) + SourceIndex(0) +12>Emitted(30, 115) Source(46, 30) + SourceIndex(0) +13>Emitted(30, 117) Source(46, 5) + SourceIndex(0) +14>Emitted(30, 163) Source(46, 30) + SourceIndex(0) +15>Emitted(30, 165) Source(47, 5) + SourceIndex(0) +16>Emitted(30, 175) Source(47, 34) + SourceIndex(0) +17>Emitted(30, 177) Source(47, 5) + SourceIndex(0) +18>Emitted(30, 227) Source(47, 34) + SourceIndex(0) +19>Emitted(30, 232) Source(48, 60) + SourceIndex(0) +20>Emitted(30, 234) Source(48, 62) + SourceIndex(0) +21>Emitted(30, 235) Source(48, 63) + SourceIndex(0) +22>Emitted(30, 238) Source(48, 66) + SourceIndex(0) +23>Emitted(30, 239) Source(48, 67) + SourceIndex(0) +24>Emitted(30, 241) Source(48, 69) + SourceIndex(0) +25>Emitted(30, 242) Source(48, 70) + SourceIndex(0) +26>Emitted(30, 245) Source(48, 73) + SourceIndex(0) +27>Emitted(30, 246) Source(48, 74) + SourceIndex(0) +28>Emitted(30, 248) Source(48, 76) + SourceIndex(0) +29>Emitted(30, 249) Source(48, 77) + SourceIndex(0) +30>Emitted(30, 251) Source(48, 79) + SourceIndex(0) +31>Emitted(30, 253) Source(48, 81) + SourceIndex(0) +32>Emitted(30, 254) Source(48, 82) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(49, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(49, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(49, 32) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for ((_v = robotA[0], numberB = _v === void 0 ? -1 : _v, robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberB = -1 +7 > +8 > numberB = -1 +9 > ] = +10> robotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(33, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(52, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(52, 7) + SourceIndex(0) +6 >Emitted(33, 21) Source(52, 19) + SourceIndex(0) +7 >Emitted(33, 23) Source(52, 7) + SourceIndex(0) +8 >Emitted(33, 56) Source(52, 19) + SourceIndex(0) +9 >Emitted(33, 58) Source(52, 23) + SourceIndex(0) +10>Emitted(33, 64) Source(52, 29) + SourceIndex(0) +11>Emitted(33, 65) Source(52, 29) + SourceIndex(0) +12>Emitted(33, 67) Source(52, 31) + SourceIndex(0) +13>Emitted(33, 68) Source(52, 32) + SourceIndex(0) +14>Emitted(33, 71) Source(52, 35) + SourceIndex(0) +15>Emitted(33, 72) Source(52, 36) + SourceIndex(0) +16>Emitted(33, 74) Source(52, 38) + SourceIndex(0) +17>Emitted(33, 75) Source(52, 39) + SourceIndex(0) +18>Emitted(33, 78) Source(52, 42) + SourceIndex(0) +19>Emitted(33, 79) Source(52, 43) + SourceIndex(0) +20>Emitted(33, 81) Source(52, 45) + SourceIndex(0) +21>Emitted(33, 82) Source(52, 46) + SourceIndex(0) +22>Emitted(33, 84) Source(52, 48) + SourceIndex(0) +23>Emitted(33, 86) Source(52, 50) + SourceIndex(0) +24>Emitted(33, 87) Source(52, 51) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(34, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(34, 24) Source(53, 24) + SourceIndex(0) +7 >Emitted(34, 25) Source(53, 25) + SourceIndex(0) +8 >Emitted(34, 26) Source(53, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for ((_w = getRobot(), _x = _w[0], numberB = _x === void 0 ? -1 : _x, _w), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB = -1] = getRobot() +7 > +8 > numberB = -1 +9 > +10> numberB = -1 +11> ] = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(36, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(55, 6) + SourceIndex(0) +6 >Emitted(36, 22) Source(55, 33) + SourceIndex(0) +7 >Emitted(36, 24) Source(55, 7) + SourceIndex(0) +8 >Emitted(36, 34) Source(55, 19) + SourceIndex(0) +9 >Emitted(36, 36) Source(55, 7) + SourceIndex(0) +10>Emitted(36, 69) Source(55, 19) + SourceIndex(0) +11>Emitted(36, 74) Source(55, 33) + SourceIndex(0) +12>Emitted(36, 76) Source(55, 35) + SourceIndex(0) +13>Emitted(36, 77) Source(55, 36) + SourceIndex(0) +14>Emitted(36, 80) Source(55, 39) + SourceIndex(0) +15>Emitted(36, 81) Source(55, 40) + SourceIndex(0) +16>Emitted(36, 83) Source(55, 42) + SourceIndex(0) +17>Emitted(36, 84) Source(55, 43) + SourceIndex(0) +18>Emitted(36, 87) Source(55, 46) + SourceIndex(0) +19>Emitted(36, 88) Source(55, 47) + SourceIndex(0) +20>Emitted(36, 90) Source(55, 49) + SourceIndex(0) +21>Emitted(36, 91) Source(55, 50) + SourceIndex(0) +22>Emitted(36, 93) Source(55, 52) + SourceIndex(0) +23>Emitted(36, 95) Source(55, 54) + SourceIndex(0) +24>Emitted(36, 96) Source(55, 55) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(37, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(37, 24) Source(56, 24) + SourceIndex(0) +7 >Emitted(37, 25) Source(56, 25) + SourceIndex(0) +8 >Emitted(37, 26) Source(56, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for ((_y = [2, "trimmer", "trimming"], _z = _y[0], numberB = _z === void 0 ? -1 : _z, _y), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberB = -1] = [2, "trimmer", "trimming"] +7 > +8 > numberB = -1 +9 > +10> numberB = -1 +11> ] = [2, "trimmer", "trimming"] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(39, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(58, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(58, 6) + SourceIndex(0) +6 >Emitted(39, 38) Source(58, 49) + SourceIndex(0) +7 >Emitted(39, 40) Source(58, 7) + SourceIndex(0) +8 >Emitted(39, 50) Source(58, 19) + SourceIndex(0) +9 >Emitted(39, 52) Source(58, 7) + SourceIndex(0) +10>Emitted(39, 85) Source(58, 19) + SourceIndex(0) +11>Emitted(39, 90) Source(58, 49) + SourceIndex(0) +12>Emitted(39, 92) Source(58, 51) + SourceIndex(0) +13>Emitted(39, 93) Source(58, 52) + SourceIndex(0) +14>Emitted(39, 96) Source(58, 55) + SourceIndex(0) +15>Emitted(39, 97) Source(58, 56) + SourceIndex(0) +16>Emitted(39, 99) Source(58, 58) + SourceIndex(0) +17>Emitted(39, 100) Source(58, 59) + SourceIndex(0) +18>Emitted(39, 103) Source(58, 62) + SourceIndex(0) +19>Emitted(39, 104) Source(58, 63) + SourceIndex(0) +20>Emitted(39, 106) Source(58, 65) + SourceIndex(0) +21>Emitted(39, 107) Source(58, 66) + SourceIndex(0) +22>Emitted(39, 109) Source(58, 68) + SourceIndex(0) +23>Emitted(39, 111) Source(58, 70) + SourceIndex(0) +24>Emitted(39, 112) Source(58, 71) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(40, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(40, 24) Source(59, 24) + SourceIndex(0) +7 >Emitted(40, 25) Source(59, 25) + SourceIndex(0) +8 >Emitted(40, 26) Source(59, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for ((_0 = multiRobotA[0], nameB = _0 === void 0 ? "name" : _0, multiRobotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > [ +6 > nameB = "name" +7 > +8 > nameB = "name" +9 > ] = +10> multiRobotA +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(42, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(61, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(61, 7) + SourceIndex(0) +6 >Emitted(42, 26) Source(61, 21) + SourceIndex(0) +7 >Emitted(42, 28) Source(61, 7) + SourceIndex(0) +8 >Emitted(42, 63) Source(61, 21) + SourceIndex(0) +9 >Emitted(42, 65) Source(61, 25) + SourceIndex(0) +10>Emitted(42, 76) Source(61, 36) + SourceIndex(0) +11>Emitted(42, 77) Source(61, 36) + SourceIndex(0) +12>Emitted(42, 79) Source(61, 38) + SourceIndex(0) +13>Emitted(42, 80) Source(61, 39) + SourceIndex(0) +14>Emitted(42, 83) Source(61, 42) + SourceIndex(0) +15>Emitted(42, 84) Source(61, 43) + SourceIndex(0) +16>Emitted(42, 86) Source(61, 45) + SourceIndex(0) +17>Emitted(42, 87) Source(61, 46) + SourceIndex(0) +18>Emitted(42, 90) Source(61, 49) + SourceIndex(0) +19>Emitted(42, 91) Source(61, 50) + SourceIndex(0) +20>Emitted(42, 93) Source(61, 52) + SourceIndex(0) +21>Emitted(42, 94) Source(61, 53) + SourceIndex(0) +22>Emitted(42, 96) Source(61, 55) + SourceIndex(0) +23>Emitted(42, 98) Source(61, 57) + SourceIndex(0) +24>Emitted(42, 99) Source(61, 58) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for ((_1 = getMultiRobot(), _2 = _1[0], nameB = _2 === void 0 ? "name" : _2, _1), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB = "name"] = getMultiRobot() +7 > +8 > nameB = "name" +9 > +10> nameB = "name" +11> ] = getMultiRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(45, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(64, 6) + SourceIndex(0) +6 >Emitted(45, 27) Source(64, 40) + SourceIndex(0) +7 >Emitted(45, 29) Source(64, 7) + SourceIndex(0) +8 >Emitted(45, 39) Source(64, 21) + SourceIndex(0) +9 >Emitted(45, 41) Source(64, 7) + SourceIndex(0) +10>Emitted(45, 76) Source(64, 21) + SourceIndex(0) +11>Emitted(45, 81) Source(64, 40) + SourceIndex(0) +12>Emitted(45, 83) Source(64, 42) + SourceIndex(0) +13>Emitted(45, 84) Source(64, 43) + SourceIndex(0) +14>Emitted(45, 87) Source(64, 46) + SourceIndex(0) +15>Emitted(45, 88) Source(64, 47) + SourceIndex(0) +16>Emitted(45, 90) Source(64, 49) + SourceIndex(0) +17>Emitted(45, 91) Source(64, 50) + SourceIndex(0) +18>Emitted(45, 94) Source(64, 53) + SourceIndex(0) +19>Emitted(45, 95) Source(64, 54) + SourceIndex(0) +20>Emitted(45, 97) Source(64, 56) + SourceIndex(0) +21>Emitted(45, 98) Source(64, 57) + SourceIndex(0) +22>Emitted(45, 100) Source(64, 59) + SourceIndex(0) +23>Emitted(45, 102) Source(64, 61) + SourceIndex(0) +24>Emitted(45, 103) Source(64, 62) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(46, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(46, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(46, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(46, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(46, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(46, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(46, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(46, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(47, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(47, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for ((_3 = ["trimmer", ["trimming", "edging"]], _4 = _3[0], nameB = _4 === void 0 ? "name" : _4, _3), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameB = "name"] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameB = "name" +9 > +10> nameB = "name" +11> ] = ["trimmer", ["trimming", "edging"]] +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(48, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(48, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(48, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(48, 6) Source(67, 6) + SourceIndex(0) +5 >Emitted(48, 7) Source(67, 6) + SourceIndex(0) +6 >Emitted(48, 47) Source(67, 60) + SourceIndex(0) +7 >Emitted(48, 49) Source(67, 7) + SourceIndex(0) +8 >Emitted(48, 59) Source(67, 21) + SourceIndex(0) +9 >Emitted(48, 61) Source(67, 7) + SourceIndex(0) +10>Emitted(48, 96) Source(67, 21) + SourceIndex(0) +11>Emitted(48, 101) Source(67, 60) + SourceIndex(0) +12>Emitted(48, 103) Source(67, 62) + SourceIndex(0) +13>Emitted(48, 104) Source(67, 63) + SourceIndex(0) +14>Emitted(48, 107) Source(67, 66) + SourceIndex(0) +15>Emitted(48, 108) Source(67, 67) + SourceIndex(0) +16>Emitted(48, 110) Source(67, 69) + SourceIndex(0) +17>Emitted(48, 111) Source(67, 70) + SourceIndex(0) +18>Emitted(48, 114) Source(67, 73) + SourceIndex(0) +19>Emitted(48, 115) Source(67, 74) + SourceIndex(0) +20>Emitted(48, 117) Source(67, 76) + SourceIndex(0) +21>Emitted(48, 118) Source(67, 77) + SourceIndex(0) +22>Emitted(48, 120) Source(67, 79) + SourceIndex(0) +23>Emitted(48, 122) Source(67, 81) + SourceIndex(0) +24>Emitted(48, 123) Source(67, 82) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(49, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(68, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(68, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(68, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(50, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(50, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for ((_5 = robotA[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = robotA[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = robotA[2], skillA2 = _7 === void 0 ? "skill" : _7, robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA2 = -1 +7 > +8 > numberA2 = -1 +9 > , +10> nameA2 = "name" +11> +12> nameA2 = "name" +13> , +14> skillA2 = "skill" +15> +16> skillA2 = "skill" +17> ] = +18> robotA +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(51, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(51, 7) Source(71, 7) + SourceIndex(0) +6 >Emitted(51, 21) Source(71, 20) + SourceIndex(0) +7 >Emitted(51, 23) Source(71, 7) + SourceIndex(0) +8 >Emitted(51, 57) Source(71, 20) + SourceIndex(0) +9 >Emitted(51, 59) Source(71, 22) + SourceIndex(0) +10>Emitted(51, 73) Source(71, 37) + SourceIndex(0) +11>Emitted(51, 75) Source(71, 22) + SourceIndex(0) +12>Emitted(51, 111) Source(71, 37) + SourceIndex(0) +13>Emitted(51, 113) Source(71, 39) + SourceIndex(0) +14>Emitted(51, 127) Source(71, 56) + SourceIndex(0) +15>Emitted(51, 129) Source(71, 39) + SourceIndex(0) +16>Emitted(51, 167) Source(71, 56) + SourceIndex(0) +17>Emitted(51, 169) Source(71, 60) + SourceIndex(0) +18>Emitted(51, 175) Source(71, 66) + SourceIndex(0) +19>Emitted(51, 176) Source(71, 66) + SourceIndex(0) +20>Emitted(51, 178) Source(71, 68) + SourceIndex(0) +21>Emitted(51, 179) Source(71, 69) + SourceIndex(0) +22>Emitted(51, 182) Source(71, 72) + SourceIndex(0) +23>Emitted(51, 183) Source(71, 73) + SourceIndex(0) +24>Emitted(51, 185) Source(71, 75) + SourceIndex(0) +25>Emitted(51, 186) Source(71, 76) + SourceIndex(0) +26>Emitted(51, 189) Source(71, 79) + SourceIndex(0) +27>Emitted(51, 190) Source(71, 80) + SourceIndex(0) +28>Emitted(51, 192) Source(71, 82) + SourceIndex(0) +29>Emitted(51, 193) Source(71, 83) + SourceIndex(0) +30>Emitted(51, 195) Source(71, 85) + SourceIndex(0) +31>Emitted(51, 197) Source(71, 87) + SourceIndex(0) +32>Emitted(51, 198) Source(71, 88) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(52, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(52, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(52, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(52, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(52, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(52, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(52, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(52, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(53, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(53, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for ((_8 = getRobot(), _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, _8), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = getRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(54, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(54, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(54, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(54, 6) Source(74, 6) + SourceIndex(0) +5 >Emitted(54, 7) Source(74, 6) + SourceIndex(0) +6 >Emitted(54, 22) Source(74, 70) + SourceIndex(0) +7 >Emitted(54, 24) Source(74, 7) + SourceIndex(0) +8 >Emitted(54, 34) Source(74, 20) + SourceIndex(0) +9 >Emitted(54, 36) Source(74, 7) + SourceIndex(0) +10>Emitted(54, 70) Source(74, 20) + SourceIndex(0) +11>Emitted(54, 72) Source(74, 22) + SourceIndex(0) +12>Emitted(54, 83) Source(74, 37) + SourceIndex(0) +13>Emitted(54, 85) Source(74, 22) + SourceIndex(0) +14>Emitted(54, 123) Source(74, 37) + SourceIndex(0) +15>Emitted(54, 125) Source(74, 39) + SourceIndex(0) +16>Emitted(54, 136) Source(74, 56) + SourceIndex(0) +17>Emitted(54, 138) Source(74, 39) + SourceIndex(0) +18>Emitted(54, 178) Source(74, 56) + SourceIndex(0) +19>Emitted(54, 183) Source(74, 70) + SourceIndex(0) +20>Emitted(54, 185) Source(74, 72) + SourceIndex(0) +21>Emitted(54, 186) Source(74, 73) + SourceIndex(0) +22>Emitted(54, 189) Source(74, 76) + SourceIndex(0) +23>Emitted(54, 190) Source(74, 77) + SourceIndex(0) +24>Emitted(54, 192) Source(74, 79) + SourceIndex(0) +25>Emitted(54, 193) Source(74, 80) + SourceIndex(0) +26>Emitted(54, 196) Source(74, 83) + SourceIndex(0) +27>Emitted(54, 197) Source(74, 84) + SourceIndex(0) +28>Emitted(54, 199) Source(74, 86) + SourceIndex(0) +29>Emitted(54, 200) Source(74, 87) + SourceIndex(0) +30>Emitted(54, 202) Source(74, 89) + SourceIndex(0) +31>Emitted(54, 204) Source(74, 91) + SourceIndex(0) +32>Emitted(54, 205) Source(74, 92) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(55, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(55, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(55, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(55, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(56, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(56, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for ((_12 = [2, "trimmer", "trimming"], _13 = _12[0], numberA2 = _13 === void 0 ? -1 : _13, _14 = _12[1], nameA2 = _14 === void 0 ? "name" : _14, _15 = _12[2], skillA2 = _15 === void 0 ? "skill" : _15, _12), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] +7 > +8 > numberA2 = -1 +9 > +10> numberA2 = -1 +11> , +12> nameA2 = "name" +13> +14> nameA2 = "name" +15> , +16> skillA2 = "skill" +17> +18> skillA2 = "skill" +19> ] = [2, "trimmer", "trimming"] +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(57, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(57, 7) Source(77, 6) + SourceIndex(0) +6 >Emitted(57, 39) Source(77, 86) + SourceIndex(0) +7 >Emitted(57, 41) Source(77, 7) + SourceIndex(0) +8 >Emitted(57, 53) Source(77, 20) + SourceIndex(0) +9 >Emitted(57, 55) Source(77, 7) + SourceIndex(0) +10>Emitted(57, 91) Source(77, 20) + SourceIndex(0) +11>Emitted(57, 93) Source(77, 22) + SourceIndex(0) +12>Emitted(57, 105) Source(77, 37) + SourceIndex(0) +13>Emitted(57, 107) Source(77, 22) + SourceIndex(0) +14>Emitted(57, 145) Source(77, 37) + SourceIndex(0) +15>Emitted(57, 147) Source(77, 39) + SourceIndex(0) +16>Emitted(57, 159) Source(77, 56) + SourceIndex(0) +17>Emitted(57, 161) Source(77, 39) + SourceIndex(0) +18>Emitted(57, 201) Source(77, 56) + SourceIndex(0) +19>Emitted(57, 207) Source(77, 86) + SourceIndex(0) +20>Emitted(57, 209) Source(77, 88) + SourceIndex(0) +21>Emitted(57, 210) Source(77, 89) + SourceIndex(0) +22>Emitted(57, 213) Source(77, 92) + SourceIndex(0) +23>Emitted(57, 214) Source(77, 93) + SourceIndex(0) +24>Emitted(57, 216) Source(77, 95) + SourceIndex(0) +25>Emitted(57, 217) Source(77, 96) + SourceIndex(0) +26>Emitted(57, 220) Source(77, 99) + SourceIndex(0) +27>Emitted(57, 221) Source(77, 100) + SourceIndex(0) +28>Emitted(57, 223) Source(77, 102) + SourceIndex(0) +29>Emitted(57, 224) Source(77, 103) + SourceIndex(0) +30>Emitted(57, 226) Source(77, 105) + SourceIndex(0) +31>Emitted(57, 228) Source(77, 107) + SourceIndex(0) +32>Emitted(57, 229) Source(77, 108) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(58, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(58, 23) Source(78, 23) + SourceIndex(0) +7 >Emitted(58, 24) Source(78, 24) + SourceIndex(0) +8 >Emitted(58, 25) Source(78, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(59, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(59, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for (var _16 = multiRobotA[0], nameMA_1 = _16 === void 0 ? "noName" : _16, _17 = multiRobotA[1], _18 = _17 === void 0 ? ["none", "none"] : _17, _19 = _18[0], primarySkillA_1 = _19 === void 0 ? "primary" : _19, _20 = _18[1], secondarySkillA_1 = _20 === void 0 ? "secondary" : _20, i_1 = 0; i_1 < 1; i_1++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^ +21> ^^^ +22> ^^^ +23> ^ +24> ^^ +25> ^^^ +26> ^^^ +27> ^ +28> ^^ +29> ^^^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let + > [ +5 > nameMA = "noName" +6 > +7 > nameMA = "noName" +8 > , + > +9 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +10> +11> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +12> +13> primarySkillA = "primary" +14> +15> primarySkillA = "primary" +16> , + > +17> secondarySkillA = "secondary" +18> +19> secondarySkillA = "secondary" +20> + > ] = ["none", "none"] + > ] = multiRobotA, +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(60, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(60, 4) Source(80, 4) + SourceIndex(0) +3 >Emitted(60, 5) Source(80, 5) + SourceIndex(0) +4 >Emitted(60, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(60, 30) Source(81, 23) + SourceIndex(0) +6 >Emitted(60, 32) Source(81, 6) + SourceIndex(0) +7 >Emitted(60, 74) Source(81, 23) + SourceIndex(0) +8 >Emitted(60, 76) Source(82, 9) + SourceIndex(0) +9 >Emitted(60, 96) Source(85, 29) + SourceIndex(0) +10>Emitted(60, 98) Source(82, 9) + SourceIndex(0) +11>Emitted(60, 143) Source(85, 29) + SourceIndex(0) +12>Emitted(60, 145) Source(83, 13) + SourceIndex(0) +13>Emitted(60, 157) Source(83, 38) + SourceIndex(0) +14>Emitted(60, 159) Source(83, 13) + SourceIndex(0) +15>Emitted(60, 209) Source(83, 38) + SourceIndex(0) +16>Emitted(60, 211) Source(84, 13) + SourceIndex(0) +17>Emitted(60, 223) Source(84, 42) + SourceIndex(0) +18>Emitted(60, 225) Source(84, 13) + SourceIndex(0) +19>Emitted(60, 279) Source(84, 42) + SourceIndex(0) +20>Emitted(60, 281) Source(86, 22) + SourceIndex(0) +21>Emitted(60, 284) Source(86, 23) + SourceIndex(0) +22>Emitted(60, 287) Source(86, 26) + SourceIndex(0) +23>Emitted(60, 288) Source(86, 27) + SourceIndex(0) +24>Emitted(60, 290) Source(86, 29) + SourceIndex(0) +25>Emitted(60, 293) Source(86, 30) + SourceIndex(0) +26>Emitted(60, 296) Source(86, 33) + SourceIndex(0) +27>Emitted(60, 297) Source(86, 34) + SourceIndex(0) +28>Emitted(60, 299) Source(86, 36) + SourceIndex(0) +29>Emitted(60, 302) Source(86, 37) + SourceIndex(0) +30>Emitted(60, 304) Source(86, 39) + SourceIndex(0) +31>Emitted(60, 306) Source(86, 41) + SourceIndex(0) +32>Emitted(60, 307) Source(86, 42) + SourceIndex(0) +--- +>>> console.log(nameMA_1); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(61, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(61, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(61, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(61, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(61, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(61, 25) Source(87, 23) + SourceIndex(0) +7 >Emitted(61, 26) Source(87, 24) + SourceIndex(0) +8 >Emitted(61, 27) Source(87, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(62, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(62, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for ((_21 = getMultiRobot(), _22 = _21[0], nameMA = _22 === void 0 ? "noName" : _22, _23 = _21[1], _24 = _23 === void 0 ? ["none", "none"] : _23, _25 = _24[0], primarySkillA = _25 === void 0 ? "primary" : _25, _26 = _24[1], secondarySkillA = _26 === void 0 ? "secondary" : _26, _21), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = getMultiRobot() +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = getMultiRobot() +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(63, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(63, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(63, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(63, 6) Source(89, 6) + SourceIndex(0) +5 >Emitted(63, 7) Source(89, 6) + SourceIndex(0) +6 >Emitted(63, 28) Source(94, 20) + SourceIndex(0) +7 >Emitted(63, 30) Source(89, 7) + SourceIndex(0) +8 >Emitted(63, 42) Source(89, 24) + SourceIndex(0) +9 >Emitted(63, 44) Source(89, 7) + SourceIndex(0) +10>Emitted(63, 84) Source(89, 24) + SourceIndex(0) +11>Emitted(63, 86) Source(90, 5) + SourceIndex(0) +12>Emitted(63, 98) Source(93, 25) + SourceIndex(0) +13>Emitted(63, 100) Source(90, 5) + SourceIndex(0) +14>Emitted(63, 145) Source(93, 25) + SourceIndex(0) +15>Emitted(63, 147) Source(91, 9) + SourceIndex(0) +16>Emitted(63, 159) Source(91, 34) + SourceIndex(0) +17>Emitted(63, 161) Source(91, 9) + SourceIndex(0) +18>Emitted(63, 209) Source(91, 34) + SourceIndex(0) +19>Emitted(63, 211) Source(92, 9) + SourceIndex(0) +20>Emitted(63, 223) Source(92, 38) + SourceIndex(0) +21>Emitted(63, 225) Source(92, 9) + SourceIndex(0) +22>Emitted(63, 277) Source(92, 38) + SourceIndex(0) +23>Emitted(63, 283) Source(94, 20) + SourceIndex(0) +24>Emitted(63, 285) Source(94, 22) + SourceIndex(0) +25>Emitted(63, 286) Source(94, 23) + SourceIndex(0) +26>Emitted(63, 289) Source(94, 26) + SourceIndex(0) +27>Emitted(63, 290) Source(94, 27) + SourceIndex(0) +28>Emitted(63, 292) Source(94, 29) + SourceIndex(0) +29>Emitted(63, 293) Source(94, 30) + SourceIndex(0) +30>Emitted(63, 296) Source(94, 33) + SourceIndex(0) +31>Emitted(63, 297) Source(94, 34) + SourceIndex(0) +32>Emitted(63, 299) Source(94, 36) + SourceIndex(0) +33>Emitted(63, 300) Source(94, 37) + SourceIndex(0) +34>Emitted(63, 302) Source(94, 39) + SourceIndex(0) +35>Emitted(63, 304) Source(94, 41) + SourceIndex(0) +36>Emitted(63, 305) Source(94, 42) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(95, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(95, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(95, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(95, 17) + SourceIndex(0) +6 >Emitted(64, 23) Source(95, 23) + SourceIndex(0) +7 >Emitted(64, 24) Source(95, 24) + SourceIndex(0) +8 >Emitted(64, 25) Source(95, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(65, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(65, 2) Source(96, 2) + SourceIndex(0) +--- +>>>for ((_27 = ["trimmer", ["trimming", "edging"]], _28 = _27[0], nameMA = _28 === void 0 ? "noName" : _28, _29 = _27[1], _30 = _29 === void 0 ? ["none", "none"] : _29, _31 = _30[0], primarySkillA = _31 === void 0 ? "primary" : _31, _32 = _30[1], secondarySkillA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [nameMA = "noName", + > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]] +7 > +8 > nameMA = "noName" +9 > +10> nameMA = "noName" +11> , + > +12> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +13> +14> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["none", "none"] +15> +16> primarySkillA = "primary" +17> +18> primarySkillA = "primary" +19> , + > +20> secondarySkillA = "secondary" +21> +22> secondarySkillA = "secondary" +23> + > ] = ["none", "none"] + > ] = ["trimmer", ["trimming", "edging"]] +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(66, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(97, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(97, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(97, 6) + SourceIndex(0) +5 >Emitted(66, 7) Source(97, 6) + SourceIndex(0) +6 >Emitted(66, 48) Source(102, 40) + SourceIndex(0) +7 >Emitted(66, 50) Source(97, 7) + SourceIndex(0) +8 >Emitted(66, 62) Source(97, 24) + SourceIndex(0) +9 >Emitted(66, 64) Source(97, 7) + SourceIndex(0) +10>Emitted(66, 104) Source(97, 24) + SourceIndex(0) +11>Emitted(66, 106) Source(98, 5) + SourceIndex(0) +12>Emitted(66, 118) Source(101, 25) + SourceIndex(0) +13>Emitted(66, 120) Source(98, 5) + SourceIndex(0) +14>Emitted(66, 165) Source(101, 25) + SourceIndex(0) +15>Emitted(66, 167) Source(99, 9) + SourceIndex(0) +16>Emitted(66, 179) Source(99, 34) + SourceIndex(0) +17>Emitted(66, 181) Source(99, 9) + SourceIndex(0) +18>Emitted(66, 229) Source(99, 34) + SourceIndex(0) +19>Emitted(66, 231) Source(100, 9) + SourceIndex(0) +20>Emitted(66, 243) Source(100, 38) + SourceIndex(0) +21>Emitted(66, 245) Source(100, 9) + SourceIndex(0) +22>Emitted(66, 297) Source(100, 38) + SourceIndex(0) +23>Emitted(66, 303) Source(102, 40) + SourceIndex(0) +24>Emitted(66, 305) Source(102, 42) + SourceIndex(0) +25>Emitted(66, 306) Source(102, 43) + SourceIndex(0) +26>Emitted(66, 309) Source(102, 46) + SourceIndex(0) +27>Emitted(66, 310) Source(102, 47) + SourceIndex(0) +28>Emitted(66, 312) Source(102, 49) + SourceIndex(0) +29>Emitted(66, 313) Source(102, 50) + SourceIndex(0) +30>Emitted(66, 316) Source(102, 53) + SourceIndex(0) +31>Emitted(66, 317) Source(102, 54) + SourceIndex(0) +32>Emitted(66, 319) Source(102, 56) + SourceIndex(0) +33>Emitted(66, 320) Source(102, 57) + SourceIndex(0) +34>Emitted(66, 322) Source(102, 59) + SourceIndex(0) +35>Emitted(66, 324) Source(102, 61) + SourceIndex(0) +36>Emitted(66, 325) Source(102, 62) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(67, 5) Source(103, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(103, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(103, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(103, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(103, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(103, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(103, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(103, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(68, 1) Source(104, 1) + SourceIndex(0) +2 >Emitted(68, 2) Source(104, 2) + SourceIndex(0) +--- +>>>for ((_33 = robotA[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = robotA.slice(1), robotA), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > [ +6 > numberA3 = -1 +7 > +8 > numberA3 = -1 +9 > , +10> ...robotAInfo +11> ] = +12> robotA +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(69, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(69, 7) Source(106, 7) + SourceIndex(0) +6 >Emitted(69, 22) Source(106, 20) + SourceIndex(0) +7 >Emitted(69, 24) Source(106, 7) + SourceIndex(0) +8 >Emitted(69, 60) Source(106, 20) + SourceIndex(0) +9 >Emitted(69, 62) Source(106, 22) + SourceIndex(0) +10>Emitted(69, 90) Source(106, 35) + SourceIndex(0) +11>Emitted(69, 92) Source(106, 39) + SourceIndex(0) +12>Emitted(69, 98) Source(106, 45) + SourceIndex(0) +13>Emitted(69, 99) Source(106, 45) + SourceIndex(0) +14>Emitted(69, 101) Source(106, 47) + SourceIndex(0) +15>Emitted(69, 102) Source(106, 48) + SourceIndex(0) +16>Emitted(69, 105) Source(106, 51) + SourceIndex(0) +17>Emitted(69, 106) Source(106, 52) + SourceIndex(0) +18>Emitted(69, 108) Source(106, 54) + SourceIndex(0) +19>Emitted(69, 109) Source(106, 55) + SourceIndex(0) +20>Emitted(69, 112) Source(106, 58) + SourceIndex(0) +21>Emitted(69, 113) Source(106, 59) + SourceIndex(0) +22>Emitted(69, 115) Source(106, 61) + SourceIndex(0) +23>Emitted(69, 116) Source(106, 62) + SourceIndex(0) +24>Emitted(69, 118) Source(106, 64) + SourceIndex(0) +25>Emitted(69, 120) Source(106, 66) + SourceIndex(0) +26>Emitted(69, 121) Source(106, 67) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(70, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(70, 12) Source(107, 12) + SourceIndex(0) +3 >Emitted(70, 13) Source(107, 13) + SourceIndex(0) +4 >Emitted(70, 16) Source(107, 16) + SourceIndex(0) +5 >Emitted(70, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(70, 25) Source(107, 25) + SourceIndex(0) +7 >Emitted(70, 26) Source(107, 26) + SourceIndex(0) +8 >Emitted(70, 27) Source(107, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(71, 1) Source(108, 1) + SourceIndex(0) +2 >Emitted(71, 2) Source(108, 2) + SourceIndex(0) +--- +>>>for ((_34 = getRobot(), _35 = _34[0], numberA3 = _35 === void 0 ? -1 : _35, robotAInfo = _34.slice(1), _34), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3 = -1, ...robotAInfo] = getRobot() +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = getRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(72, 1) Source(109, 1) + SourceIndex(0) +2 >Emitted(72, 4) Source(109, 4) + SourceIndex(0) +3 >Emitted(72, 5) Source(109, 5) + SourceIndex(0) +4 >Emitted(72, 6) Source(109, 6) + SourceIndex(0) +5 >Emitted(72, 7) Source(109, 6) + SourceIndex(0) +6 >Emitted(72, 23) Source(109, 49) + SourceIndex(0) +7 >Emitted(72, 25) Source(109, 7) + SourceIndex(0) +8 >Emitted(72, 37) Source(109, 20) + SourceIndex(0) +9 >Emitted(72, 39) Source(109, 7) + SourceIndex(0) +10>Emitted(72, 75) Source(109, 20) + SourceIndex(0) +11>Emitted(72, 77) Source(109, 22) + SourceIndex(0) +12>Emitted(72, 102) Source(109, 35) + SourceIndex(0) +13>Emitted(72, 108) Source(109, 49) + SourceIndex(0) +14>Emitted(72, 110) Source(109, 51) + SourceIndex(0) +15>Emitted(72, 111) Source(109, 52) + SourceIndex(0) +16>Emitted(72, 114) Source(109, 55) + SourceIndex(0) +17>Emitted(72, 115) Source(109, 56) + SourceIndex(0) +18>Emitted(72, 117) Source(109, 58) + SourceIndex(0) +19>Emitted(72, 118) Source(109, 59) + SourceIndex(0) +20>Emitted(72, 121) Source(109, 62) + SourceIndex(0) +21>Emitted(72, 122) Source(109, 63) + SourceIndex(0) +22>Emitted(72, 124) Source(109, 65) + SourceIndex(0) +23>Emitted(72, 125) Source(109, 66) + SourceIndex(0) +24>Emitted(72, 127) Source(109, 68) + SourceIndex(0) +25>Emitted(72, 129) Source(109, 70) + SourceIndex(0) +26>Emitted(72, 130) Source(109, 71) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(73, 5) Source(110, 5) + SourceIndex(0) +2 >Emitted(73, 12) Source(110, 12) + SourceIndex(0) +3 >Emitted(73, 13) Source(110, 13) + SourceIndex(0) +4 >Emitted(73, 16) Source(110, 16) + SourceIndex(0) +5 >Emitted(73, 17) Source(110, 17) + SourceIndex(0) +6 >Emitted(73, 25) Source(110, 25) + SourceIndex(0) +7 >Emitted(73, 26) Source(110, 26) + SourceIndex(0) +8 >Emitted(73, 27) Source(110, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(74, 1) Source(111, 1) + SourceIndex(0) +2 >Emitted(74, 2) Source(111, 2) + SourceIndex(0) +--- +>>>for ((_36 = [2, "trimmer", "trimming"], _37 = _36[0], numberA3 = _37 === void 0 ? -1 : _37, robotAInfo = _36.slice(1), _36), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +7 > +8 > numberA3 = -1 +9 > +10> numberA3 = -1 +11> , +12> ...robotAInfo +13> ] = [2, "trimmer", "trimming"] +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(75, 1) Source(112, 1) + SourceIndex(0) +2 >Emitted(75, 4) Source(112, 4) + SourceIndex(0) +3 >Emitted(75, 5) Source(112, 5) + SourceIndex(0) +4 >Emitted(75, 6) Source(112, 6) + SourceIndex(0) +5 >Emitted(75, 7) Source(112, 6) + SourceIndex(0) +6 >Emitted(75, 39) Source(112, 72) + SourceIndex(0) +7 >Emitted(75, 41) Source(112, 7) + SourceIndex(0) +8 >Emitted(75, 53) Source(112, 20) + SourceIndex(0) +9 >Emitted(75, 55) Source(112, 7) + SourceIndex(0) +10>Emitted(75, 91) Source(112, 20) + SourceIndex(0) +11>Emitted(75, 93) Source(112, 22) + SourceIndex(0) +12>Emitted(75, 118) Source(112, 35) + SourceIndex(0) +13>Emitted(75, 124) Source(112, 72) + SourceIndex(0) +14>Emitted(75, 126) Source(112, 74) + SourceIndex(0) +15>Emitted(75, 127) Source(112, 75) + SourceIndex(0) +16>Emitted(75, 130) Source(112, 78) + SourceIndex(0) +17>Emitted(75, 131) Source(112, 79) + SourceIndex(0) +18>Emitted(75, 133) Source(112, 81) + SourceIndex(0) +19>Emitted(75, 134) Source(112, 82) + SourceIndex(0) +20>Emitted(75, 137) Source(112, 85) + SourceIndex(0) +21>Emitted(75, 138) Source(112, 86) + SourceIndex(0) +22>Emitted(75, 140) Source(112, 88) + SourceIndex(0) +23>Emitted(75, 141) Source(112, 89) + SourceIndex(0) +24>Emitted(75, 143) Source(112, 91) + SourceIndex(0) +25>Emitted(75, 145) Source(112, 93) + SourceIndex(0) +26>Emitted(75, 146) Source(112, 94) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(76, 5) Source(113, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(113, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(113, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(113, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(113, 17) + SourceIndex(0) +6 >Emitted(76, 25) Source(113, 25) + SourceIndex(0) +7 >Emitted(76, 26) Source(113, 26) + SourceIndex(0) +8 >Emitted(76, 27) Source(113, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(77, 1) Source(114, 1) + SourceIndex(0) +2 >Emitted(77, 2) Source(114, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..3acec61f78b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,391 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 2, 1)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) + + return robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 3, 38)) + +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) + + return multiRobotA; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 54)) + +let i: number; +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 3)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 3)) +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 18, 20)) +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 21)) +} +for (let + [nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 80, 5)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 81, 9)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 82, 38)) + + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 11, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 85, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 85, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 85, 20)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 80, 5)) +} +for ([nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 12, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) +} +for ([nameMA = "noName", +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) + + [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 17, 41)) + + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 19, 54)) +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 6, 43)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 21)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 2, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 21, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts, 20, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..3bef86dcf80 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types @@ -0,0 +1,752 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function getRobot() { +>getRobot : () => [number, string, string] + + return robotA; +>robotA : [number, string, string] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function getMultiRobot() { +>getMultiRobot : () => [string, [string, string]] + + return multiRobotA; +>multiRobotA : [string, [string, string]] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +let i: number; +>i : number + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { +>[, nameA = "name"] = robotA, i = 0 : number +>[, nameA = "name"] = robotA : [number, string, string] +>[, nameA = "name"] : [undefined, string] +> : undefined +>nameA = "name" : string +>nameA : string +>"name" : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +>[, nameA = "name"] = getRobot(), i = 0 : number +>[, nameA = "name"] = getRobot() : [number, string, string] +>[, nameA = "name"] : [undefined, string] +> : undefined +>nameA = "name" : string +>nameA : string +>"name" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[, nameA = "name"] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA = "name"] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameA = "name"] : [undefined, string] +> : undefined +>nameA = "name" : string +>nameA : string +>"name" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA, i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA : [string, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["none", "none"] : [string, string] +>"none" : string +>"none" : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { +>[numberB = -1] = robotA, i = 0 : number +>[numberB = -1] = robotA : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { +>[numberB = -1] = getRobot(), i = 0 : number +>[numberB = -1] = getRobot() : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberB = -1] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +>[nameB = "name"] = multiRobotA, i = 0 : number +>[nameB = "name"] = multiRobotA : [string, [string, string]] +>[nameB = "name"] : [string] +>nameB = "name" : string +>nameB : string +>"name" : string +>multiRobotA : [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +>[nameB = "name"] = getMultiRobot(), i = 0 : number +>[nameB = "name"] = getMultiRobot() : [string, [string, string]] +>[nameB = "name"] : [string] +>nameB = "name" : string +>nameB : string +>"name" : string +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>[nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB = "name"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameB = "name"] : [string] +>nameB = "name" : string +>nameB : string +>"name" : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA : [number, string, string] +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "name" : string +>nameA2 : string +>"name" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() : [number, string, string] +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "name" : string +>nameA2 : string +>"name" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "name" : string +>nameA2 : string +>"name" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let + [nameMA = "noName", +>nameMA : string +>"noName" : string + + [ + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + + ] = multiRobotA, i = 0; i < 1; i++) { +>multiRobotA : [string, [string, string]] +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string + + [ +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : [string, [string, string]] +>getMultiRobot : () => [string, [string, string]] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string + + [ +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + + ] = ["none", "none"] +>["none", "none"] : [string, string] +>"none" : string +>"none" : string + +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +>[numberA3 = -1, ...robotAInfo] = robotA, i = 0 : number +>[numberA3 = -1, ...robotAInfo] = robotA : [number, string, string] +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotA : [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +>[numberA3 = -1, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3 = -1, ...robotAInfo] = getRobot() : [number, string, string] +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobot() : [number, string, string] +>getRobot : () => [number, string, string] +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +>[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js new file mode 100644 index 00000000000..ca29b2eabd8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js @@ -0,0 +1,114 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPattern.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +for (var nameA = robot.name, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var nameA = getRobot().name, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _d = getRobot(), nameA = _d.name, skillA = _d.skill, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _e = { name: "trimmer", skill: "trimming" }, nameA = _e.name, skillA = _e.skill, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var nameA = multiRobot.name, _f = multiRobot.skills, primaryA = _f.primary, secondaryA = _f.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _g = getMultiRobot(), nameA = _g.name, _h = _g.skills, primaryA = _h.primary, secondaryA = _h.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _j = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _j.name, _k = _j.skills, primaryA = _k.primary, secondaryA = _k.secondary, i = 0; i < 1; i++) { + console.log(primaryA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map new file mode 100644 index 00000000000..d9f2e446f04 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,GAAG,CAAC,CAAM,sBAAW,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAW,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,uDAAW,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAO,0BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAO,+BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAO,yFAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAEzD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAM,sBAAW,EAAE,oBAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAA8C,EAAzC,eAAW,EAAE,iBAAa,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,2CAAiF,EAA5E,eAAW,EAAE,iBAAa,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,2BAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAA0F,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjH,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,8EACoF,EAD/E,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAErE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..61689b46799 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt @@ -0,0 +1,1490 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>for (var nameA = robot.name, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > } = robot, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) +5 >Emitted(9, 28) Source(26, 22) + SourceIndex(0) +6 >Emitted(9, 30) Source(26, 34) + SourceIndex(0) +7 >Emitted(9, 31) Source(26, 35) + SourceIndex(0) +8 >Emitted(9, 34) Source(26, 38) + SourceIndex(0) +9 >Emitted(9, 35) Source(26, 39) + SourceIndex(0) +10>Emitted(9, 37) Source(26, 41) + SourceIndex(0) +11>Emitted(9, 38) Source(26, 42) + SourceIndex(0) +12>Emitted(9, 41) Source(26, 45) + SourceIndex(0) +13>Emitted(9, 42) Source(26, 46) + SourceIndex(0) +14>Emitted(9, 44) Source(26, 48) + SourceIndex(0) +15>Emitted(9, 45) Source(26, 49) + SourceIndex(0) +16>Emitted(9, 47) Source(26, 51) + SourceIndex(0) +17>Emitted(9, 49) Source(26, 53) + SourceIndex(0) +18>Emitted(9, 50) Source(26, 54) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var nameA = getRobot().name, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > } = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(12, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) +5 >Emitted(12, 33) Source(29, 22) + SourceIndex(0) +6 >Emitted(12, 35) Source(29, 39) + SourceIndex(0) +7 >Emitted(12, 36) Source(29, 40) + SourceIndex(0) +8 >Emitted(12, 39) Source(29, 43) + SourceIndex(0) +9 >Emitted(12, 40) Source(29, 44) + SourceIndex(0) +10>Emitted(12, 42) Source(29, 46) + SourceIndex(0) +11>Emitted(12, 43) Source(29, 47) + SourceIndex(0) +12>Emitted(12, 46) Source(29, 50) + SourceIndex(0) +13>Emitted(12, 47) Source(29, 51) + SourceIndex(0) +14>Emitted(12, 49) Source(29, 53) + SourceIndex(0) +15>Emitted(12, 50) Source(29, 54) + SourceIndex(0) +16>Emitted(12, 52) Source(29, 56) + SourceIndex(0) +17>Emitted(12, 54) Source(29, 58) + SourceIndex(0) +18>Emitted(12, 55) Source(29, 59) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(13, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(13, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(13, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(13, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ +18> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > } = { name: "trimmer", skill: "trimming" }, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) +18> { +1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) +5 >Emitted(15, 61) Source(32, 22) + SourceIndex(0) +6 >Emitted(15, 63) Source(32, 74) + SourceIndex(0) +7 >Emitted(15, 64) Source(32, 75) + SourceIndex(0) +8 >Emitted(15, 67) Source(32, 78) + SourceIndex(0) +9 >Emitted(15, 68) Source(32, 79) + SourceIndex(0) +10>Emitted(15, 70) Source(32, 81) + SourceIndex(0) +11>Emitted(15, 71) Source(32, 82) + SourceIndex(0) +12>Emitted(15, 74) Source(32, 85) + SourceIndex(0) +13>Emitted(15, 75) Source(32, 86) + SourceIndex(0) +14>Emitted(15, 77) Source(32, 88) + SourceIndex(0) +15>Emitted(15, 78) Source(32, 89) + SourceIndex(0) +16>Emitted(15, 80) Source(32, 91) + SourceIndex(0) +17>Emitted(15, 82) Source(32, 93) + SourceIndex(0) +18>Emitted(15, 83) Source(32, 94) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = multiRobot, +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(35, 12) + SourceIndex(0) +5 >Emitted(18, 32) Source(35, 64) + SourceIndex(0) +6 >Emitted(18, 34) Source(35, 22) + SourceIndex(0) +7 >Emitted(18, 55) Source(35, 39) + SourceIndex(0) +8 >Emitted(18, 57) Source(35, 41) + SourceIndex(0) +9 >Emitted(18, 82) Source(35, 62) + SourceIndex(0) +10>Emitted(18, 84) Source(35, 81) + SourceIndex(0) +11>Emitted(18, 85) Source(35, 82) + SourceIndex(0) +12>Emitted(18, 88) Source(35, 85) + SourceIndex(0) +13>Emitted(18, 89) Source(35, 86) + SourceIndex(0) +14>Emitted(18, 91) Source(35, 88) + SourceIndex(0) +15>Emitted(18, 92) Source(35, 89) + SourceIndex(0) +16>Emitted(18, 95) Source(35, 92) + SourceIndex(0) +17>Emitted(18, 96) Source(35, 93) + SourceIndex(0) +18>Emitted(18, 98) Source(35, 95) + SourceIndex(0) +19>Emitted(18, 99) Source(35, 96) + SourceIndex(0) +20>Emitted(18, 101) Source(35, 98) + SourceIndex(0) +21>Emitted(18, 103) Source(35, 100) + SourceIndex(0) +22>Emitted(18, 104) Source(35, 101) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(19, 25) Source(36, 25) + SourceIndex(0) +7 >Emitted(19, 26) Source(36, 26) + SourceIndex(0) +8 >Emitted(19, 27) Source(36, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = getMultiRobot(), +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(21, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(38, 12) + SourceIndex(0) +5 >Emitted(21, 37) Source(38, 64) + SourceIndex(0) +6 >Emitted(21, 39) Source(38, 22) + SourceIndex(0) +7 >Emitted(21, 60) Source(38, 39) + SourceIndex(0) +8 >Emitted(21, 62) Source(38, 41) + SourceIndex(0) +9 >Emitted(21, 87) Source(38, 62) + SourceIndex(0) +10>Emitted(21, 89) Source(38, 86) + SourceIndex(0) +11>Emitted(21, 90) Source(38, 87) + SourceIndex(0) +12>Emitted(21, 93) Source(38, 90) + SourceIndex(0) +13>Emitted(21, 94) Source(38, 91) + SourceIndex(0) +14>Emitted(21, 96) Source(38, 93) + SourceIndex(0) +15>Emitted(21, 97) Source(38, 94) + SourceIndex(0) +16>Emitted(21, 100) Source(38, 97) + SourceIndex(0) +17>Emitted(21, 101) Source(38, 98) + SourceIndex(0) +18>Emitted(21, 103) Source(38, 100) + SourceIndex(0) +19>Emitted(21, 104) Source(38, 101) + SourceIndex(0) +20>Emitted(21, 106) Source(38, 103) + SourceIndex(0) +21>Emitted(21, 108) Source(38, 105) + SourceIndex(0) +22>Emitted(21, 109) Source(38, 106) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(22, 25) Source(39, 25) + SourceIndex(0) +7 >Emitted(22, 26) Source(39, 26) + SourceIndex(0) +8 >Emitted(22, 27) Source(39, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(41, 12) + SourceIndex(0) +5 >Emitted(24, 95) Source(41, 64) + SourceIndex(0) +6 >Emitted(24, 97) Source(41, 22) + SourceIndex(0) +7 >Emitted(24, 118) Source(41, 39) + SourceIndex(0) +8 >Emitted(24, 120) Source(41, 41) + SourceIndex(0) +9 >Emitted(24, 145) Source(41, 62) + SourceIndex(0) +10>Emitted(24, 147) Source(43, 5) + SourceIndex(0) +11>Emitted(24, 148) Source(43, 6) + SourceIndex(0) +12>Emitted(24, 151) Source(43, 9) + SourceIndex(0) +13>Emitted(24, 152) Source(43, 10) + SourceIndex(0) +14>Emitted(24, 154) Source(43, 12) + SourceIndex(0) +15>Emitted(24, 155) Source(43, 13) + SourceIndex(0) +16>Emitted(24, 158) Source(43, 16) + SourceIndex(0) +17>Emitted(24, 159) Source(43, 17) + SourceIndex(0) +18>Emitted(24, 161) Source(43, 19) + SourceIndex(0) +19>Emitted(24, 162) Source(43, 20) + SourceIndex(0) +20>Emitted(24, 164) Source(43, 22) + SourceIndex(0) +21>Emitted(24, 166) Source(43, 24) + SourceIndex(0) +22>Emitted(24, 167) Source(43, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(25, 25) Source(44, 25) + SourceIndex(0) +7 >Emitted(25, 26) Source(44, 26) + SourceIndex(0) +8 >Emitted(25, 27) Source(44, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > , +7 > skill: skillA +8 > } = robot, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(27, 1) Source(47, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(47, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(47, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(47, 11) + SourceIndex(0) +5 >Emitted(27, 28) Source(47, 22) + SourceIndex(0) +6 >Emitted(27, 30) Source(47, 24) + SourceIndex(0) +7 >Emitted(27, 50) Source(47, 37) + SourceIndex(0) +8 >Emitted(27, 52) Source(47, 49) + SourceIndex(0) +9 >Emitted(27, 53) Source(47, 50) + SourceIndex(0) +10>Emitted(27, 56) Source(47, 53) + SourceIndex(0) +11>Emitted(27, 57) Source(47, 54) + SourceIndex(0) +12>Emitted(27, 59) Source(47, 56) + SourceIndex(0) +13>Emitted(27, 60) Source(47, 57) + SourceIndex(0) +14>Emitted(27, 63) Source(47, 60) + SourceIndex(0) +15>Emitted(27, 64) Source(47, 61) + SourceIndex(0) +16>Emitted(27, 66) Source(47, 63) + SourceIndex(0) +17>Emitted(27, 67) Source(47, 64) + SourceIndex(0) +18>Emitted(27, 69) Source(47, 66) + SourceIndex(0) +19>Emitted(27, 71) Source(47, 68) + SourceIndex(0) +20>Emitted(27, 72) Source(47, 69) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(48, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(48, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(48, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(48, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(48, 17) + SourceIndex(0) +6 >Emitted(28, 22) Source(48, 22) + SourceIndex(0) +7 >Emitted(28, 23) Source(48, 23) + SourceIndex(0) +8 >Emitted(28, 24) Source(48, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(49, 2) + SourceIndex(0) +--- +>>>for (var _d = getRobot(), nameA = _d.name, skillA = _d.skill, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skill: skillA } = getRobot() +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(30, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(50, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(50, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(50, 6) + SourceIndex(0) +5 >Emitted(30, 10) Source(50, 6) + SourceIndex(0) +6 >Emitted(30, 25) Source(50, 52) + SourceIndex(0) +7 >Emitted(30, 27) Source(50, 11) + SourceIndex(0) +8 >Emitted(30, 42) Source(50, 22) + SourceIndex(0) +9 >Emitted(30, 44) Source(50, 24) + SourceIndex(0) +10>Emitted(30, 61) Source(50, 37) + SourceIndex(0) +11>Emitted(30, 63) Source(50, 54) + SourceIndex(0) +12>Emitted(30, 64) Source(50, 55) + SourceIndex(0) +13>Emitted(30, 67) Source(50, 58) + SourceIndex(0) +14>Emitted(30, 68) Source(50, 59) + SourceIndex(0) +15>Emitted(30, 70) Source(50, 61) + SourceIndex(0) +16>Emitted(30, 71) Source(50, 62) + SourceIndex(0) +17>Emitted(30, 74) Source(50, 65) + SourceIndex(0) +18>Emitted(30, 75) Source(50, 66) + SourceIndex(0) +19>Emitted(30, 77) Source(50, 68) + SourceIndex(0) +20>Emitted(30, 78) Source(50, 69) + SourceIndex(0) +21>Emitted(30, 80) Source(50, 71) + SourceIndex(0) +22>Emitted(30, 82) Source(50, 73) + SourceIndex(0) +23>Emitted(30, 83) Source(50, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(51, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(51, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(51, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(51, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(51, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(51, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(51, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(51, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(52, 2) + SourceIndex(0) +--- +>>>for (var _e = { name: "trimmer", skill: "trimming" }, nameA = _e.name, skillA = _e.skill, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = { name: "trimmer", skill: "trimming" }, +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { +1->Emitted(33, 1) Source(53, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(53, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(53, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(53, 6) + SourceIndex(0) +5 >Emitted(33, 10) Source(53, 6) + SourceIndex(0) +6 >Emitted(33, 53) Source(53, 87) + SourceIndex(0) +7 >Emitted(33, 55) Source(53, 11) + SourceIndex(0) +8 >Emitted(33, 70) Source(53, 22) + SourceIndex(0) +9 >Emitted(33, 72) Source(53, 24) + SourceIndex(0) +10>Emitted(33, 89) Source(53, 37) + SourceIndex(0) +11>Emitted(33, 91) Source(53, 89) + SourceIndex(0) +12>Emitted(33, 92) Source(53, 90) + SourceIndex(0) +13>Emitted(33, 95) Source(53, 93) + SourceIndex(0) +14>Emitted(33, 96) Source(53, 94) + SourceIndex(0) +15>Emitted(33, 98) Source(53, 96) + SourceIndex(0) +16>Emitted(33, 99) Source(53, 97) + SourceIndex(0) +17>Emitted(33, 102) Source(53, 100) + SourceIndex(0) +18>Emitted(33, 103) Source(53, 101) + SourceIndex(0) +19>Emitted(33, 105) Source(53, 103) + SourceIndex(0) +20>Emitted(33, 106) Source(53, 104) + SourceIndex(0) +21>Emitted(33, 108) Source(53, 106) + SourceIndex(0) +22>Emitted(33, 110) Source(53, 108) + SourceIndex(0) +23>Emitted(33, 111) Source(53, 109) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(54, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(54, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(54, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(54, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(54, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(54, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(54, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(54, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(55, 2) + SourceIndex(0) +--- +>>>for (var nameA = multiRobot.name, _f = multiRobot.skills, primaryA = _f.primary, secondaryA = _f.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA +6 > , +7 > skills: { primary: primaryA, secondary: secondaryA } +8 > +9 > primary: primaryA +10> , +11> secondary: secondaryA +12> } } = multiRobot, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(36, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(56, 11) + SourceIndex(0) +5 >Emitted(36, 33) Source(56, 22) + SourceIndex(0) +6 >Emitted(36, 35) Source(56, 24) + SourceIndex(0) +7 >Emitted(36, 57) Source(56, 76) + SourceIndex(0) +8 >Emitted(36, 59) Source(56, 34) + SourceIndex(0) +9 >Emitted(36, 80) Source(56, 51) + SourceIndex(0) +10>Emitted(36, 82) Source(56, 53) + SourceIndex(0) +11>Emitted(36, 107) Source(56, 74) + SourceIndex(0) +12>Emitted(36, 109) Source(56, 93) + SourceIndex(0) +13>Emitted(36, 110) Source(56, 94) + SourceIndex(0) +14>Emitted(36, 113) Source(56, 97) + SourceIndex(0) +15>Emitted(36, 114) Source(56, 98) + SourceIndex(0) +16>Emitted(36, 116) Source(56, 100) + SourceIndex(0) +17>Emitted(36, 117) Source(56, 101) + SourceIndex(0) +18>Emitted(36, 120) Source(56, 104) + SourceIndex(0) +19>Emitted(36, 121) Source(56, 105) + SourceIndex(0) +20>Emitted(36, 123) Source(56, 107) + SourceIndex(0) +21>Emitted(36, 124) Source(56, 108) + SourceIndex(0) +22>Emitted(36, 126) Source(56, 110) + SourceIndex(0) +23>Emitted(36, 128) Source(56, 112) + SourceIndex(0) +24>Emitted(36, 129) Source(56, 113) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(37, 25) Source(57, 25) + SourceIndex(0) +7 >Emitted(37, 26) Source(57, 26) + SourceIndex(0) +8 >Emitted(37, 27) Source(57, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _g = getMultiRobot(), nameA = _g.name, _h = _g.skills, primaryA = _h.primary, secondaryA = _h.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = getMultiRobot(), +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(39, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(59, 6) + SourceIndex(0) +5 >Emitted(39, 10) Source(59, 6) + SourceIndex(0) +6 >Emitted(39, 30) Source(59, 96) + SourceIndex(0) +7 >Emitted(39, 32) Source(59, 11) + SourceIndex(0) +8 >Emitted(39, 47) Source(59, 22) + SourceIndex(0) +9 >Emitted(39, 49) Source(59, 24) + SourceIndex(0) +10>Emitted(39, 63) Source(59, 76) + SourceIndex(0) +11>Emitted(39, 65) Source(59, 34) + SourceIndex(0) +12>Emitted(39, 86) Source(59, 51) + SourceIndex(0) +13>Emitted(39, 88) Source(59, 53) + SourceIndex(0) +14>Emitted(39, 113) Source(59, 74) + SourceIndex(0) +15>Emitted(39, 115) Source(59, 98) + SourceIndex(0) +16>Emitted(39, 116) Source(59, 99) + SourceIndex(0) +17>Emitted(39, 119) Source(59, 102) + SourceIndex(0) +18>Emitted(39, 120) Source(59, 103) + SourceIndex(0) +19>Emitted(39, 122) Source(59, 105) + SourceIndex(0) +20>Emitted(39, 123) Source(59, 106) + SourceIndex(0) +21>Emitted(39, 126) Source(59, 109) + SourceIndex(0) +22>Emitted(39, 127) Source(59, 110) + SourceIndex(0) +23>Emitted(39, 129) Source(59, 112) + SourceIndex(0) +24>Emitted(39, 130) Source(59, 113) + SourceIndex(0) +25>Emitted(39, 132) Source(59, 115) + SourceIndex(0) +26>Emitted(39, 134) Source(59, 117) + SourceIndex(0) +27>Emitted(39, 135) Source(59, 118) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(60, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(60, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(60, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _j = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _j.name, _k = _j.skills, primaryA = _k.primary, secondaryA = _k.secondary, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(42, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(62, 6) + SourceIndex(0) +5 >Emitted(42, 10) Source(62, 6) + SourceIndex(0) +6 >Emitted(42, 88) Source(63, 90) + SourceIndex(0) +7 >Emitted(42, 90) Source(62, 11) + SourceIndex(0) +8 >Emitted(42, 105) Source(62, 22) + SourceIndex(0) +9 >Emitted(42, 107) Source(62, 24) + SourceIndex(0) +10>Emitted(42, 121) Source(62, 76) + SourceIndex(0) +11>Emitted(42, 123) Source(62, 34) + SourceIndex(0) +12>Emitted(42, 144) Source(62, 51) + SourceIndex(0) +13>Emitted(42, 146) Source(62, 53) + SourceIndex(0) +14>Emitted(42, 171) Source(62, 74) + SourceIndex(0) +15>Emitted(42, 173) Source(64, 5) + SourceIndex(0) +16>Emitted(42, 174) Source(64, 6) + SourceIndex(0) +17>Emitted(42, 177) Source(64, 9) + SourceIndex(0) +18>Emitted(42, 178) Source(64, 10) + SourceIndex(0) +19>Emitted(42, 180) Source(64, 12) + SourceIndex(0) +20>Emitted(42, 181) Source(64, 13) + SourceIndex(0) +21>Emitted(42, 184) Source(64, 16) + SourceIndex(0) +22>Emitted(42, 185) Source(64, 17) + SourceIndex(0) +23>Emitted(42, 187) Source(64, 19) + SourceIndex(0) +24>Emitted(42, 188) Source(64, 20) + SourceIndex(0) +25>Emitted(42, 190) Source(64, 22) + SourceIndex(0) +26>Emitted(42, 192) Source(64, 24) + SourceIndex(0) +27>Emitted(42, 193) Source(64, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(65, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(65, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(65, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(66, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.symbols new file mode 100644 index 00000000000..7037783e9a1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.symbols @@ -0,0 +1,282 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 10)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 32)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 25, 10)) +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 37)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 28, 10)) +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 10)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 51)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 72)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 31, 10)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 39)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 79)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 34, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 39)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 84)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 37, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 39)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 41, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 40, 20)) +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 22)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 47)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 46, 10)) +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 22)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 52)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 49, 10)) +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 22)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 49)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 66)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 87)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 52, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 51)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 91)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 55, 32)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 51)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 96)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 58, 32)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 51)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 62, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern.ts, 61, 32)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types new file mode 100644 index 00000000000..21a7122e564 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types @@ -0,0 +1,374 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>skill : any +>skillA : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>skill : any +>skillA : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>skill : any +>skillA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js new file mode 100644 index 00000000000..f7073765d04 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js @@ -0,0 +1,201 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPattern2.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for ((nameA = robot.name, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_a = getRobot(), nameA = _a.name, _a), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = { name: "trimmer", skill: "trimming" }, nameA = _b.name, _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_c = multiRobot.skills, primaryA = _c.primary, secondaryA = _c.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_d = getMultiRobot(), _e = _d.skills, primaryA = _e.primary, secondaryA = _e.secondary, _d), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_f = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _g = _f.skills, primaryA = _g.primary, secondaryA = _g.secondary, _f), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((name = robot.name, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_h = getRobot(), name = _h.name, _h), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_j = { name: "trimmer", skill: "trimming" }, name = _j.name, _j), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_k = multiRobot.skills, primary = _k.primary, secondary = _k.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_l = getMultiRobot(), _m = _l.skills, primary = _m.primary, secondary = _m.secondary, _l), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_o = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _p = _o.skills, primary = _p.primary, secondary = _p.secondary, _o), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((nameA = robot.name, skillA = robot.skill, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_q = getRobot(), nameA = _q.name, skillA = _q.skill, _q), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_r = { name: "trimmer", skill: "trimming" }, nameA = _r.name, skillA = _r.skill, _r), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((nameA = multiRobot.name, _s = multiRobot.skills, primaryA = _s.primary, secondaryA = _s.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_t = getMultiRobot(), nameA = _t.name, _u = _t.skills, primaryA = _u.primary, secondaryA = _u.secondary, _t), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_v = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _v.name, _w = _v.skills, primaryA = _w.primary, secondaryA = _w.secondary, _v), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((name = robot.name, skill = robot.skill, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_x = getRobot(), name = _x.name, skill = _x.skill, _x), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_y = { name: "trimmer", skill: "trimming" }, name = _y.name, skill = _y.skill, _y), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((name = multiRobot.name, _z = multiRobot.skills, primary = _z.primary, secondary = _z.secondary, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_0 = getMultiRobot(), name = _0.name, _1 = _0.skills, primary = _1.primary, secondary = _1.secondary, _0), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_2 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, name = _2.name, _3 = _2.skills, primary = _3.primary, secondary = _3.secondary, _2), + i = 0; i < 1; i++) { + console.log(primaryA); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map new file mode 100644 index 00000000000..cb6d6d9fe4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAC,CAAE,kBAAW,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA4B,EAA1B,eAAW,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAA+D,EAA7D,eAAW,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAA0E,EAAxE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KACgC;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,iBAAI,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAqB,EAAnB,cAAI,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAAwD,EAAtD,cAAI,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAoD,EAAlD,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KACsD;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAGD,GAAG,CAAC,CAAC,CAAE,kBAAW,EAAE,oBAAa,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA2C,EAAzC,eAAW,EAAE,iBAAa,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAA8E,EAA5E,eAAW,EAAE,iBAAa,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,uBAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAAuF,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,KACmB;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,iBAAI,EAAE,mBAAK,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAA4B,EAA1B,cAAI,EAAE,gBAAK,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAA+D,EAA7D,cAAI,EAAE,gBAAK,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAE,sBAAI,EAAE,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAA0D,EAAxD,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KAAsB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EACoF,EADlF,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS,KACgD;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..3744cc2e7ab --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt @@ -0,0 +1,3073 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(9, 10) Source(26, 18) + SourceIndex(0) +4 >Emitted(9, 12) Source(26, 20) + SourceIndex(0) +5 >Emitted(9, 20) Source(26, 36) + SourceIndex(0) +6 >Emitted(9, 22) Source(26, 38) + SourceIndex(0) +7 >Emitted(9, 32) Source(26, 56) + SourceIndex(0) +8 >Emitted(9, 34) Source(26, 58) + SourceIndex(0) +9 >Emitted(9, 35) Source(26, 67) + SourceIndex(0) +10>Emitted(9, 37) Source(26, 69) + SourceIndex(0) +11>Emitted(9, 43) Source(26, 83) + SourceIndex(0) +12>Emitted(9, 44) Source(26, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(10, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(10, 9) Source(27, 17) + SourceIndex(0) +4 >Emitted(10, 11) Source(27, 19) + SourceIndex(0) +5 >Emitted(10, 18) Source(27, 34) + SourceIndex(0) +6 >Emitted(10, 20) Source(27, 36) + SourceIndex(0) +7 >Emitted(10, 29) Source(27, 53) + SourceIndex(0) +8 >Emitted(10, 31) Source(27, 55) + SourceIndex(0) +9 >Emitted(10, 36) Source(27, 68) + SourceIndex(0) +10>Emitted(10, 37) Source(27, 69) + SourceIndex(0) +--- +>>>for ((nameA = robot.name, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA +7 > } = +8 > robot +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(11, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(11, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(11, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(11, 6) Source(29, 6) + SourceIndex(0) +5 >Emitted(11, 7) Source(29, 8) + SourceIndex(0) +6 >Emitted(11, 25) Source(29, 19) + SourceIndex(0) +7 >Emitted(11, 27) Source(29, 24) + SourceIndex(0) +8 >Emitted(11, 32) Source(29, 29) + SourceIndex(0) +9 >Emitted(11, 33) Source(29, 29) + SourceIndex(0) +10>Emitted(11, 35) Source(29, 31) + SourceIndex(0) +11>Emitted(11, 36) Source(29, 32) + SourceIndex(0) +12>Emitted(11, 39) Source(29, 35) + SourceIndex(0) +13>Emitted(11, 40) Source(29, 36) + SourceIndex(0) +14>Emitted(11, 42) Source(29, 38) + SourceIndex(0) +15>Emitted(11, 43) Source(29, 39) + SourceIndex(0) +16>Emitted(11, 46) Source(29, 42) + SourceIndex(0) +17>Emitted(11, 47) Source(29, 43) + SourceIndex(0) +18>Emitted(11, 49) Source(29, 45) + SourceIndex(0) +19>Emitted(11, 50) Source(29, 46) + SourceIndex(0) +20>Emitted(11, 52) Source(29, 48) + SourceIndex(0) +21>Emitted(11, 54) Source(29, 50) + SourceIndex(0) +22>Emitted(11, 55) Source(29, 51) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for ((_a = getRobot(), nameA = _a.name, _a), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA } = getRobot() +7 > +8 > name: nameA +9 > } = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) +5 >Emitted(14, 7) Source(32, 6) + SourceIndex(0) +6 >Emitted(14, 22) Source(32, 34) + SourceIndex(0) +7 >Emitted(14, 24) Source(32, 8) + SourceIndex(0) +8 >Emitted(14, 39) Source(32, 19) + SourceIndex(0) +9 >Emitted(14, 44) Source(32, 34) + SourceIndex(0) +10>Emitted(14, 46) Source(32, 36) + SourceIndex(0) +11>Emitted(14, 47) Source(32, 37) + SourceIndex(0) +12>Emitted(14, 50) Source(32, 40) + SourceIndex(0) +13>Emitted(14, 51) Source(32, 41) + SourceIndex(0) +14>Emitted(14, 53) Source(32, 43) + SourceIndex(0) +15>Emitted(14, 54) Source(32, 44) + SourceIndex(0) +16>Emitted(14, 57) Source(32, 47) + SourceIndex(0) +17>Emitted(14, 58) Source(32, 48) + SourceIndex(0) +18>Emitted(14, 60) Source(32, 50) + SourceIndex(0) +19>Emitted(14, 61) Source(32, 51) + SourceIndex(0) +20>Emitted(14, 63) Source(32, 53) + SourceIndex(0) +21>Emitted(14, 65) Source(32, 55) + SourceIndex(0) +22>Emitted(14, 66) Source(32, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(16, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for ((_b = { name: "trimmer", skill: "trimming" }, nameA = _b.name, _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA +9 > } = { name: "trimmer", skill: "trimming" } +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(17, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) +5 >Emitted(17, 7) Source(35, 6) + SourceIndex(0) +6 >Emitted(17, 50) Source(35, 69) + SourceIndex(0) +7 >Emitted(17, 52) Source(35, 8) + SourceIndex(0) +8 >Emitted(17, 67) Source(35, 19) + SourceIndex(0) +9 >Emitted(17, 72) Source(35, 69) + SourceIndex(0) +10>Emitted(17, 74) Source(35, 71) + SourceIndex(0) +11>Emitted(17, 75) Source(35, 72) + SourceIndex(0) +12>Emitted(17, 78) Source(35, 75) + SourceIndex(0) +13>Emitted(17, 79) Source(35, 76) + SourceIndex(0) +14>Emitted(17, 81) Source(35, 78) + SourceIndex(0) +15>Emitted(17, 82) Source(35, 79) + SourceIndex(0) +16>Emitted(17, 85) Source(35, 82) + SourceIndex(0) +17>Emitted(17, 86) Source(35, 83) + SourceIndex(0) +18>Emitted(17, 88) Source(35, 85) + SourceIndex(0) +19>Emitted(17, 89) Source(35, 86) + SourceIndex(0) +20>Emitted(17, 91) Source(35, 88) + SourceIndex(0) +21>Emitted(17, 93) Source(35, 90) + SourceIndex(0) +22>Emitted(17, 94) Source(35, 91) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(19, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for ((_c = multiRobot.skills, primaryA = _c.primary, secondaryA = _c.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +11> } } = +12> multiRobot +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 6) + SourceIndex(0) +5 >Emitted(20, 7) Source(38, 8) + SourceIndex(0) +6 >Emitted(20, 29) Source(38, 60) + SourceIndex(0) +7 >Emitted(20, 31) Source(38, 18) + SourceIndex(0) +8 >Emitted(20, 52) Source(38, 35) + SourceIndex(0) +9 >Emitted(20, 54) Source(38, 37) + SourceIndex(0) +10>Emitted(20, 79) Source(38, 58) + SourceIndex(0) +11>Emitted(20, 81) Source(38, 65) + SourceIndex(0) +12>Emitted(20, 91) Source(38, 75) + SourceIndex(0) +13>Emitted(20, 92) Source(38, 75) + SourceIndex(0) +14>Emitted(20, 94) Source(38, 77) + SourceIndex(0) +15>Emitted(20, 95) Source(38, 78) + SourceIndex(0) +16>Emitted(20, 98) Source(38, 81) + SourceIndex(0) +17>Emitted(20, 99) Source(38, 82) + SourceIndex(0) +18>Emitted(20, 101) Source(38, 84) + SourceIndex(0) +19>Emitted(20, 102) Source(38, 85) + SourceIndex(0) +20>Emitted(20, 105) Source(38, 88) + SourceIndex(0) +21>Emitted(20, 106) Source(38, 89) + SourceIndex(0) +22>Emitted(20, 108) Source(38, 91) + SourceIndex(0) +23>Emitted(20, 109) Source(38, 92) + SourceIndex(0) +24>Emitted(20, 111) Source(38, 94) + SourceIndex(0) +25>Emitted(20, 113) Source(38, 96) + SourceIndex(0) +26>Emitted(20, 114) Source(38, 97) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(21, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(21, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(21, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(21, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(21, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(21, 25) Source(39, 25) + SourceIndex(0) +7 >Emitted(21, 26) Source(39, 26) + SourceIndex(0) +8 >Emitted(21, 27) Source(39, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(22, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(22, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for ((_d = getMultiRobot(), _e = _d.skills, primaryA = _e.primary, secondaryA = _e.secondary, _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +7 > +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = getMultiRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(23, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(23, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(23, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(23, 6) Source(41, 6) + SourceIndex(0) +5 >Emitted(23, 7) Source(41, 6) + SourceIndex(0) +6 >Emitted(23, 27) Source(41, 80) + SourceIndex(0) +7 >Emitted(23, 29) Source(41, 8) + SourceIndex(0) +8 >Emitted(23, 43) Source(41, 60) + SourceIndex(0) +9 >Emitted(23, 45) Source(41, 18) + SourceIndex(0) +10>Emitted(23, 66) Source(41, 35) + SourceIndex(0) +11>Emitted(23, 68) Source(41, 37) + SourceIndex(0) +12>Emitted(23, 93) Source(41, 58) + SourceIndex(0) +13>Emitted(23, 98) Source(41, 80) + SourceIndex(0) +14>Emitted(23, 100) Source(41, 82) + SourceIndex(0) +15>Emitted(23, 101) Source(41, 83) + SourceIndex(0) +16>Emitted(23, 104) Source(41, 86) + SourceIndex(0) +17>Emitted(23, 105) Source(41, 87) + SourceIndex(0) +18>Emitted(23, 107) Source(41, 89) + SourceIndex(0) +19>Emitted(23, 108) Source(41, 90) + SourceIndex(0) +20>Emitted(23, 111) Source(41, 93) + SourceIndex(0) +21>Emitted(23, 112) Source(41, 94) + SourceIndex(0) +22>Emitted(23, 114) Source(41, 96) + SourceIndex(0) +23>Emitted(23, 115) Source(41, 97) + SourceIndex(0) +24>Emitted(23, 117) Source(41, 99) + SourceIndex(0) +25>Emitted(23, 119) Source(41, 101) + SourceIndex(0) +26>Emitted(23, 120) Source(41, 102) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(42, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(42, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(42, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(25, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(25, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for ((_f = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _g = _f.skills, primaryA = _g.primary, secondaryA = _g.secondary, _f), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary: primaryA, secondary: secondaryA } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(26, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(44, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(44, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(44, 6) + SourceIndex(0) +5 >Emitted(26, 7) Source(44, 6) + SourceIndex(0) +6 >Emitted(26, 85) Source(45, 90) + SourceIndex(0) +7 >Emitted(26, 87) Source(44, 8) + SourceIndex(0) +8 >Emitted(26, 101) Source(44, 60) + SourceIndex(0) +9 >Emitted(26, 103) Source(44, 18) + SourceIndex(0) +10>Emitted(26, 124) Source(44, 35) + SourceIndex(0) +11>Emitted(26, 126) Source(44, 37) + SourceIndex(0) +12>Emitted(26, 151) Source(44, 58) + SourceIndex(0) +13>Emitted(26, 156) Source(45, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(27, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(27, 6) Source(46, 6) + SourceIndex(0) +3 >Emitted(27, 9) Source(46, 9) + SourceIndex(0) +4 >Emitted(27, 10) Source(46, 10) + SourceIndex(0) +5 >Emitted(27, 12) Source(46, 12) + SourceIndex(0) +6 >Emitted(27, 13) Source(46, 13) + SourceIndex(0) +7 >Emitted(27, 16) Source(46, 16) + SourceIndex(0) +8 >Emitted(27, 17) Source(46, 17) + SourceIndex(0) +9 >Emitted(27, 19) Source(46, 19) + SourceIndex(0) +10>Emitted(27, 20) Source(46, 20) + SourceIndex(0) +11>Emitted(27, 22) Source(46, 22) + SourceIndex(0) +12>Emitted(27, 24) Source(46, 24) + SourceIndex(0) +13>Emitted(27, 25) Source(46, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(28, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(47, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(47, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(47, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for ((name = robot.name, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name +7 > } = +8 > robot +9 > +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(30, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(49, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(49, 8) + SourceIndex(0) +6 >Emitted(30, 24) Source(49, 12) + SourceIndex(0) +7 >Emitted(30, 26) Source(49, 17) + SourceIndex(0) +8 >Emitted(30, 31) Source(49, 22) + SourceIndex(0) +9 >Emitted(30, 32) Source(49, 22) + SourceIndex(0) +10>Emitted(30, 34) Source(49, 24) + SourceIndex(0) +11>Emitted(30, 35) Source(49, 25) + SourceIndex(0) +12>Emitted(30, 38) Source(49, 28) + SourceIndex(0) +13>Emitted(30, 39) Source(49, 29) + SourceIndex(0) +14>Emitted(30, 41) Source(49, 31) + SourceIndex(0) +15>Emitted(30, 42) Source(49, 32) + SourceIndex(0) +16>Emitted(30, 45) Source(49, 35) + SourceIndex(0) +17>Emitted(30, 46) Source(49, 36) + SourceIndex(0) +18>Emitted(30, 48) Source(49, 38) + SourceIndex(0) +19>Emitted(30, 49) Source(49, 39) + SourceIndex(0) +20>Emitted(30, 51) Source(49, 41) + SourceIndex(0) +21>Emitted(30, 53) Source(49, 43) + SourceIndex(0) +22>Emitted(30, 54) Source(49, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for ((_h = getRobot(), name = _h.name, _h), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name } = getRobot() +7 > +8 > name +9 > } = getRobot() +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(33, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(52, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(52, 6) + SourceIndex(0) +6 >Emitted(33, 22) Source(52, 27) + SourceIndex(0) +7 >Emitted(33, 24) Source(52, 8) + SourceIndex(0) +8 >Emitted(33, 38) Source(52, 12) + SourceIndex(0) +9 >Emitted(33, 43) Source(52, 27) + SourceIndex(0) +10>Emitted(33, 45) Source(52, 29) + SourceIndex(0) +11>Emitted(33, 46) Source(52, 30) + SourceIndex(0) +12>Emitted(33, 49) Source(52, 33) + SourceIndex(0) +13>Emitted(33, 50) Source(52, 34) + SourceIndex(0) +14>Emitted(33, 52) Source(52, 36) + SourceIndex(0) +15>Emitted(33, 53) Source(52, 37) + SourceIndex(0) +16>Emitted(33, 56) Source(52, 40) + SourceIndex(0) +17>Emitted(33, 57) Source(52, 41) + SourceIndex(0) +18>Emitted(33, 59) Source(52, 43) + SourceIndex(0) +19>Emitted(33, 60) Source(52, 44) + SourceIndex(0) +20>Emitted(33, 62) Source(52, 46) + SourceIndex(0) +21>Emitted(33, 64) Source(52, 48) + SourceIndex(0) +22>Emitted(33, 65) Source(52, 49) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for ((_j = { name: "trimmer", skill: "trimming" }, name = _j.name, _j), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name } = { name: "trimmer", skill: "trimming" } +7 > +8 > name +9 > } = { name: "trimmer", skill: "trimming" } +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) +22> { +1->Emitted(36, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(55, 6) + SourceIndex(0) +6 >Emitted(36, 50) Source(55, 62) + SourceIndex(0) +7 >Emitted(36, 52) Source(55, 8) + SourceIndex(0) +8 >Emitted(36, 66) Source(55, 12) + SourceIndex(0) +9 >Emitted(36, 71) Source(55, 62) + SourceIndex(0) +10>Emitted(36, 73) Source(55, 64) + SourceIndex(0) +11>Emitted(36, 74) Source(55, 65) + SourceIndex(0) +12>Emitted(36, 77) Source(55, 68) + SourceIndex(0) +13>Emitted(36, 78) Source(55, 69) + SourceIndex(0) +14>Emitted(36, 80) Source(55, 71) + SourceIndex(0) +15>Emitted(36, 81) Source(55, 72) + SourceIndex(0) +16>Emitted(36, 84) Source(55, 75) + SourceIndex(0) +17>Emitted(36, 85) Source(55, 76) + SourceIndex(0) +18>Emitted(36, 87) Source(55, 78) + SourceIndex(0) +19>Emitted(36, 88) Source(55, 79) + SourceIndex(0) +20>Emitted(36, 90) Source(55, 81) + SourceIndex(0) +21>Emitted(36, 92) Source(55, 83) + SourceIndex(0) +22>Emitted(36, 93) Source(55, 84) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for ((_k = multiRobot.skills, primary = _k.primary, secondary = _k.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +11> } } = +12> multiRobot +13> +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(39, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(58, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(58, 8) + SourceIndex(0) +6 >Emitted(39, 29) Source(58, 38) + SourceIndex(0) +7 >Emitted(39, 31) Source(58, 18) + SourceIndex(0) +8 >Emitted(39, 51) Source(58, 25) + SourceIndex(0) +9 >Emitted(39, 53) Source(58, 27) + SourceIndex(0) +10>Emitted(39, 77) Source(58, 36) + SourceIndex(0) +11>Emitted(39, 79) Source(58, 43) + SourceIndex(0) +12>Emitted(39, 89) Source(58, 53) + SourceIndex(0) +13>Emitted(39, 90) Source(58, 53) + SourceIndex(0) +14>Emitted(39, 92) Source(58, 55) + SourceIndex(0) +15>Emitted(39, 93) Source(58, 56) + SourceIndex(0) +16>Emitted(39, 96) Source(58, 59) + SourceIndex(0) +17>Emitted(39, 97) Source(58, 60) + SourceIndex(0) +18>Emitted(39, 99) Source(58, 62) + SourceIndex(0) +19>Emitted(39, 100) Source(58, 63) + SourceIndex(0) +20>Emitted(39, 103) Source(58, 66) + SourceIndex(0) +21>Emitted(39, 104) Source(58, 67) + SourceIndex(0) +22>Emitted(39, 106) Source(58, 69) + SourceIndex(0) +23>Emitted(39, 107) Source(58, 70) + SourceIndex(0) +24>Emitted(39, 109) Source(58, 72) + SourceIndex(0) +25>Emitted(39, 111) Source(58, 74) + SourceIndex(0) +26>Emitted(39, 112) Source(58, 75) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(59, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(59, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(59, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for ((_l = getMultiRobot(), _m = _l.skills, primary = _m.primary, secondary = _m.secondary, _l), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^^ +21> ^ +22> ^^ +23> ^ +24> ^^ +25> ^^ +26> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary, secondary } } = getMultiRobot() +7 > +8 > skills: { primary, secondary } +9 > +10> primary +11> , +12> secondary +13> } } = getMultiRobot() +14> , +15> i +16> = +17> 0 +18> ; +19> i +20> < +21> 1 +22> ; +23> i +24> ++ +25> ) +26> { +1->Emitted(42, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(61, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(61, 6) + SourceIndex(0) +6 >Emitted(42, 27) Source(61, 58) + SourceIndex(0) +7 >Emitted(42, 29) Source(61, 8) + SourceIndex(0) +8 >Emitted(42, 43) Source(61, 38) + SourceIndex(0) +9 >Emitted(42, 45) Source(61, 18) + SourceIndex(0) +10>Emitted(42, 65) Source(61, 25) + SourceIndex(0) +11>Emitted(42, 67) Source(61, 27) + SourceIndex(0) +12>Emitted(42, 91) Source(61, 36) + SourceIndex(0) +13>Emitted(42, 96) Source(61, 58) + SourceIndex(0) +14>Emitted(42, 98) Source(61, 60) + SourceIndex(0) +15>Emitted(42, 99) Source(61, 61) + SourceIndex(0) +16>Emitted(42, 102) Source(61, 64) + SourceIndex(0) +17>Emitted(42, 103) Source(61, 65) + SourceIndex(0) +18>Emitted(42, 105) Source(61, 67) + SourceIndex(0) +19>Emitted(42, 106) Source(61, 68) + SourceIndex(0) +20>Emitted(42, 109) Source(61, 71) + SourceIndex(0) +21>Emitted(42, 110) Source(61, 72) + SourceIndex(0) +22>Emitted(42, 112) Source(61, 74) + SourceIndex(0) +23>Emitted(42, 113) Source(61, 75) + SourceIndex(0) +24>Emitted(42, 115) Source(61, 77) + SourceIndex(0) +25>Emitted(42, 117) Source(61, 79) + SourceIndex(0) +26>Emitted(42, 118) Source(61, 80) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(62, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(62, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(62, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for ((_o = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _p = _o.skills, primary = _p.primary, secondary = _p.secondary, _o), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { skills: { primary, secondary } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { primary, secondary } +9 > +10> primary +11> , +12> secondary +13> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(45, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(64, 6) + SourceIndex(0) +6 >Emitted(45, 85) Source(65, 90) + SourceIndex(0) +7 >Emitted(45, 87) Source(64, 8) + SourceIndex(0) +8 >Emitted(45, 101) Source(64, 38) + SourceIndex(0) +9 >Emitted(45, 103) Source(64, 18) + SourceIndex(0) +10>Emitted(45, 123) Source(64, 25) + SourceIndex(0) +11>Emitted(45, 125) Source(64, 27) + SourceIndex(0) +12>Emitted(45, 149) Source(64, 36) + SourceIndex(0) +13>Emitted(45, 154) Source(65, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(46, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(46, 6) Source(66, 6) + SourceIndex(0) +3 >Emitted(46, 9) Source(66, 9) + SourceIndex(0) +4 >Emitted(46, 10) Source(66, 10) + SourceIndex(0) +5 >Emitted(46, 12) Source(66, 12) + SourceIndex(0) +6 >Emitted(46, 13) Source(66, 13) + SourceIndex(0) +7 >Emitted(46, 16) Source(66, 16) + SourceIndex(0) +8 >Emitted(46, 17) Source(66, 17) + SourceIndex(0) +9 >Emitted(46, 19) Source(66, 19) + SourceIndex(0) +10>Emitted(46, 20) Source(66, 20) + SourceIndex(0) +11>Emitted(46, 22) Source(66, 22) + SourceIndex(0) +12>Emitted(46, 24) Source(66, 24) + SourceIndex(0) +13>Emitted(46, 25) Source(66, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(47, 5) Source(67, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(67, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(67, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(67, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(67, 17) + SourceIndex(0) +6 >Emitted(47, 25) Source(67, 25) + SourceIndex(0) +7 >Emitted(47, 26) Source(67, 26) + SourceIndex(0) +8 >Emitted(47, 27) Source(67, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(68, 2) + SourceIndex(0) +--- +>>>for ((nameA = robot.name, skillA = robot.skill, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA +7 > , +8 > skill: skillA +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(49, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(71, 6) + SourceIndex(0) +5 >Emitted(49, 7) Source(71, 8) + SourceIndex(0) +6 >Emitted(49, 25) Source(71, 19) + SourceIndex(0) +7 >Emitted(49, 27) Source(71, 21) + SourceIndex(0) +8 >Emitted(49, 47) Source(71, 34) + SourceIndex(0) +9 >Emitted(49, 49) Source(71, 39) + SourceIndex(0) +10>Emitted(49, 54) Source(71, 44) + SourceIndex(0) +11>Emitted(49, 55) Source(71, 44) + SourceIndex(0) +12>Emitted(49, 57) Source(71, 46) + SourceIndex(0) +13>Emitted(49, 58) Source(71, 47) + SourceIndex(0) +14>Emitted(49, 61) Source(71, 50) + SourceIndex(0) +15>Emitted(49, 62) Source(71, 51) + SourceIndex(0) +16>Emitted(49, 64) Source(71, 53) + SourceIndex(0) +17>Emitted(49, 65) Source(71, 54) + SourceIndex(0) +18>Emitted(49, 68) Source(71, 57) + SourceIndex(0) +19>Emitted(49, 69) Source(71, 58) + SourceIndex(0) +20>Emitted(49, 71) Source(71, 60) + SourceIndex(0) +21>Emitted(49, 72) Source(71, 61) + SourceIndex(0) +22>Emitted(49, 74) Source(71, 63) + SourceIndex(0) +23>Emitted(49, 76) Source(71, 65) + SourceIndex(0) +24>Emitted(49, 77) Source(71, 66) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(50, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(50, 22) Source(72, 22) + SourceIndex(0) +7 >Emitted(50, 23) Source(72, 23) + SourceIndex(0) +8 >Emitted(50, 24) Source(72, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for ((_q = getRobot(), nameA = _q.name, skillA = _q.skill, _q), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skill: skillA } = getRobot() +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(52, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(74, 6) + SourceIndex(0) +5 >Emitted(52, 7) Source(74, 6) + SourceIndex(0) +6 >Emitted(52, 22) Source(74, 49) + SourceIndex(0) +7 >Emitted(52, 24) Source(74, 8) + SourceIndex(0) +8 >Emitted(52, 39) Source(74, 19) + SourceIndex(0) +9 >Emitted(52, 41) Source(74, 21) + SourceIndex(0) +10>Emitted(52, 58) Source(74, 34) + SourceIndex(0) +11>Emitted(52, 63) Source(74, 49) + SourceIndex(0) +12>Emitted(52, 65) Source(74, 51) + SourceIndex(0) +13>Emitted(52, 66) Source(74, 52) + SourceIndex(0) +14>Emitted(52, 69) Source(74, 55) + SourceIndex(0) +15>Emitted(52, 70) Source(74, 56) + SourceIndex(0) +16>Emitted(52, 72) Source(74, 58) + SourceIndex(0) +17>Emitted(52, 73) Source(74, 59) + SourceIndex(0) +18>Emitted(52, 76) Source(74, 62) + SourceIndex(0) +19>Emitted(52, 77) Source(74, 63) + SourceIndex(0) +20>Emitted(52, 79) Source(74, 65) + SourceIndex(0) +21>Emitted(52, 80) Source(74, 66) + SourceIndex(0) +22>Emitted(52, 82) Source(74, 68) + SourceIndex(0) +23>Emitted(52, 84) Source(74, 70) + SourceIndex(0) +24>Emitted(52, 85) Source(74, 71) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(75, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(75, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(75, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for ((_r = { name: "trimmer", skill: "trimming" }, nameA = _r.name, skillA = _r.skill, _r), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA +9 > , +10> skill: skillA +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(55, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(55, 7) Source(77, 6) + SourceIndex(0) +6 >Emitted(55, 50) Source(77, 84) + SourceIndex(0) +7 >Emitted(55, 52) Source(77, 8) + SourceIndex(0) +8 >Emitted(55, 67) Source(77, 19) + SourceIndex(0) +9 >Emitted(55, 69) Source(77, 21) + SourceIndex(0) +10>Emitted(55, 86) Source(77, 34) + SourceIndex(0) +11>Emitted(55, 91) Source(77, 84) + SourceIndex(0) +12>Emitted(55, 93) Source(77, 86) + SourceIndex(0) +13>Emitted(55, 94) Source(77, 87) + SourceIndex(0) +14>Emitted(55, 97) Source(77, 90) + SourceIndex(0) +15>Emitted(55, 98) Source(77, 91) + SourceIndex(0) +16>Emitted(55, 100) Source(77, 93) + SourceIndex(0) +17>Emitted(55, 101) Source(77, 94) + SourceIndex(0) +18>Emitted(55, 104) Source(77, 97) + SourceIndex(0) +19>Emitted(55, 105) Source(77, 98) + SourceIndex(0) +20>Emitted(55, 107) Source(77, 100) + SourceIndex(0) +21>Emitted(55, 108) Source(77, 101) + SourceIndex(0) +22>Emitted(55, 110) Source(77, 103) + SourceIndex(0) +23>Emitted(55, 112) Source(77, 105) + SourceIndex(0) +24>Emitted(55, 113) Source(77, 106) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(56, 22) Source(78, 22) + SourceIndex(0) +7 >Emitted(56, 23) Source(78, 23) + SourceIndex(0) +8 >Emitted(56, 24) Source(78, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for ((nameA = multiRobot.name, _s = multiRobot.skills, primaryA = _s.primary, secondaryA = _s.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA +7 > , +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = +14> multiRobot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(58, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(80, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(80, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(80, 6) + SourceIndex(0) +5 >Emitted(58, 7) Source(80, 8) + SourceIndex(0) +6 >Emitted(58, 30) Source(80, 19) + SourceIndex(0) +7 >Emitted(58, 32) Source(80, 21) + SourceIndex(0) +8 >Emitted(58, 54) Source(80, 73) + SourceIndex(0) +9 >Emitted(58, 56) Source(80, 31) + SourceIndex(0) +10>Emitted(58, 77) Source(80, 48) + SourceIndex(0) +11>Emitted(58, 79) Source(80, 50) + SourceIndex(0) +12>Emitted(58, 104) Source(80, 71) + SourceIndex(0) +13>Emitted(58, 106) Source(80, 78) + SourceIndex(0) +14>Emitted(58, 116) Source(80, 88) + SourceIndex(0) +15>Emitted(58, 117) Source(80, 88) + SourceIndex(0) +16>Emitted(58, 119) Source(80, 90) + SourceIndex(0) +17>Emitted(58, 120) Source(80, 91) + SourceIndex(0) +18>Emitted(58, 123) Source(80, 94) + SourceIndex(0) +19>Emitted(58, 124) Source(80, 95) + SourceIndex(0) +20>Emitted(58, 126) Source(80, 97) + SourceIndex(0) +21>Emitted(58, 127) Source(80, 98) + SourceIndex(0) +22>Emitted(58, 130) Source(80, 101) + SourceIndex(0) +23>Emitted(58, 131) Source(80, 102) + SourceIndex(0) +24>Emitted(58, 133) Source(80, 104) + SourceIndex(0) +25>Emitted(58, 134) Source(80, 105) + SourceIndex(0) +26>Emitted(58, 136) Source(80, 107) + SourceIndex(0) +27>Emitted(58, 138) Source(80, 109) + SourceIndex(0) +28>Emitted(58, 139) Source(80, 110) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(81, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(81, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(81, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(81, 17) + SourceIndex(0) +6 >Emitted(59, 25) Source(81, 25) + SourceIndex(0) +7 >Emitted(59, 26) Source(81, 26) + SourceIndex(0) +8 >Emitted(59, 27) Source(81, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(82, 2) + SourceIndex(0) +--- +>>>for ((_t = getMultiRobot(), nameA = _t.name, _u = _t.skills, primaryA = _u.primary, secondaryA = _u.secondary, _t), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = getMultiRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(61, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(83, 6) + SourceIndex(0) +5 >Emitted(61, 7) Source(83, 6) + SourceIndex(0) +6 >Emitted(61, 27) Source(83, 93) + SourceIndex(0) +7 >Emitted(61, 29) Source(83, 8) + SourceIndex(0) +8 >Emitted(61, 44) Source(83, 19) + SourceIndex(0) +9 >Emitted(61, 46) Source(83, 21) + SourceIndex(0) +10>Emitted(61, 60) Source(83, 73) + SourceIndex(0) +11>Emitted(61, 62) Source(83, 31) + SourceIndex(0) +12>Emitted(61, 83) Source(83, 48) + SourceIndex(0) +13>Emitted(61, 85) Source(83, 50) + SourceIndex(0) +14>Emitted(61, 110) Source(83, 71) + SourceIndex(0) +15>Emitted(61, 115) Source(83, 93) + SourceIndex(0) +16>Emitted(61, 117) Source(83, 95) + SourceIndex(0) +17>Emitted(61, 118) Source(83, 96) + SourceIndex(0) +18>Emitted(61, 121) Source(83, 99) + SourceIndex(0) +19>Emitted(61, 122) Source(83, 100) + SourceIndex(0) +20>Emitted(61, 124) Source(83, 102) + SourceIndex(0) +21>Emitted(61, 125) Source(83, 103) + SourceIndex(0) +22>Emitted(61, 128) Source(83, 106) + SourceIndex(0) +23>Emitted(61, 129) Source(83, 107) + SourceIndex(0) +24>Emitted(61, 131) Source(83, 109) + SourceIndex(0) +25>Emitted(61, 132) Source(83, 110) + SourceIndex(0) +26>Emitted(61, 134) Source(83, 112) + SourceIndex(0) +27>Emitted(61, 136) Source(83, 114) + SourceIndex(0) +28>Emitted(61, 137) Source(83, 115) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(84, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(84, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(84, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(84, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(84, 17) + SourceIndex(0) +6 >Emitted(62, 25) Source(84, 25) + SourceIndex(0) +7 >Emitted(62, 26) Source(84, 26) + SourceIndex(0) +8 >Emitted(62, 27) Source(84, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(85, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(85, 2) + SourceIndex(0) +--- +>>>for ((_v = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _v.name, _w = _v.skills, primaryA = _w.primary, secondaryA = _w.secondary, _v), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA +9 > , +10> skills: { primary: primaryA, secondary: secondaryA } +11> +12> primary: primaryA +13> , +14> secondary: secondaryA +15> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(64, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(86, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(86, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(86, 6) + SourceIndex(0) +5 >Emitted(64, 7) Source(86, 6) + SourceIndex(0) +6 >Emitted(64, 85) Source(87, 90) + SourceIndex(0) +7 >Emitted(64, 87) Source(86, 8) + SourceIndex(0) +8 >Emitted(64, 102) Source(86, 19) + SourceIndex(0) +9 >Emitted(64, 104) Source(86, 21) + SourceIndex(0) +10>Emitted(64, 118) Source(86, 73) + SourceIndex(0) +11>Emitted(64, 120) Source(86, 31) + SourceIndex(0) +12>Emitted(64, 141) Source(86, 48) + SourceIndex(0) +13>Emitted(64, 143) Source(86, 50) + SourceIndex(0) +14>Emitted(64, 168) Source(86, 71) + SourceIndex(0) +15>Emitted(64, 173) Source(87, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(65, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(65, 6) Source(88, 6) + SourceIndex(0) +3 >Emitted(65, 9) Source(88, 9) + SourceIndex(0) +4 >Emitted(65, 10) Source(88, 10) + SourceIndex(0) +5 >Emitted(65, 12) Source(88, 12) + SourceIndex(0) +6 >Emitted(65, 13) Source(88, 13) + SourceIndex(0) +7 >Emitted(65, 16) Source(88, 16) + SourceIndex(0) +8 >Emitted(65, 17) Source(88, 17) + SourceIndex(0) +9 >Emitted(65, 19) Source(88, 19) + SourceIndex(0) +10>Emitted(65, 20) Source(88, 20) + SourceIndex(0) +11>Emitted(65, 22) Source(88, 22) + SourceIndex(0) +12>Emitted(65, 24) Source(88, 24) + SourceIndex(0) +13>Emitted(65, 25) Source(88, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(66, 5) Source(89, 5) + SourceIndex(0) +2 >Emitted(66, 12) Source(89, 12) + SourceIndex(0) +3 >Emitted(66, 13) Source(89, 13) + SourceIndex(0) +4 >Emitted(66, 16) Source(89, 16) + SourceIndex(0) +5 >Emitted(66, 17) Source(89, 17) + SourceIndex(0) +6 >Emitted(66, 25) Source(89, 25) + SourceIndex(0) +7 >Emitted(66, 26) Source(89, 26) + SourceIndex(0) +8 >Emitted(66, 27) Source(89, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(67, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(67, 2) Source(90, 2) + SourceIndex(0) +--- +>>>for ((name = robot.name, skill = robot.skill, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name +7 > , +8 > skill +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(68, 1) Source(91, 1) + SourceIndex(0) +2 >Emitted(68, 4) Source(91, 4) + SourceIndex(0) +3 >Emitted(68, 5) Source(91, 5) + SourceIndex(0) +4 >Emitted(68, 6) Source(91, 6) + SourceIndex(0) +5 >Emitted(68, 7) Source(91, 8) + SourceIndex(0) +6 >Emitted(68, 24) Source(91, 12) + SourceIndex(0) +7 >Emitted(68, 26) Source(91, 14) + SourceIndex(0) +8 >Emitted(68, 45) Source(91, 19) + SourceIndex(0) +9 >Emitted(68, 47) Source(91, 24) + SourceIndex(0) +10>Emitted(68, 52) Source(91, 29) + SourceIndex(0) +11>Emitted(68, 53) Source(91, 29) + SourceIndex(0) +12>Emitted(68, 55) Source(91, 31) + SourceIndex(0) +13>Emitted(68, 56) Source(91, 32) + SourceIndex(0) +14>Emitted(68, 59) Source(91, 35) + SourceIndex(0) +15>Emitted(68, 60) Source(91, 36) + SourceIndex(0) +16>Emitted(68, 62) Source(91, 38) + SourceIndex(0) +17>Emitted(68, 63) Source(91, 39) + SourceIndex(0) +18>Emitted(68, 66) Source(91, 42) + SourceIndex(0) +19>Emitted(68, 67) Source(91, 43) + SourceIndex(0) +20>Emitted(68, 69) Source(91, 45) + SourceIndex(0) +21>Emitted(68, 70) Source(91, 46) + SourceIndex(0) +22>Emitted(68, 72) Source(91, 48) + SourceIndex(0) +23>Emitted(68, 74) Source(91, 50) + SourceIndex(0) +24>Emitted(68, 75) Source(91, 51) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(69, 5) Source(92, 5) + SourceIndex(0) +2 >Emitted(69, 12) Source(92, 12) + SourceIndex(0) +3 >Emitted(69, 13) Source(92, 13) + SourceIndex(0) +4 >Emitted(69, 16) Source(92, 16) + SourceIndex(0) +5 >Emitted(69, 17) Source(92, 17) + SourceIndex(0) +6 >Emitted(69, 22) Source(92, 22) + SourceIndex(0) +7 >Emitted(69, 23) Source(92, 23) + SourceIndex(0) +8 >Emitted(69, 24) Source(92, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(70, 1) Source(93, 1) + SourceIndex(0) +2 >Emitted(70, 2) Source(93, 2) + SourceIndex(0) +--- +>>>for ((_x = getRobot(), name = _x.name, skill = _x.skill, _x), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skill } = getRobot() +7 > +8 > name +9 > , +10> skill +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(71, 1) Source(94, 1) + SourceIndex(0) +2 >Emitted(71, 4) Source(94, 4) + SourceIndex(0) +3 >Emitted(71, 5) Source(94, 5) + SourceIndex(0) +4 >Emitted(71, 6) Source(94, 6) + SourceIndex(0) +5 >Emitted(71, 7) Source(94, 6) + SourceIndex(0) +6 >Emitted(71, 22) Source(94, 34) + SourceIndex(0) +7 >Emitted(71, 24) Source(94, 8) + SourceIndex(0) +8 >Emitted(71, 38) Source(94, 12) + SourceIndex(0) +9 >Emitted(71, 40) Source(94, 14) + SourceIndex(0) +10>Emitted(71, 56) Source(94, 19) + SourceIndex(0) +11>Emitted(71, 61) Source(94, 34) + SourceIndex(0) +12>Emitted(71, 63) Source(94, 36) + SourceIndex(0) +13>Emitted(71, 64) Source(94, 37) + SourceIndex(0) +14>Emitted(71, 67) Source(94, 40) + SourceIndex(0) +15>Emitted(71, 68) Source(94, 41) + SourceIndex(0) +16>Emitted(71, 70) Source(94, 43) + SourceIndex(0) +17>Emitted(71, 71) Source(94, 44) + SourceIndex(0) +18>Emitted(71, 74) Source(94, 47) + SourceIndex(0) +19>Emitted(71, 75) Source(94, 48) + SourceIndex(0) +20>Emitted(71, 77) Source(94, 50) + SourceIndex(0) +21>Emitted(71, 78) Source(94, 51) + SourceIndex(0) +22>Emitted(71, 80) Source(94, 53) + SourceIndex(0) +23>Emitted(71, 82) Source(94, 55) + SourceIndex(0) +24>Emitted(71, 83) Source(94, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(95, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(95, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(95, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(95, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(95, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(95, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(95, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(73, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(73, 2) Source(96, 2) + SourceIndex(0) +--- +>>>for ((_y = { name: "trimmer", skill: "trimming" }, name = _y.name, skill = _y.skill, _y), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skill } = { name: "trimmer", skill: "trimming" } +7 > +8 > name +9 > , +10> skill +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(74, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(97, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(97, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(97, 6) + SourceIndex(0) +5 >Emitted(74, 7) Source(97, 6) + SourceIndex(0) +6 >Emitted(74, 50) Source(97, 69) + SourceIndex(0) +7 >Emitted(74, 52) Source(97, 8) + SourceIndex(0) +8 >Emitted(74, 66) Source(97, 12) + SourceIndex(0) +9 >Emitted(74, 68) Source(97, 14) + SourceIndex(0) +10>Emitted(74, 84) Source(97, 19) + SourceIndex(0) +11>Emitted(74, 89) Source(97, 69) + SourceIndex(0) +12>Emitted(74, 91) Source(97, 71) + SourceIndex(0) +13>Emitted(74, 92) Source(97, 72) + SourceIndex(0) +14>Emitted(74, 95) Source(97, 75) + SourceIndex(0) +15>Emitted(74, 96) Source(97, 76) + SourceIndex(0) +16>Emitted(74, 98) Source(97, 78) + SourceIndex(0) +17>Emitted(74, 99) Source(97, 79) + SourceIndex(0) +18>Emitted(74, 102) Source(97, 82) + SourceIndex(0) +19>Emitted(74, 103) Source(97, 83) + SourceIndex(0) +20>Emitted(74, 105) Source(97, 85) + SourceIndex(0) +21>Emitted(74, 106) Source(97, 86) + SourceIndex(0) +22>Emitted(74, 108) Source(97, 88) + SourceIndex(0) +23>Emitted(74, 110) Source(97, 90) + SourceIndex(0) +24>Emitted(74, 111) Source(97, 91) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(98, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(98, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(98, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(98, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(98, 17) + SourceIndex(0) +6 >Emitted(75, 22) Source(98, 22) + SourceIndex(0) +7 >Emitted(75, 23) Source(98, 23) + SourceIndex(0) +8 >Emitted(75, 24) Source(98, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(76, 1) Source(99, 1) + SourceIndex(0) +2 >Emitted(76, 2) Source(99, 2) + SourceIndex(0) +--- +>>>for ((name = multiRobot.name, _z = multiRobot.skills, primary = _z.primary, secondary = _z.secondary, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { +6 > name +7 > , +8 > skills: { primary, secondary } +9 > +10> primary +11> , +12> secondary +13> } } = +14> multiRobot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(77, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(100, 6) + SourceIndex(0) +5 >Emitted(77, 7) Source(100, 8) + SourceIndex(0) +6 >Emitted(77, 29) Source(100, 12) + SourceIndex(0) +7 >Emitted(77, 31) Source(100, 14) + SourceIndex(0) +8 >Emitted(77, 53) Source(100, 44) + SourceIndex(0) +9 >Emitted(77, 55) Source(100, 24) + SourceIndex(0) +10>Emitted(77, 75) Source(100, 31) + SourceIndex(0) +11>Emitted(77, 77) Source(100, 33) + SourceIndex(0) +12>Emitted(77, 101) Source(100, 42) + SourceIndex(0) +13>Emitted(77, 103) Source(100, 49) + SourceIndex(0) +14>Emitted(77, 113) Source(100, 59) + SourceIndex(0) +15>Emitted(77, 114) Source(100, 59) + SourceIndex(0) +16>Emitted(77, 116) Source(100, 61) + SourceIndex(0) +17>Emitted(77, 117) Source(100, 62) + SourceIndex(0) +18>Emitted(77, 120) Source(100, 65) + SourceIndex(0) +19>Emitted(77, 121) Source(100, 66) + SourceIndex(0) +20>Emitted(77, 123) Source(100, 68) + SourceIndex(0) +21>Emitted(77, 124) Source(100, 69) + SourceIndex(0) +22>Emitted(77, 127) Source(100, 72) + SourceIndex(0) +23>Emitted(77, 128) Source(100, 73) + SourceIndex(0) +24>Emitted(77, 130) Source(100, 75) + SourceIndex(0) +25>Emitted(77, 131) Source(100, 76) + SourceIndex(0) +26>Emitted(77, 133) Source(100, 78) + SourceIndex(0) +27>Emitted(77, 135) Source(100, 80) + SourceIndex(0) +28>Emitted(77, 136) Source(100, 81) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(78, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(78, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(78, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(78, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(78, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(78, 25) Source(101, 25) + SourceIndex(0) +7 >Emitted(78, 26) Source(101, 26) + SourceIndex(0) +8 >Emitted(78, 27) Source(101, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(79, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(79, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for ((_0 = getMultiRobot(), name = _0.name, _1 = _0.skills, primary = _1.primary, secondary = _1.secondary, _0), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skills: { primary, secondary } } = getMultiRobot() +7 > +8 > name +9 > , +10> skills: { primary, secondary } +11> +12> primary +13> , +14> secondary +15> } } = getMultiRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(80, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(80, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(80, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(80, 6) Source(103, 6) + SourceIndex(0) +5 >Emitted(80, 7) Source(103, 6) + SourceIndex(0) +6 >Emitted(80, 27) Source(103, 64) + SourceIndex(0) +7 >Emitted(80, 29) Source(103, 8) + SourceIndex(0) +8 >Emitted(80, 43) Source(103, 12) + SourceIndex(0) +9 >Emitted(80, 45) Source(103, 14) + SourceIndex(0) +10>Emitted(80, 59) Source(103, 44) + SourceIndex(0) +11>Emitted(80, 61) Source(103, 24) + SourceIndex(0) +12>Emitted(80, 81) Source(103, 31) + SourceIndex(0) +13>Emitted(80, 83) Source(103, 33) + SourceIndex(0) +14>Emitted(80, 107) Source(103, 42) + SourceIndex(0) +15>Emitted(80, 112) Source(103, 64) + SourceIndex(0) +16>Emitted(80, 114) Source(103, 66) + SourceIndex(0) +17>Emitted(80, 115) Source(103, 67) + SourceIndex(0) +18>Emitted(80, 118) Source(103, 70) + SourceIndex(0) +19>Emitted(80, 119) Source(103, 71) + SourceIndex(0) +20>Emitted(80, 121) Source(103, 73) + SourceIndex(0) +21>Emitted(80, 122) Source(103, 74) + SourceIndex(0) +22>Emitted(80, 125) Source(103, 77) + SourceIndex(0) +23>Emitted(80, 126) Source(103, 78) + SourceIndex(0) +24>Emitted(80, 128) Source(103, 80) + SourceIndex(0) +25>Emitted(80, 129) Source(103, 81) + SourceIndex(0) +26>Emitted(80, 131) Source(103, 83) + SourceIndex(0) +27>Emitted(80, 133) Source(103, 85) + SourceIndex(0) +28>Emitted(80, 134) Source(103, 86) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(81, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(81, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(81, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(81, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(81, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(81, 25) Source(104, 25) + SourceIndex(0) +7 >Emitted(81, 26) Source(104, 26) + SourceIndex(0) +8 >Emitted(81, 27) Source(104, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(82, 1) Source(105, 1) + SourceIndex(0) +2 >Emitted(82, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for ((_2 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, name = _2.name, _3 = _2.skills, primary = _3.primary, secondary = _3.secondary, _2), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name, skills: { primary, secondary } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name +9 > , +10> skills: { primary, secondary } +11> +12> primary +13> , +14> secondary +15> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(83, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(83, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(83, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(83, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(83, 7) Source(106, 6) + SourceIndex(0) +6 >Emitted(83, 85) Source(107, 90) + SourceIndex(0) +7 >Emitted(83, 87) Source(106, 8) + SourceIndex(0) +8 >Emitted(83, 101) Source(106, 12) + SourceIndex(0) +9 >Emitted(83, 103) Source(106, 14) + SourceIndex(0) +10>Emitted(83, 117) Source(106, 44) + SourceIndex(0) +11>Emitted(83, 119) Source(106, 24) + SourceIndex(0) +12>Emitted(83, 139) Source(106, 31) + SourceIndex(0) +13>Emitted(83, 141) Source(106, 33) + SourceIndex(0) +14>Emitted(83, 165) Source(106, 42) + SourceIndex(0) +15>Emitted(83, 170) Source(107, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(84, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(84, 6) Source(108, 6) + SourceIndex(0) +3 >Emitted(84, 9) Source(108, 9) + SourceIndex(0) +4 >Emitted(84, 10) Source(108, 10) + SourceIndex(0) +5 >Emitted(84, 12) Source(108, 12) + SourceIndex(0) +6 >Emitted(84, 13) Source(108, 13) + SourceIndex(0) +7 >Emitted(84, 16) Source(108, 16) + SourceIndex(0) +8 >Emitted(84, 17) Source(108, 17) + SourceIndex(0) +9 >Emitted(84, 19) Source(108, 19) + SourceIndex(0) +10>Emitted(84, 20) Source(108, 20) + SourceIndex(0) +11>Emitted(84, 22) Source(108, 22) + SourceIndex(0) +12>Emitted(84, 24) Source(108, 24) + SourceIndex(0) +13>Emitted(84, 25) Source(108, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(85, 5) Source(109, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(109, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(109, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(109, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(109, 17) + SourceIndex(0) +6 >Emitted(85, 25) Source(109, 25) + SourceIndex(0) +7 >Emitted(85, 26) Source(109, 26) + SourceIndex(0) +8 >Emitted(85, 27) Source(109, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(86, 1) Source(110, 1) + SourceIndex(0) +2 >Emitted(86, 2) Source(110, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.symbols new file mode 100644 index 00000000000..49de55505a2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.symbols @@ -0,0 +1,490 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 11, 24)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 26, 53)) + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 28, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 34, 31)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 34, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 37, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 37, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 37, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 40, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 40, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 40, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 43, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 43, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 43, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 44, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 48, 6)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 51, 6)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 54, 6)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 54, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 54, 41)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 57, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 57, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 57, 25)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 60, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 60, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 60, 25)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ skills: { primary, secondary } } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 63, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 63, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 63, 25)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 64, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 70, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 70, 19)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 73, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 73, 19)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 19)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 67)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 46)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 76, 63)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 19)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 29)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 79, 48)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 19)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 29)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 82, 48)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 19)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 29)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 85, 48)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 36)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 86, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 90, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 90, 12)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 93, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 93, 12)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 12)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 31)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 96, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 3)) +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 12)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 22)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 99, 31)) +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 12)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 22)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 102, 31)) +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} +for ({ name, skills: { primary, secondary } } = +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 12)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 22)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 105, 31)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 106, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPattern2.ts, 25, 18)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types new file mode 100644 index 00000000000..81beb06d3d7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types @@ -0,0 +1,774 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { +>{ name: nameA } = robot, i = 0 : number +>{ name: nameA } = robot : Robot +>{ name: nameA } : { name: string; } +>name : string +>nameA : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { +>{ name: nameA } = getRobot(), i = 0 : number +>{ name: nameA } = getRobot() : Robot +>{ name: nameA } : { name: string; } +>name : string +>nameA : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA } = { name: "trimmer", skill: "trimming" } : Robot +>{ name: nameA } : { name: string; } +>name : string +>nameA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = +>{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name } = robot, i = 0; i < 1; i++) { +>{ name } = robot, i = 0 : number +>{ name } = robot : Robot +>{ name } : { name: string; } +>name : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { +>{ name } = getRobot(), i = 0 : number +>{ name } = getRobot() : Robot +>{ name } : { name: string; } +>name : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name } = { name: "trimmer", skill: "trimming" } : Robot +>{ name } : { name: string; } +>name : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>{ skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ skills: { primary, secondary } } = multiRobot : MultiRobot +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ skills: { primary, secondary } } = getMultiRobot() : MultiRobot +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } = +>{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +>{ name: nameA, skill: skillA } = robot, i = 0 : number +>{ name: nameA, skill: skillA } = robot : Robot +>{ name: nameA, skill: skillA } : { name: string; skill: string; } +>name : string +>nameA : string +>skill : string +>skillA : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +>{ name: nameA, skill: skillA } = getRobot(), i = 0 : number +>{ name: nameA, skill: skillA } = getRobot() : Robot +>{ name: nameA, skill: skillA } : { name: string; skill: string; } +>name : string +>nameA : string +>skill : string +>skillA : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } : Robot +>{ name: nameA, skill: skillA } : { name: string; skill: string; } +>name : string +>nameA : string +>skill : string +>skillA : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>nameA : string +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>nameA : string +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>nameA : string +>skills : { primary: string; secondary: string; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { +>{ name, skill } = robot, i = 0 : number +>{ name, skill } = robot : Robot +>{ name, skill } : { name: string; skill: string; } +>name : string +>skill : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { +>{ name, skill } = getRobot(), i = 0 : number +>{ name, skill } = getRobot() : Robot +>{ name, skill } : { name: string; skill: string; } +>name : string +>skill : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name, skill } = { name: "trimmer", skill: "trimming" } : Robot +>{ name, skill } : { name: string; skill: string; } +>name : string +>skill : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +>{ name, skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ name, skills: { primary, secondary } } = multiRobot : MultiRobot +>{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +>{ name, skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ name, skills: { primary, secondary } } = getMultiRobot() : MultiRobot +>{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ name, skills: { primary, secondary } } = +>{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>skills : { primary: string; secondary: string; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..785148ba652 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js @@ -0,0 +1,145 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +for (var _a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _r = robot.name, nameA = _r === void 0 ? "noName" : _r, _s = robot.skill, skillA = _s === void 0 ? "skill" : _s, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _t = getRobot(), _u = _t.name, nameA = _u === void 0 ? "noName" : _u, _v = _t.skill, skillA = _v === void 0 ? "skill" : _v, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _w = { name: "trimmer", skill: "trimming" }, _x = _w.name, nameA = _x === void 0 ? "noName" : _x, _y = _w.skill, skillA = _y === void 0 ? "skill" : _y, i = 0; i < 1; i++) { + console.log(nameA); +} +for (var _z = multiRobot.name, nameA = _z === void 0 ? "noName" : _z, _0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primaryA = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondaryA = _3 === void 0 ? "secondary" : _3, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _4 = getMultiRobot(), _5 = _4.name, nameA = _5 === void 0 ? "noName" : _5, _6 = _4.skills, _7 = _6 === void 0 ? { primary: "none", secondary: "none" } : _6, _8 = _7.primary, primaryA = _8 === void 0 ? "primary" : _8, _9 = _7.secondary, secondaryA = _9 === void 0 ? "secondary" : _9, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (var _10 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _11 = _10.name, nameA = _11 === void 0 ? "noName" : _11, _12 = _10.skills, _13 = _12 === void 0 ? { primary: "none", secondary: "none" } : _12, _14 = _13.primary, primaryA = _14 === void 0 ? "primary" : _14, _15 = _13.secondary, secondaryA = _15 === void 0 ? "secondary" : _15, i = 0; i < 1; i++) { + console.log(primaryA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..b208c41c9a6 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,GAAG,CAAC,CAAM,mBAAqB,EAArB,qCAAqB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,wBAAsB,EAAtB,qCAAsB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,oDAAsB,EAAtB,qCAAsB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,0BAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,+BAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,yFAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAM,mBAAsB,EAAtB,qCAAsB,EAAE,gBAAuB,EAAvB,qCAAuB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,eAAmE,EAA9D,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,2CAAsG,EAAjG,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7H,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,wBAAsB,EAAtB,qCAAsB,EACtB,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,oBAMc,EALf,YAAsB,EAAtB,qCAAsB,EACtB,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,IAAA,+EAMoF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..c8c63e66adf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,1740 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>for (var _a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA= "noName" +6 > +7 > name: nameA= "noName" +8 > } = robot, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) +5 >Emitted(9, 25) Source(26, 32) + SourceIndex(0) +6 >Emitted(9, 27) Source(26, 11) + SourceIndex(0) +7 >Emitted(9, 64) Source(26, 32) + SourceIndex(0) +8 >Emitted(9, 66) Source(26, 44) + SourceIndex(0) +9 >Emitted(9, 67) Source(26, 45) + SourceIndex(0) +10>Emitted(9, 70) Source(26, 48) + SourceIndex(0) +11>Emitted(9, 71) Source(26, 49) + SourceIndex(0) +12>Emitted(9, 73) Source(26, 51) + SourceIndex(0) +13>Emitted(9, 74) Source(26, 52) + SourceIndex(0) +14>Emitted(9, 77) Source(26, 55) + SourceIndex(0) +15>Emitted(9, 78) Source(26, 56) + SourceIndex(0) +16>Emitted(9, 80) Source(26, 58) + SourceIndex(0) +17>Emitted(9, 81) Source(26, 59) + SourceIndex(0) +18>Emitted(9, 83) Source(26, 61) + SourceIndex(0) +19>Emitted(9, 85) Source(26, 63) + SourceIndex(0) +20>Emitted(9, 86) Source(26, 64) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var _b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > } = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(12, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) +5 >Emitted(12, 30) Source(29, 33) + SourceIndex(0) +6 >Emitted(12, 32) Source(29, 11) + SourceIndex(0) +7 >Emitted(12, 69) Source(29, 33) + SourceIndex(0) +8 >Emitted(12, 71) Source(29, 50) + SourceIndex(0) +9 >Emitted(12, 72) Source(29, 51) + SourceIndex(0) +10>Emitted(12, 75) Source(29, 54) + SourceIndex(0) +11>Emitted(12, 76) Source(29, 55) + SourceIndex(0) +12>Emitted(12, 78) Source(29, 57) + SourceIndex(0) +13>Emitted(12, 79) Source(29, 58) + SourceIndex(0) +14>Emitted(12, 82) Source(29, 61) + SourceIndex(0) +15>Emitted(12, 83) Source(29, 62) + SourceIndex(0) +16>Emitted(12, 85) Source(29, 64) + SourceIndex(0) +17>Emitted(12, 86) Source(29, 65) + SourceIndex(0) +18>Emitted(12, 88) Source(29, 67) + SourceIndex(0) +19>Emitted(12, 90) Source(29, 69) + SourceIndex(0) +20>Emitted(12, 91) Source(29, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(13, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(13, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(13, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(13, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ +20> ^ +1-> + > +2 >for +3 > +4 > (let { +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > } = { name: "trimmer", skill: "trimming" }, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) +20> { +1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) +5 >Emitted(15, 58) Source(32, 33) + SourceIndex(0) +6 >Emitted(15, 60) Source(32, 11) + SourceIndex(0) +7 >Emitted(15, 97) Source(32, 33) + SourceIndex(0) +8 >Emitted(15, 99) Source(32, 85) + SourceIndex(0) +9 >Emitted(15, 100) Source(32, 86) + SourceIndex(0) +10>Emitted(15, 103) Source(32, 89) + SourceIndex(0) +11>Emitted(15, 104) Source(32, 90) + SourceIndex(0) +12>Emitted(15, 106) Source(32, 92) + SourceIndex(0) +13>Emitted(15, 107) Source(32, 93) + SourceIndex(0) +14>Emitted(15, 110) Source(32, 96) + SourceIndex(0) +15>Emitted(15, 111) Source(32, 97) + SourceIndex(0) +16>Emitted(15, 113) Source(32, 99) + SourceIndex(0) +17>Emitted(15, 114) Source(32, 100) + SourceIndex(0) +18>Emitted(15, 116) Source(32, 102) + SourceIndex(0) +19>Emitted(15, 118) Source(32, 104) + SourceIndex(0) +20>Emitted(15, 119) Source(32, 105) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +6 > +7 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , + > +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" +16> + > } = { primary: "none", secondary: "none" } + > } = multiRobot, +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(36, 5) + SourceIndex(0) +5 >Emitted(18, 32) Source(39, 47) + SourceIndex(0) +6 >Emitted(18, 34) Source(36, 5) + SourceIndex(0) +7 >Emitted(18, 98) Source(39, 47) + SourceIndex(0) +8 >Emitted(18, 100) Source(37, 9) + SourceIndex(0) +9 >Emitted(18, 115) Source(37, 38) + SourceIndex(0) +10>Emitted(18, 117) Source(37, 9) + SourceIndex(0) +11>Emitted(18, 158) Source(37, 38) + SourceIndex(0) +12>Emitted(18, 160) Source(38, 9) + SourceIndex(0) +13>Emitted(18, 177) Source(38, 44) + SourceIndex(0) +14>Emitted(18, 179) Source(38, 9) + SourceIndex(0) +15>Emitted(18, 224) Source(38, 44) + SourceIndex(0) +16>Emitted(18, 226) Source(40, 17) + SourceIndex(0) +17>Emitted(18, 227) Source(40, 18) + SourceIndex(0) +18>Emitted(18, 230) Source(40, 21) + SourceIndex(0) +19>Emitted(18, 231) Source(40, 22) + SourceIndex(0) +20>Emitted(18, 233) Source(40, 24) + SourceIndex(0) +21>Emitted(18, 234) Source(40, 25) + SourceIndex(0) +22>Emitted(18, 237) Source(40, 28) + SourceIndex(0) +23>Emitted(18, 238) Source(40, 29) + SourceIndex(0) +24>Emitted(18, 240) Source(40, 31) + SourceIndex(0) +25>Emitted(18, 241) Source(40, 32) + SourceIndex(0) +26>Emitted(18, 243) Source(40, 34) + SourceIndex(0) +27>Emitted(18, 245) Source(40, 36) + SourceIndex(0) +28>Emitted(18, 246) Source(40, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(41, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(41, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(41, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(41, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(41, 17) + SourceIndex(0) +6 >Emitted(19, 25) Source(41, 25) + SourceIndex(0) +7 >Emitted(19, 26) Source(41, 26) + SourceIndex(0) +8 >Emitted(19, 27) Source(41, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(20, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(20, 2) Source(42, 2) + SourceIndex(0) +--- +>>>for (var _h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +6 > +7 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , + > +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" +16> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot(), +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(21, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(44, 5) + SourceIndex(0) +5 >Emitted(21, 37) Source(47, 47) + SourceIndex(0) +6 >Emitted(21, 39) Source(44, 5) + SourceIndex(0) +7 >Emitted(21, 103) Source(47, 47) + SourceIndex(0) +8 >Emitted(21, 105) Source(45, 9) + SourceIndex(0) +9 >Emitted(21, 120) Source(45, 38) + SourceIndex(0) +10>Emitted(21, 122) Source(45, 9) + SourceIndex(0) +11>Emitted(21, 163) Source(45, 38) + SourceIndex(0) +12>Emitted(21, 165) Source(46, 9) + SourceIndex(0) +13>Emitted(21, 182) Source(46, 44) + SourceIndex(0) +14>Emitted(21, 184) Source(46, 9) + SourceIndex(0) +15>Emitted(21, 229) Source(46, 44) + SourceIndex(0) +16>Emitted(21, 231) Source(48, 22) + SourceIndex(0) +17>Emitted(21, 232) Source(48, 23) + SourceIndex(0) +18>Emitted(21, 235) Source(48, 26) + SourceIndex(0) +19>Emitted(21, 236) Source(48, 27) + SourceIndex(0) +20>Emitted(21, 238) Source(48, 29) + SourceIndex(0) +21>Emitted(21, 239) Source(48, 30) + SourceIndex(0) +22>Emitted(21, 242) Source(48, 33) + SourceIndex(0) +23>Emitted(21, 243) Source(48, 34) + SourceIndex(0) +24>Emitted(21, 245) Source(48, 36) + SourceIndex(0) +25>Emitted(21, 246) Source(48, 37) + SourceIndex(0) +26>Emitted(21, 248) Source(48, 39) + SourceIndex(0) +27>Emitted(21, 250) Source(48, 41) + SourceIndex(0) +28>Emitted(21, 251) Source(48, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(22, 25) Source(49, 25) + SourceIndex(0) +7 >Emitted(22, 26) Source(49, 26) + SourceIndex(0) +8 >Emitted(22, 27) Source(49, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(23, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +6 > +7 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , + > +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" +16> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(24, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(51, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(51, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(52, 5) + SourceIndex(0) +5 >Emitted(24, 95) Source(55, 47) + SourceIndex(0) +6 >Emitted(24, 97) Source(52, 5) + SourceIndex(0) +7 >Emitted(24, 161) Source(55, 47) + SourceIndex(0) +8 >Emitted(24, 163) Source(53, 9) + SourceIndex(0) +9 >Emitted(24, 178) Source(53, 38) + SourceIndex(0) +10>Emitted(24, 180) Source(53, 9) + SourceIndex(0) +11>Emitted(24, 221) Source(53, 38) + SourceIndex(0) +12>Emitted(24, 223) Source(54, 9) + SourceIndex(0) +13>Emitted(24, 240) Source(54, 44) + SourceIndex(0) +14>Emitted(24, 242) Source(54, 9) + SourceIndex(0) +15>Emitted(24, 287) Source(54, 44) + SourceIndex(0) +16>Emitted(24, 289) Source(57, 5) + SourceIndex(0) +17>Emitted(24, 290) Source(57, 6) + SourceIndex(0) +18>Emitted(24, 293) Source(57, 9) + SourceIndex(0) +19>Emitted(24, 294) Source(57, 10) + SourceIndex(0) +20>Emitted(24, 296) Source(57, 12) + SourceIndex(0) +21>Emitted(24, 297) Source(57, 13) + SourceIndex(0) +22>Emitted(24, 300) Source(57, 16) + SourceIndex(0) +23>Emitted(24, 301) Source(57, 17) + SourceIndex(0) +24>Emitted(24, 303) Source(57, 19) + SourceIndex(0) +25>Emitted(24, 304) Source(57, 20) + SourceIndex(0) +26>Emitted(24, 306) Source(57, 22) + SourceIndex(0) +27>Emitted(24, 308) Source(57, 24) + SourceIndex(0) +28>Emitted(24, 309) Source(57, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(25, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(25, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(25, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(25, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(25, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(25, 25) Source(58, 25) + SourceIndex(0) +7 >Emitted(25, 26) Source(58, 26) + SourceIndex(0) +8 >Emitted(25, 27) Source(58, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(26, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(26, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _r = robot.name, nameA = _r === void 0 ? "noName" : _r, _s = robot.skill, skillA = _s === void 0 ? "skill" : _s, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > (let { +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , +9 > skill: skillA = "skill" +10> +11> skill: skillA = "skill" +12> } = robot, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(27, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(27, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(27, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(27, 6) Source(61, 11) + SourceIndex(0) +5 >Emitted(27, 25) Source(61, 33) + SourceIndex(0) +6 >Emitted(27, 27) Source(61, 11) + SourceIndex(0) +7 >Emitted(27, 64) Source(61, 33) + SourceIndex(0) +8 >Emitted(27, 66) Source(61, 35) + SourceIndex(0) +9 >Emitted(27, 82) Source(61, 58) + SourceIndex(0) +10>Emitted(27, 84) Source(61, 35) + SourceIndex(0) +11>Emitted(27, 121) Source(61, 58) + SourceIndex(0) +12>Emitted(27, 123) Source(61, 70) + SourceIndex(0) +13>Emitted(27, 124) Source(61, 71) + SourceIndex(0) +14>Emitted(27, 127) Source(61, 74) + SourceIndex(0) +15>Emitted(27, 128) Source(61, 75) + SourceIndex(0) +16>Emitted(27, 130) Source(61, 77) + SourceIndex(0) +17>Emitted(27, 131) Source(61, 78) + SourceIndex(0) +18>Emitted(27, 134) Source(61, 81) + SourceIndex(0) +19>Emitted(27, 135) Source(61, 82) + SourceIndex(0) +20>Emitted(27, 137) Source(61, 84) + SourceIndex(0) +21>Emitted(27, 138) Source(61, 85) + SourceIndex(0) +22>Emitted(27, 140) Source(61, 87) + SourceIndex(0) +23>Emitted(27, 142) Source(61, 89) + SourceIndex(0) +24>Emitted(27, 143) Source(61, 90) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(28, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(28, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(28, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _t = getRobot(), _u = _t.name, nameA = _u === void 0 ? "noName" : _u, _v = _t.skill, skillA = _v === void 0 ? "skill" : _v, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA = "noName", skill: skillA = "skill" } = getRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = getRobot(), +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(30, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(30, 10) Source(64, 6) + SourceIndex(0) +6 >Emitted(30, 25) Source(64, 73) + SourceIndex(0) +7 >Emitted(30, 27) Source(64, 11) + SourceIndex(0) +8 >Emitted(30, 39) Source(64, 33) + SourceIndex(0) +9 >Emitted(30, 41) Source(64, 11) + SourceIndex(0) +10>Emitted(30, 78) Source(64, 33) + SourceIndex(0) +11>Emitted(30, 80) Source(64, 35) + SourceIndex(0) +12>Emitted(30, 93) Source(64, 58) + SourceIndex(0) +13>Emitted(30, 95) Source(64, 35) + SourceIndex(0) +14>Emitted(30, 132) Source(64, 58) + SourceIndex(0) +15>Emitted(30, 134) Source(64, 75) + SourceIndex(0) +16>Emitted(30, 135) Source(64, 76) + SourceIndex(0) +17>Emitted(30, 138) Source(64, 79) + SourceIndex(0) +18>Emitted(30, 139) Source(64, 80) + SourceIndex(0) +19>Emitted(30, 141) Source(64, 82) + SourceIndex(0) +20>Emitted(30, 142) Source(64, 83) + SourceIndex(0) +21>Emitted(30, 145) Source(64, 86) + SourceIndex(0) +22>Emitted(30, 146) Source(64, 87) + SourceIndex(0) +23>Emitted(30, 148) Source(64, 89) + SourceIndex(0) +24>Emitted(30, 149) Source(64, 90) + SourceIndex(0) +25>Emitted(30, 151) Source(64, 92) + SourceIndex(0) +26>Emitted(30, 153) Source(64, 94) + SourceIndex(0) +27>Emitted(30, 154) Source(64, 95) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for (var _w = { name: "trimmer", skill: "trimming" }, _x = _w.name, nameA = _x === void 0 ? "noName" : _x, _y = _w.skill, skillA = _y === void 0 ? "skill" : _y, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ +27> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = { name: "trimmer", skill: "trimming" }, +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) +27> { +1->Emitted(33, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(67, 6) + SourceIndex(0) +5 >Emitted(33, 10) Source(67, 6) + SourceIndex(0) +6 >Emitted(33, 53) Source(67, 108) + SourceIndex(0) +7 >Emitted(33, 55) Source(67, 11) + SourceIndex(0) +8 >Emitted(33, 67) Source(67, 33) + SourceIndex(0) +9 >Emitted(33, 69) Source(67, 11) + SourceIndex(0) +10>Emitted(33, 106) Source(67, 33) + SourceIndex(0) +11>Emitted(33, 108) Source(67, 35) + SourceIndex(0) +12>Emitted(33, 121) Source(67, 58) + SourceIndex(0) +13>Emitted(33, 123) Source(67, 35) + SourceIndex(0) +14>Emitted(33, 160) Source(67, 58) + SourceIndex(0) +15>Emitted(33, 162) Source(67, 110) + SourceIndex(0) +16>Emitted(33, 163) Source(67, 111) + SourceIndex(0) +17>Emitted(33, 166) Source(67, 114) + SourceIndex(0) +18>Emitted(33, 167) Source(67, 115) + SourceIndex(0) +19>Emitted(33, 169) Source(67, 117) + SourceIndex(0) +20>Emitted(33, 170) Source(67, 118) + SourceIndex(0) +21>Emitted(33, 173) Source(67, 121) + SourceIndex(0) +22>Emitted(33, 174) Source(67, 122) + SourceIndex(0) +23>Emitted(33, 176) Source(67, 124) + SourceIndex(0) +24>Emitted(33, 177) Source(67, 125) + SourceIndex(0) +25>Emitted(33, 179) Source(67, 127) + SourceIndex(0) +26>Emitted(33, 181) Source(67, 129) + SourceIndex(0) +27>Emitted(33, 182) Source(67, 130) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(68, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(68, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(68, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for (var _z = multiRobot.name, nameA = _z === void 0 ? "noName" : _z, _0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primaryA = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondaryA = _3 === void 0 ? "secondary" : _3, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let { + > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , + > +9 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +10> +11> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +12> +13> primary: primaryA = "primary" +14> +15> primary: primaryA = "primary" +16> , + > +17> secondary: secondaryA = "secondary" +18> +19> secondary: secondaryA = "secondary" +20> + > } = { primary: "none", secondary: "none" } + > } = multiRobot, +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(36, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(70, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(70, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(71, 5) + SourceIndex(0) +5 >Emitted(36, 30) Source(71, 27) + SourceIndex(0) +6 >Emitted(36, 32) Source(71, 5) + SourceIndex(0) +7 >Emitted(36, 69) Source(71, 27) + SourceIndex(0) +8 >Emitted(36, 71) Source(72, 5) + SourceIndex(0) +9 >Emitted(36, 93) Source(75, 47) + SourceIndex(0) +10>Emitted(36, 95) Source(72, 5) + SourceIndex(0) +11>Emitted(36, 159) Source(75, 47) + SourceIndex(0) +12>Emitted(36, 161) Source(73, 9) + SourceIndex(0) +13>Emitted(36, 176) Source(73, 38) + SourceIndex(0) +14>Emitted(36, 178) Source(73, 9) + SourceIndex(0) +15>Emitted(36, 219) Source(73, 38) + SourceIndex(0) +16>Emitted(36, 221) Source(74, 9) + SourceIndex(0) +17>Emitted(36, 238) Source(74, 44) + SourceIndex(0) +18>Emitted(36, 240) Source(74, 9) + SourceIndex(0) +19>Emitted(36, 285) Source(74, 44) + SourceIndex(0) +20>Emitted(36, 287) Source(76, 17) + SourceIndex(0) +21>Emitted(36, 288) Source(76, 18) + SourceIndex(0) +22>Emitted(36, 291) Source(76, 21) + SourceIndex(0) +23>Emitted(36, 292) Source(76, 22) + SourceIndex(0) +24>Emitted(36, 294) Source(76, 24) + SourceIndex(0) +25>Emitted(36, 295) Source(76, 25) + SourceIndex(0) +26>Emitted(36, 298) Source(76, 28) + SourceIndex(0) +27>Emitted(36, 299) Source(76, 29) + SourceIndex(0) +28>Emitted(36, 301) Source(76, 31) + SourceIndex(0) +29>Emitted(36, 302) Source(76, 32) + SourceIndex(0) +30>Emitted(36, 304) Source(76, 34) + SourceIndex(0) +31>Emitted(36, 306) Source(76, 36) + SourceIndex(0) +32>Emitted(36, 307) Source(76, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(77, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(77, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(77, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(77, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(77, 17) + SourceIndex(0) +6 >Emitted(37, 25) Source(77, 25) + SourceIndex(0) +7 >Emitted(37, 26) Source(77, 26) + SourceIndex(0) +8 >Emitted(37, 27) Source(77, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(78, 2) + SourceIndex(0) +--- +>>>for (var _4 = getMultiRobot(), _5 = _4.name, nameA = _5 === void 0 ? "noName" : _5, _6 = _4.skills, _7 = _6 === void 0 ? { primary: "none", secondary: "none" } : _6, _8 = _7.primary, primaryA = _8 === void 0 ? "primary" : _8, _9 = _7.secondary, secondaryA = _9 === void 0 ? "secondary" : _9, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot(), +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(39, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(79, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(79, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(79, 6) + SourceIndex(0) +5 >Emitted(39, 10) Source(79, 6) + SourceIndex(0) +6 >Emitted(39, 30) Source(85, 20) + SourceIndex(0) +7 >Emitted(39, 32) Source(80, 5) + SourceIndex(0) +8 >Emitted(39, 44) Source(80, 27) + SourceIndex(0) +9 >Emitted(39, 46) Source(80, 5) + SourceIndex(0) +10>Emitted(39, 83) Source(80, 27) + SourceIndex(0) +11>Emitted(39, 85) Source(81, 5) + SourceIndex(0) +12>Emitted(39, 99) Source(84, 47) + SourceIndex(0) +13>Emitted(39, 101) Source(81, 5) + SourceIndex(0) +14>Emitted(39, 165) Source(84, 47) + SourceIndex(0) +15>Emitted(39, 167) Source(82, 9) + SourceIndex(0) +16>Emitted(39, 182) Source(82, 38) + SourceIndex(0) +17>Emitted(39, 184) Source(82, 9) + SourceIndex(0) +18>Emitted(39, 225) Source(82, 38) + SourceIndex(0) +19>Emitted(39, 227) Source(83, 9) + SourceIndex(0) +20>Emitted(39, 244) Source(83, 44) + SourceIndex(0) +21>Emitted(39, 246) Source(83, 9) + SourceIndex(0) +22>Emitted(39, 291) Source(83, 44) + SourceIndex(0) +23>Emitted(39, 293) Source(85, 22) + SourceIndex(0) +24>Emitted(39, 294) Source(85, 23) + SourceIndex(0) +25>Emitted(39, 297) Source(85, 26) + SourceIndex(0) +26>Emitted(39, 298) Source(85, 27) + SourceIndex(0) +27>Emitted(39, 300) Source(85, 29) + SourceIndex(0) +28>Emitted(39, 301) Source(85, 30) + SourceIndex(0) +29>Emitted(39, 304) Source(85, 33) + SourceIndex(0) +30>Emitted(39, 305) Source(85, 34) + SourceIndex(0) +31>Emitted(39, 307) Source(85, 36) + SourceIndex(0) +32>Emitted(39, 308) Source(85, 37) + SourceIndex(0) +33>Emitted(39, 310) Source(85, 39) + SourceIndex(0) +34>Emitted(39, 312) Source(85, 41) + SourceIndex(0) +35>Emitted(39, 313) Source(85, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(86, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(86, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(86, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(86, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(86, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(86, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(86, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(86, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(87, 2) + SourceIndex(0) +--- +>>>for (var _10 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _11 = _10.name, nameA = _11 === void 0 ? "noName" : _11, _12 = _10.skills, _13 = _12 === void 0 ? { primary: "none", secondary: "none" } : _12, _14 = _13.primary, primaryA = _14 === void 0 ? "primary" : _14, _15 = _13.secondary, secondaryA = _15 === void 0 ? "secondary" : _15, i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^^ +30> ^ +31> ^^ +32> ^ +33> ^^ +34> ^^ +35> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +24> i +25> = +26> 0 +27> ; +28> i +29> < +30> 1 +31> ; +32> i +33> ++ +34> ) +35> { +1->Emitted(42, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(88, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(88, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(88, 6) + SourceIndex(0) +5 >Emitted(42, 10) Source(88, 6) + SourceIndex(0) +6 >Emitted(42, 89) Source(94, 90) + SourceIndex(0) +7 >Emitted(42, 91) Source(89, 5) + SourceIndex(0) +8 >Emitted(42, 105) Source(89, 27) + SourceIndex(0) +9 >Emitted(42, 107) Source(89, 5) + SourceIndex(0) +10>Emitted(42, 146) Source(89, 27) + SourceIndex(0) +11>Emitted(42, 148) Source(90, 5) + SourceIndex(0) +12>Emitted(42, 164) Source(93, 47) + SourceIndex(0) +13>Emitted(42, 166) Source(90, 5) + SourceIndex(0) +14>Emitted(42, 233) Source(93, 47) + SourceIndex(0) +15>Emitted(42, 235) Source(91, 9) + SourceIndex(0) +16>Emitted(42, 252) Source(91, 38) + SourceIndex(0) +17>Emitted(42, 254) Source(91, 9) + SourceIndex(0) +18>Emitted(42, 297) Source(91, 38) + SourceIndex(0) +19>Emitted(42, 299) Source(92, 9) + SourceIndex(0) +20>Emitted(42, 318) Source(92, 44) + SourceIndex(0) +21>Emitted(42, 320) Source(92, 9) + SourceIndex(0) +22>Emitted(42, 367) Source(92, 44) + SourceIndex(0) +23>Emitted(42, 369) Source(95, 5) + SourceIndex(0) +24>Emitted(42, 370) Source(95, 6) + SourceIndex(0) +25>Emitted(42, 373) Source(95, 9) + SourceIndex(0) +26>Emitted(42, 374) Source(95, 10) + SourceIndex(0) +27>Emitted(42, 376) Source(95, 12) + SourceIndex(0) +28>Emitted(42, 377) Source(95, 13) + SourceIndex(0) +29>Emitted(42, 380) Source(95, 16) + SourceIndex(0) +30>Emitted(42, 381) Source(95, 17) + SourceIndex(0) +31>Emitted(42, 383) Source(95, 19) + SourceIndex(0) +32>Emitted(42, 384) Source(95, 20) + SourceIndex(0) +33>Emitted(42, 386) Source(95, 22) + SourceIndex(0) +34>Emitted(42, 388) Source(95, 24) + SourceIndex(0) +35>Emitted(42, 389) Source(95, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(96, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(96, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(96, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(97, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..5d47a45699e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,350 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 10)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 42)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 42)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 42)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 25, 10)) +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 10)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 48)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 48)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 28, 10)) +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 10)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 45)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 62)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 83)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 83)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 83)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 31, 10)) +} +for (let { + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 35, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 36, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 38, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 38, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 39, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 39, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 39, 15)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 35, 13)) +} +for (let { + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 43, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 44, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 46, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 46, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 47, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 47, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 47, 20)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 43, 13)) +} +for (let { + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 51, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 52, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 54, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 54, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 55, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 51, 13)) +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 33)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 68)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 68)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 60, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 33)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 73)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 73)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 63, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 33)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 70)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 87)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 108)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 108)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 108)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 66, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 69, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 71, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 72, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 74, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 74, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 75, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 75, 15)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 75, 15)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 71, 13)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 78, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 80, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 81, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 83, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 83, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 84, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 84, 20)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 84, 20)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 80, 13)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 87, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 89, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 90, 38)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 92, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 92, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 90)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 93, 90)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts, 89, 13)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..c9e76f88581 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types @@ -0,0 +1,484 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"skill" : string +>robot : Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"skill" : string +>getRobot() : Robot +>getRobot : () => Robot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"skill" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..a360326c1ca --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js @@ -0,0 +1,265 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js] +var robot = { name: "mower", skill: "mowing" }; +var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for ((_a = robot.name, nameA = _a === void 0 ? "noName" : _a, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_b = getRobot(), _c = _b.name, nameA = _c === void 0 ? "noName" : _c, _b), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_d = { name: "trimmer", skill: "trimming" }, _e = _d.name, nameA = _e === void 0 ? "noName" : _e, _d), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_f = multiRobot.skills, _g = _f === void 0 ? { primary: "none", secondary: "none" } : _f, _h = _g.primary, primaryA = _h === void 0 ? "primary" : _h, _j = _g.secondary, secondaryA = _j === void 0 ? "secondary" : _j, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_k = getMultiRobot(), _l = _k.skills, _m = _l === void 0 ? { primary: "none", secondary: "none" } : _l, _o = _m.primary, primaryA = _o === void 0 ? "primary" : _o, _p = _m.secondary, secondaryA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_q = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _r = _q.skills, _s = _r === void 0 ? { primary: "none", secondary: "none" } : _r, _t = _s.primary, primaryA = _t === void 0 ? "primary" : _t, _u = _s.secondary, secondaryA = _u === void 0 ? "secondary" : _u, _q), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_v = robot.name, name = _v === void 0 ? "noName" : _v, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_w = getRobot(), _x = _w.name, name = _x === void 0 ? "noName" : _x, _w), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_y = { name: "trimmer", skill: "trimming" }, _z = _y.name, name = _z === void 0 ? "noName" : _z, _y), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primary = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondary = _3 === void 0 ? "secondary" : _3, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_4 = getMultiRobot(), _5 = _4.skills, _6 = _5 === void 0 ? { primary: "none", secondary: "none" } : _5, _7 = _6.primary, primary = _7 === void 0 ? "primary" : _7, _8 = _6.secondary, secondary = _8 === void 0 ? "secondary" : _8, _4), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_9 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _10 = _9.skills, _11 = _10 === void 0 ? { primary: "none", secondary: "none" } : _10, _12 = _11.primary, primary = _12 === void 0 ? "primary" : _12, _13 = _11.secondary, secondary = _13 === void 0 ? "secondary" : _13, _9), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_14 = robot.name, nameA = _14 === void 0 ? "noName" : _14, _15 = robot.skill, skillA = _15 === void 0 ? "skill" : _15, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_16 = getRobot(), _17 = _16.name, nameA = _17 === void 0 ? "noName" : _17, _18 = _16.skill, skillA = _18 === void 0 ? "skill" : _18, _16), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_19 = { name: "trimmer", skill: "trimming" }, _20 = _19.name, nameA = _20 === void 0 ? "noName" : _20, _21 = _19.skill, skillA = _21 === void 0 ? "skill" : _21, _19), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_22 = multiRobot.name, nameA = _22 === void 0 ? "noName" : _22, _23 = multiRobot.skills, _24 = _23 === void 0 ? { primary: "none", secondary: "none" } : _23, _25 = _24.primary, primaryA = _25 === void 0 ? "primary" : _25, _26 = _24.secondary, secondaryA = _26 === void 0 ? "secondary" : _26, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_27 = getMultiRobot(), _28 = _27.name, nameA = _28 === void 0 ? "noName" : _28, _29 = _27.skills, _30 = _29 === void 0 ? { primary: "none", secondary: "none" } : _29, _31 = _30.primary, primaryA = _31 === void 0 ? "primary" : _31, _32 = _30.secondary, secondaryA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_33 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _34 = _33.name, nameA = _34 === void 0 ? "noName" : _34, _35 = _33.skills, _36 = _35 === void 0 ? { primary: "none", secondary: "none" } : _35, _37 = _36.primary, primaryA = _37 === void 0 ? "primary" : _37, _38 = _36.secondary, secondaryA = _38 === void 0 ? "secondary" : _38, _33), + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_39 = robot.name, name = _39 === void 0 ? "noName" : _39, _40 = robot.skill, skill = _40 === void 0 ? "skill" : _40, robot), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_41 = getRobot(), _42 = _41.name, name = _42 === void 0 ? "noName" : _42, _43 = _41.skill, skill = _43 === void 0 ? "skill" : _43, _41), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_44 = { name: "trimmer", skill: "trimming" }, _45 = _44.name, name = _45 === void 0 ? "noName" : _45, _46 = _44.skill, skill = _46 === void 0 ? "skill" : _46, _44), i = 0; i < 1; i++) { + console.log(nameA); +} +for ((_47 = multiRobot.name, name = _47 === void 0 ? "noName" : _47, _48 = multiRobot.skills, _49 = _48 === void 0 ? { primary: "none", secondary: "none" } : _48, _50 = _49.primary, primary = _50 === void 0 ? "primary" : _50, _51 = _49.secondary, secondary = _51 === void 0 ? "secondary" : _51, multiRobot), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_52 = getMultiRobot(), _53 = _52.name, name = _53 === void 0 ? "noName" : _53, _54 = _52.skills, _55 = _54 === void 0 ? { primary: "none", secondary: "none" } : _54, _56 = _55.primary, primary = _56 === void 0 ? "primary" : _56, _57 = _55.secondary, secondary = _57 === void 0 ? "secondary" : _57, _52), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ((_58 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _59 = _58.name, name = _59 === void 0 ? "noName" : _59, _60 = _58.skills, _61 = _60 === void 0 ? { primary: "none", secondary: "none" } : _60, _62 = _61.primary, primary = _62 === void 0 ? "primary" : _62, _63 = _61.secondary, secondary = _63 === void 0 ? "secondary" : _63, _58), + i = 0; i < 1; i++) { + console.log(primaryA); +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63; +//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..448921b9cdc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAC,CAAC,eAAsB,EAAtB,qCAAsB,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAsC,EAArC,YAAsB,EAAtB,qCAAsB,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAAyE,EAAxE,YAAsB,EAAtB,qCAAsB,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEvC,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,KAExB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EAKoF,EAJrF,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,KAE8C;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAC,CAAE,eAAe,EAAf,oCAAe,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,eAAgC,EAA9B,YAAe,EAAf,oCAAe,KAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,2CAAmE,EAAjE,YAAe,EAAf,oCAAe,KAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,sBAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,EAE3B,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,KAEZ,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,8EAKoF,EAJrF,eAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,KAE0D;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAGD,GAAG,CAAC,CAAC,CAAC,gBAAsB,EAAtB,uCAAsB,EAAE,iBAAuB,EAAvB,uCAAuB,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gBAA+D,EAA9D,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,MAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,4CAAkG,EAAjG,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,MAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,qBAAsB,EAAtB,uCAAsB,EACtB,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAEvC,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,qBAMc,EALf,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,MAExB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+EAMoF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,MAE8C;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAC,CAAE,gBAAe,EAAf,sCAAe,EAAE,iBAAe,EAAf,sCAAe,EAAK,KAAK,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,gBAAiD,EAA/C,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,MAAe,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,4CAAoF,EAAlF,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,MAAkD,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CACD,qBAAe,EAAf,sCAAe,EACf,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,EAE3B,UAAU,CAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,qBAMc,EALf,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,MAEZ,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,CAAA,+EAMoF,EALrF,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,MAE0D;IACrF,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..3e4d7a87855 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,3589 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robot = { name: "mower", skill: "mowing" }; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > + > +2 >let +3 > robot +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(17, 20) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 22) + SourceIndex(0) +6 >Emitted(1, 19) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 28) + SourceIndex(0) +8 >Emitted(1, 28) Source(17, 35) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 37) + SourceIndex(0) +10>Emitted(1, 35) Source(17, 42) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 44) + SourceIndex(0) +12>Emitted(1, 45) Source(17, 52) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 54) + SourceIndex(0) +14>Emitted(1, 48) Source(17, 55) + SourceIndex(0) +--- +>>>var multiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1-> +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >let +3 > multiRobot +4 > : MultiRobot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 15) Source(18, 15) + SourceIndex(0) +4 >Emitted(2, 18) Source(18, 30) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 32) + SourceIndex(0) +6 >Emitted(2, 24) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 38) + SourceIndex(0) +8 >Emitted(2, 33) Source(18, 45) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 47) + SourceIndex(0) +10>Emitted(2, 41) Source(18, 53) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 55) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 57) + SourceIndex(0) +13>Emitted(2, 52) Source(18, 64) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 66) + SourceIndex(0) +15>Emitted(2, 62) Source(18, 74) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 76) + SourceIndex(0) +17>Emitted(2, 73) Source(18, 85) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 87) + SourceIndex(0) +19>Emitted(2, 81) Source(18, 93) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 95) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 97) + SourceIndex(0) +22>Emitted(2, 86) Source(18, 98) + SourceIndex(0) +--- +>>>function getRobot() { +1 > +2 >^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(3, 1) Source(19, 1) + SourceIndex(0) +--- +>>> return robot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^ +5 > ^ +1->function getRobot() { + > +2 > return +3 > +4 > robot +5 > ; +1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) +3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function getMultiRobot() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +--- +>>> return multiRobot; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^ +5 > ^ +1->function getMultiRobot() { + > +2 > return +3 > +4 > multiRobot +5 > ; +1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(24, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(9, 10) Source(26, 18) + SourceIndex(0) +4 >Emitted(9, 12) Source(26, 20) + SourceIndex(0) +5 >Emitted(9, 20) Source(26, 36) + SourceIndex(0) +6 >Emitted(9, 22) Source(26, 38) + SourceIndex(0) +7 >Emitted(9, 32) Source(26, 56) + SourceIndex(0) +8 >Emitted(9, 34) Source(26, 58) + SourceIndex(0) +9 >Emitted(9, 35) Source(26, 67) + SourceIndex(0) +10>Emitted(9, 37) Source(26, 69) + SourceIndex(0) +11>Emitted(9, 43) Source(26, 83) + SourceIndex(0) +12>Emitted(9, 44) Source(26, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(10, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(10, 9) Source(27, 17) + SourceIndex(0) +4 >Emitted(10, 11) Source(27, 19) + SourceIndex(0) +5 >Emitted(10, 18) Source(27, 34) + SourceIndex(0) +6 >Emitted(10, 20) Source(27, 36) + SourceIndex(0) +7 >Emitted(10, 29) Source(27, 53) + SourceIndex(0) +8 >Emitted(10, 31) Source(27, 55) + SourceIndex(0) +9 >Emitted(10, 36) Source(27, 68) + SourceIndex(0) +10>Emitted(10, 37) Source(27, 69) + SourceIndex(0) +--- +>>>for ((_a = robot.name, nameA = _a === void 0 ? "noName" : _a, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(11, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(11, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(11, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(11, 6) Source(29, 6) + SourceIndex(0) +5 >Emitted(11, 7) Source(29, 7) + SourceIndex(0) +6 >Emitted(11, 22) Source(29, 29) + SourceIndex(0) +7 >Emitted(11, 24) Source(29, 7) + SourceIndex(0) +8 >Emitted(11, 61) Source(29, 29) + SourceIndex(0) +9 >Emitted(11, 63) Source(29, 34) + SourceIndex(0) +10>Emitted(11, 68) Source(29, 39) + SourceIndex(0) +11>Emitted(11, 69) Source(29, 39) + SourceIndex(0) +12>Emitted(11, 71) Source(29, 41) + SourceIndex(0) +13>Emitted(11, 72) Source(29, 42) + SourceIndex(0) +14>Emitted(11, 75) Source(29, 45) + SourceIndex(0) +15>Emitted(11, 76) Source(29, 46) + SourceIndex(0) +16>Emitted(11, 78) Source(29, 48) + SourceIndex(0) +17>Emitted(11, 79) Source(29, 49) + SourceIndex(0) +18>Emitted(11, 82) Source(29, 52) + SourceIndex(0) +19>Emitted(11, 83) Source(29, 53) + SourceIndex(0) +20>Emitted(11, 85) Source(29, 55) + SourceIndex(0) +21>Emitted(11, 86) Source(29, 56) + SourceIndex(0) +22>Emitted(11, 88) Source(29, 58) + SourceIndex(0) +23>Emitted(11, 90) Source(29, 60) + SourceIndex(0) +24>Emitted(11, 91) Source(29, 61) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for ((_b = getRobot(), _c = _b.name, nameA = _c === void 0 ? "noName" : _c, _b), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName" } = getRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) +5 >Emitted(14, 7) Source(32, 6) + SourceIndex(0) +6 >Emitted(14, 22) Source(32, 44) + SourceIndex(0) +7 >Emitted(14, 24) Source(32, 7) + SourceIndex(0) +8 >Emitted(14, 36) Source(32, 29) + SourceIndex(0) +9 >Emitted(14, 38) Source(32, 7) + SourceIndex(0) +10>Emitted(14, 75) Source(32, 29) + SourceIndex(0) +11>Emitted(14, 80) Source(32, 44) + SourceIndex(0) +12>Emitted(14, 82) Source(32, 46) + SourceIndex(0) +13>Emitted(14, 83) Source(32, 47) + SourceIndex(0) +14>Emitted(14, 86) Source(32, 50) + SourceIndex(0) +15>Emitted(14, 87) Source(32, 51) + SourceIndex(0) +16>Emitted(14, 89) Source(32, 53) + SourceIndex(0) +17>Emitted(14, 90) Source(32, 54) + SourceIndex(0) +18>Emitted(14, 93) Source(32, 57) + SourceIndex(0) +19>Emitted(14, 94) Source(32, 58) + SourceIndex(0) +20>Emitted(14, 96) Source(32, 60) + SourceIndex(0) +21>Emitted(14, 97) Source(32, 61) + SourceIndex(0) +22>Emitted(14, 99) Source(32, 63) + SourceIndex(0) +23>Emitted(14, 101) Source(32, 65) + SourceIndex(0) +24>Emitted(14, 102) Source(32, 66) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(16, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for ((_d = { name: "trimmer", skill: "trimming" }, _e = _d.name, nameA = _e === void 0 ? "noName" : _e, _d), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(17, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) +5 >Emitted(17, 7) Source(35, 6) + SourceIndex(0) +6 >Emitted(17, 50) Source(35, 79) + SourceIndex(0) +7 >Emitted(17, 52) Source(35, 7) + SourceIndex(0) +8 >Emitted(17, 64) Source(35, 29) + SourceIndex(0) +9 >Emitted(17, 66) Source(35, 7) + SourceIndex(0) +10>Emitted(17, 103) Source(35, 29) + SourceIndex(0) +11>Emitted(17, 108) Source(35, 79) + SourceIndex(0) +12>Emitted(17, 110) Source(35, 81) + SourceIndex(0) +13>Emitted(17, 111) Source(35, 82) + SourceIndex(0) +14>Emitted(17, 114) Source(35, 85) + SourceIndex(0) +15>Emitted(17, 115) Source(35, 86) + SourceIndex(0) +16>Emitted(17, 117) Source(35, 88) + SourceIndex(0) +17>Emitted(17, 118) Source(35, 89) + SourceIndex(0) +18>Emitted(17, 121) Source(35, 92) + SourceIndex(0) +19>Emitted(17, 122) Source(35, 93) + SourceIndex(0) +20>Emitted(17, 124) Source(35, 95) + SourceIndex(0) +21>Emitted(17, 125) Source(35, 96) + SourceIndex(0) +22>Emitted(17, 127) Source(35, 98) + SourceIndex(0) +23>Emitted(17, 129) Source(35, 100) + SourceIndex(0) +24>Emitted(17, 130) Source(35, 101) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(19, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for ((_f = multiRobot.skills, _g = _f === void 0 ? { primary: "none", secondary: "none" } : _f, _h = _g.primary, primaryA = _h === void 0 ? "primary" : _h, _j = _g.secondary, secondaryA = _j === void 0 ? "secondary" : _j, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> primary: primaryA = "primary" +11> +12> primary: primaryA = "primary" +13> , + > +14> secondary: secondaryA = "secondary" +15> +16> secondary: secondaryA = "secondary" +17> + > } = { primary: "none", secondary: "none" } + > } = +18> multiRobot +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 6) + SourceIndex(0) +5 >Emitted(20, 7) Source(39, 5) + SourceIndex(0) +6 >Emitted(20, 29) Source(42, 47) + SourceIndex(0) +7 >Emitted(20, 31) Source(39, 5) + SourceIndex(0) +8 >Emitted(20, 95) Source(42, 47) + SourceIndex(0) +9 >Emitted(20, 97) Source(40, 9) + SourceIndex(0) +10>Emitted(20, 112) Source(40, 38) + SourceIndex(0) +11>Emitted(20, 114) Source(40, 9) + SourceIndex(0) +12>Emitted(20, 155) Source(40, 38) + SourceIndex(0) +13>Emitted(20, 157) Source(41, 9) + SourceIndex(0) +14>Emitted(20, 174) Source(41, 44) + SourceIndex(0) +15>Emitted(20, 176) Source(41, 9) + SourceIndex(0) +16>Emitted(20, 221) Source(41, 44) + SourceIndex(0) +17>Emitted(20, 223) Source(43, 5) + SourceIndex(0) +18>Emitted(20, 233) Source(43, 15) + SourceIndex(0) +19>Emitted(20, 234) Source(43, 15) + SourceIndex(0) +20>Emitted(20, 236) Source(43, 17) + SourceIndex(0) +21>Emitted(20, 237) Source(43, 18) + SourceIndex(0) +22>Emitted(20, 240) Source(43, 21) + SourceIndex(0) +23>Emitted(20, 241) Source(43, 22) + SourceIndex(0) +24>Emitted(20, 243) Source(43, 24) + SourceIndex(0) +25>Emitted(20, 244) Source(43, 25) + SourceIndex(0) +26>Emitted(20, 247) Source(43, 28) + SourceIndex(0) +27>Emitted(20, 248) Source(43, 29) + SourceIndex(0) +28>Emitted(20, 250) Source(43, 31) + SourceIndex(0) +29>Emitted(20, 251) Source(43, 32) + SourceIndex(0) +30>Emitted(20, 253) Source(43, 34) + SourceIndex(0) +31>Emitted(20, 255) Source(43, 36) + SourceIndex(0) +32>Emitted(20, 256) Source(43, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(21, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(21, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(21, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(21, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(21, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(21, 25) Source(44, 25) + SourceIndex(0) +7 >Emitted(21, 26) Source(44, 26) + SourceIndex(0) +8 >Emitted(21, 27) Source(44, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(22, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(22, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for ((_k = getMultiRobot(), _l = _k.skills, _m = _l === void 0 ? { primary: "none", secondary: "none" } : _l, _o = _m.primary, primaryA = _o === void 0 ? "primary" : _o, _p = _m.secondary, secondaryA = _p === void 0 ? "secondary" : _p, _k), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(23, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(23, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(23, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(23, 6) Source(46, 6) + SourceIndex(0) +5 >Emitted(23, 7) Source(46, 6) + SourceIndex(0) +6 >Emitted(23, 27) Source(51, 20) + SourceIndex(0) +7 >Emitted(23, 29) Source(47, 5) + SourceIndex(0) +8 >Emitted(23, 43) Source(50, 47) + SourceIndex(0) +9 >Emitted(23, 45) Source(47, 5) + SourceIndex(0) +10>Emitted(23, 109) Source(50, 47) + SourceIndex(0) +11>Emitted(23, 111) Source(48, 9) + SourceIndex(0) +12>Emitted(23, 126) Source(48, 38) + SourceIndex(0) +13>Emitted(23, 128) Source(48, 9) + SourceIndex(0) +14>Emitted(23, 169) Source(48, 38) + SourceIndex(0) +15>Emitted(23, 171) Source(49, 9) + SourceIndex(0) +16>Emitted(23, 188) Source(49, 44) + SourceIndex(0) +17>Emitted(23, 190) Source(49, 9) + SourceIndex(0) +18>Emitted(23, 235) Source(49, 44) + SourceIndex(0) +19>Emitted(23, 240) Source(51, 20) + SourceIndex(0) +20>Emitted(23, 242) Source(51, 22) + SourceIndex(0) +21>Emitted(23, 243) Source(51, 23) + SourceIndex(0) +22>Emitted(23, 246) Source(51, 26) + SourceIndex(0) +23>Emitted(23, 247) Source(51, 27) + SourceIndex(0) +24>Emitted(23, 249) Source(51, 29) + SourceIndex(0) +25>Emitted(23, 250) Source(51, 30) + SourceIndex(0) +26>Emitted(23, 253) Source(51, 33) + SourceIndex(0) +27>Emitted(23, 254) Source(51, 34) + SourceIndex(0) +28>Emitted(23, 256) Source(51, 36) + SourceIndex(0) +29>Emitted(23, 257) Source(51, 37) + SourceIndex(0) +30>Emitted(23, 259) Source(51, 39) + SourceIndex(0) +31>Emitted(23, 261) Source(51, 41) + SourceIndex(0) +32>Emitted(23, 262) Source(51, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(52, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(52, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(52, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(52, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(52, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(52, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(52, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(25, 1) Source(53, 1) + SourceIndex(0) +2 >Emitted(25, 2) Source(53, 2) + SourceIndex(0) +--- +>>>for ((_q = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _r = _q.skills, _s = _r === void 0 ? { primary: "none", secondary: "none" } : _r, _t = _s.primary, primaryA = _t === void 0 ? "primary" : _t, _u = _s.secondary, secondaryA = _u === void 0 ? "secondary" : _u, _q), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(26, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(54, 6) + SourceIndex(0) +5 >Emitted(26, 7) Source(54, 6) + SourceIndex(0) +6 >Emitted(26, 85) Source(59, 90) + SourceIndex(0) +7 >Emitted(26, 87) Source(55, 5) + SourceIndex(0) +8 >Emitted(26, 101) Source(58, 47) + SourceIndex(0) +9 >Emitted(26, 103) Source(55, 5) + SourceIndex(0) +10>Emitted(26, 167) Source(58, 47) + SourceIndex(0) +11>Emitted(26, 169) Source(56, 9) + SourceIndex(0) +12>Emitted(26, 184) Source(56, 38) + SourceIndex(0) +13>Emitted(26, 186) Source(56, 9) + SourceIndex(0) +14>Emitted(26, 227) Source(56, 38) + SourceIndex(0) +15>Emitted(26, 229) Source(57, 9) + SourceIndex(0) +16>Emitted(26, 246) Source(57, 44) + SourceIndex(0) +17>Emitted(26, 248) Source(57, 9) + SourceIndex(0) +18>Emitted(26, 293) Source(57, 44) + SourceIndex(0) +19>Emitted(26, 298) Source(59, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(27, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(27, 6) Source(60, 6) + SourceIndex(0) +3 >Emitted(27, 9) Source(60, 9) + SourceIndex(0) +4 >Emitted(27, 10) Source(60, 10) + SourceIndex(0) +5 >Emitted(27, 12) Source(60, 12) + SourceIndex(0) +6 >Emitted(27, 13) Source(60, 13) + SourceIndex(0) +7 >Emitted(27, 16) Source(60, 16) + SourceIndex(0) +8 >Emitted(27, 17) Source(60, 17) + SourceIndex(0) +9 >Emitted(27, 19) Source(60, 19) + SourceIndex(0) +10>Emitted(27, 20) Source(60, 20) + SourceIndex(0) +11>Emitted(27, 22) Source(60, 22) + SourceIndex(0) +12>Emitted(27, 24) Source(60, 24) + SourceIndex(0) +13>Emitted(27, 25) Source(60, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(28, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(61, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(61, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(61, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(29, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(29, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for ((_v = robot.name, name = _v === void 0 ? "noName" : _v, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name = "noName" +7 > +8 > name = "noName" +9 > } = +10> robot +11> +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(30, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(64, 6) + SourceIndex(0) +5 >Emitted(30, 7) Source(64, 8) + SourceIndex(0) +6 >Emitted(30, 22) Source(64, 23) + SourceIndex(0) +7 >Emitted(30, 24) Source(64, 8) + SourceIndex(0) +8 >Emitted(30, 60) Source(64, 23) + SourceIndex(0) +9 >Emitted(30, 62) Source(64, 28) + SourceIndex(0) +10>Emitted(30, 67) Source(64, 33) + SourceIndex(0) +11>Emitted(30, 68) Source(64, 33) + SourceIndex(0) +12>Emitted(30, 70) Source(64, 35) + SourceIndex(0) +13>Emitted(30, 71) Source(64, 36) + SourceIndex(0) +14>Emitted(30, 74) Source(64, 39) + SourceIndex(0) +15>Emitted(30, 75) Source(64, 40) + SourceIndex(0) +16>Emitted(30, 77) Source(64, 42) + SourceIndex(0) +17>Emitted(30, 78) Source(64, 43) + SourceIndex(0) +18>Emitted(30, 81) Source(64, 46) + SourceIndex(0) +19>Emitted(30, 82) Source(64, 47) + SourceIndex(0) +20>Emitted(30, 84) Source(64, 49) + SourceIndex(0) +21>Emitted(30, 85) Source(64, 50) + SourceIndex(0) +22>Emitted(30, 87) Source(64, 52) + SourceIndex(0) +23>Emitted(30, 89) Source(64, 54) + SourceIndex(0) +24>Emitted(30, 90) Source(64, 55) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(31, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(31, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(31, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for ((_w = getRobot(), _x = _w.name, name = _x === void 0 ? "noName" : _x, _w), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName" } = getRobot() +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> } = getRobot() +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(33, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(67, 6) + SourceIndex(0) +5 >Emitted(33, 7) Source(67, 6) + SourceIndex(0) +6 >Emitted(33, 22) Source(67, 38) + SourceIndex(0) +7 >Emitted(33, 24) Source(67, 8) + SourceIndex(0) +8 >Emitted(33, 36) Source(67, 23) + SourceIndex(0) +9 >Emitted(33, 38) Source(67, 8) + SourceIndex(0) +10>Emitted(33, 74) Source(67, 23) + SourceIndex(0) +11>Emitted(33, 79) Source(67, 38) + SourceIndex(0) +12>Emitted(33, 81) Source(67, 40) + SourceIndex(0) +13>Emitted(33, 82) Source(67, 41) + SourceIndex(0) +14>Emitted(33, 85) Source(67, 44) + SourceIndex(0) +15>Emitted(33, 86) Source(67, 45) + SourceIndex(0) +16>Emitted(33, 88) Source(67, 47) + SourceIndex(0) +17>Emitted(33, 89) Source(67, 48) + SourceIndex(0) +18>Emitted(33, 92) Source(67, 51) + SourceIndex(0) +19>Emitted(33, 93) Source(67, 52) + SourceIndex(0) +20>Emitted(33, 95) Source(67, 54) + SourceIndex(0) +21>Emitted(33, 96) Source(67, 55) + SourceIndex(0) +22>Emitted(33, 98) Source(67, 57) + SourceIndex(0) +23>Emitted(33, 100) Source(67, 59) + SourceIndex(0) +24>Emitted(33, 101) Source(67, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(34, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(34, 22) Source(68, 22) + SourceIndex(0) +7 >Emitted(34, 23) Source(68, 23) + SourceIndex(0) +8 >Emitted(34, 24) Source(68, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for ((_y = { name: "trimmer", skill: "trimming" }, _z = _y.name, name = _z === void 0 ? "noName" : _z, _y), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ +24> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> } = { name: "trimmer", skill: "trimming" } +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) +24> { +1->Emitted(36, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(36, 4) Source(70, 4) + SourceIndex(0) +3 >Emitted(36, 5) Source(70, 5) + SourceIndex(0) +4 >Emitted(36, 6) Source(70, 6) + SourceIndex(0) +5 >Emitted(36, 7) Source(70, 6) + SourceIndex(0) +6 >Emitted(36, 50) Source(70, 73) + SourceIndex(0) +7 >Emitted(36, 52) Source(70, 8) + SourceIndex(0) +8 >Emitted(36, 64) Source(70, 23) + SourceIndex(0) +9 >Emitted(36, 66) Source(70, 8) + SourceIndex(0) +10>Emitted(36, 102) Source(70, 23) + SourceIndex(0) +11>Emitted(36, 107) Source(70, 73) + SourceIndex(0) +12>Emitted(36, 109) Source(70, 75) + SourceIndex(0) +13>Emitted(36, 110) Source(70, 76) + SourceIndex(0) +14>Emitted(36, 113) Source(70, 79) + SourceIndex(0) +15>Emitted(36, 114) Source(70, 80) + SourceIndex(0) +16>Emitted(36, 116) Source(70, 82) + SourceIndex(0) +17>Emitted(36, 117) Source(70, 83) + SourceIndex(0) +18>Emitted(36, 120) Source(70, 86) + SourceIndex(0) +19>Emitted(36, 121) Source(70, 87) + SourceIndex(0) +20>Emitted(36, 123) Source(70, 89) + SourceIndex(0) +21>Emitted(36, 124) Source(70, 90) + SourceIndex(0) +22>Emitted(36, 126) Source(70, 92) + SourceIndex(0) +23>Emitted(36, 128) Source(70, 94) + SourceIndex(0) +24>Emitted(36, 129) Source(70, 95) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(71, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(71, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(71, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(71, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(71, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(71, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(71, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(71, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(72, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(72, 2) + SourceIndex(0) +--- +>>>for ((_0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primary = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondary = _3 === void 0 ? "secondary" : _3, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +7 > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> primary = "primary" +11> +12> primary = "primary" +13> , + > +14> secondary = "secondary" +15> +16> secondary = "secondary" +17> + > } = { primary: "none", secondary: "none" } + > } = +18> multiRobot +19> +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(39, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(73, 6) + SourceIndex(0) +5 >Emitted(39, 7) Source(74, 5) + SourceIndex(0) +6 >Emitted(39, 29) Source(77, 47) + SourceIndex(0) +7 >Emitted(39, 31) Source(74, 5) + SourceIndex(0) +8 >Emitted(39, 95) Source(77, 47) + SourceIndex(0) +9 >Emitted(39, 97) Source(75, 9) + SourceIndex(0) +10>Emitted(39, 112) Source(75, 28) + SourceIndex(0) +11>Emitted(39, 114) Source(75, 9) + SourceIndex(0) +12>Emitted(39, 154) Source(75, 28) + SourceIndex(0) +13>Emitted(39, 156) Source(76, 9) + SourceIndex(0) +14>Emitted(39, 173) Source(76, 32) + SourceIndex(0) +15>Emitted(39, 175) Source(76, 9) + SourceIndex(0) +16>Emitted(39, 219) Source(76, 32) + SourceIndex(0) +17>Emitted(39, 221) Source(78, 5) + SourceIndex(0) +18>Emitted(39, 231) Source(78, 15) + SourceIndex(0) +19>Emitted(39, 232) Source(78, 15) + SourceIndex(0) +20>Emitted(39, 234) Source(78, 17) + SourceIndex(0) +21>Emitted(39, 235) Source(78, 18) + SourceIndex(0) +22>Emitted(39, 238) Source(78, 21) + SourceIndex(0) +23>Emitted(39, 239) Source(78, 22) + SourceIndex(0) +24>Emitted(39, 241) Source(78, 24) + SourceIndex(0) +25>Emitted(39, 242) Source(78, 25) + SourceIndex(0) +26>Emitted(39, 245) Source(78, 28) + SourceIndex(0) +27>Emitted(39, 246) Source(78, 29) + SourceIndex(0) +28>Emitted(39, 248) Source(78, 31) + SourceIndex(0) +29>Emitted(39, 249) Source(78, 32) + SourceIndex(0) +30>Emitted(39, 251) Source(78, 34) + SourceIndex(0) +31>Emitted(39, 253) Source(78, 36) + SourceIndex(0) +32>Emitted(39, 254) Source(78, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(40, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(40, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(40, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(40, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(40, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(40, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(40, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(40, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for ((_4 = getMultiRobot(), _5 = _4.skills, _6 = _5 === void 0 ? { primary: "none", secondary: "none" } : _5, _7 = _6.primary, primary = _7 === void 0 ? "primary" : _7, _8 = _6.secondary, secondary = _8 === void 0 ? "secondary" : _8, _4), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ +32> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) +32> { +1->Emitted(42, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(42, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(42, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(42, 6) Source(81, 6) + SourceIndex(0) +5 >Emitted(42, 7) Source(81, 6) + SourceIndex(0) +6 >Emitted(42, 27) Source(86, 20) + SourceIndex(0) +7 >Emitted(42, 29) Source(82, 5) + SourceIndex(0) +8 >Emitted(42, 43) Source(85, 47) + SourceIndex(0) +9 >Emitted(42, 45) Source(82, 5) + SourceIndex(0) +10>Emitted(42, 109) Source(85, 47) + SourceIndex(0) +11>Emitted(42, 111) Source(83, 9) + SourceIndex(0) +12>Emitted(42, 126) Source(83, 28) + SourceIndex(0) +13>Emitted(42, 128) Source(83, 9) + SourceIndex(0) +14>Emitted(42, 168) Source(83, 28) + SourceIndex(0) +15>Emitted(42, 170) Source(84, 9) + SourceIndex(0) +16>Emitted(42, 187) Source(84, 32) + SourceIndex(0) +17>Emitted(42, 189) Source(84, 9) + SourceIndex(0) +18>Emitted(42, 233) Source(84, 32) + SourceIndex(0) +19>Emitted(42, 238) Source(86, 20) + SourceIndex(0) +20>Emitted(42, 240) Source(86, 22) + SourceIndex(0) +21>Emitted(42, 241) Source(86, 23) + SourceIndex(0) +22>Emitted(42, 244) Source(86, 26) + SourceIndex(0) +23>Emitted(42, 245) Source(86, 27) + SourceIndex(0) +24>Emitted(42, 247) Source(86, 29) + SourceIndex(0) +25>Emitted(42, 248) Source(86, 30) + SourceIndex(0) +26>Emitted(42, 251) Source(86, 33) + SourceIndex(0) +27>Emitted(42, 252) Source(86, 34) + SourceIndex(0) +28>Emitted(42, 254) Source(86, 36) + SourceIndex(0) +29>Emitted(42, 255) Source(86, 37) + SourceIndex(0) +30>Emitted(42, 257) Source(86, 39) + SourceIndex(0) +31>Emitted(42, 259) Source(86, 41) + SourceIndex(0) +32>Emitted(42, 260) Source(86, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(43, 25) Source(87, 25) + SourceIndex(0) +7 >Emitted(43, 26) Source(87, 26) + SourceIndex(0) +8 >Emitted(43, 27) Source(87, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(44, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(44, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for ((_9 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _10 = _9.skills, _11 = _10 === void 0 ? { primary: "none", secondary: "none" } : _10, _12 = _11.primary, primary = _12 === void 0 ? "primary" : _12, _13 = _11.secondary, secondary = _13 === void 0 ? "secondary" : _13, _9), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +19> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(45, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(89, 6) + SourceIndex(0) +5 >Emitted(45, 7) Source(89, 6) + SourceIndex(0) +6 >Emitted(45, 85) Source(94, 90) + SourceIndex(0) +7 >Emitted(45, 87) Source(90, 5) + SourceIndex(0) +8 >Emitted(45, 102) Source(93, 47) + SourceIndex(0) +9 >Emitted(45, 104) Source(90, 5) + SourceIndex(0) +10>Emitted(45, 171) Source(93, 47) + SourceIndex(0) +11>Emitted(45, 173) Source(91, 9) + SourceIndex(0) +12>Emitted(45, 190) Source(91, 28) + SourceIndex(0) +13>Emitted(45, 192) Source(91, 9) + SourceIndex(0) +14>Emitted(45, 234) Source(91, 28) + SourceIndex(0) +15>Emitted(45, 236) Source(92, 9) + SourceIndex(0) +16>Emitted(45, 255) Source(92, 32) + SourceIndex(0) +17>Emitted(45, 257) Source(92, 9) + SourceIndex(0) +18>Emitted(45, 303) Source(92, 32) + SourceIndex(0) +19>Emitted(45, 308) Source(94, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(46, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(46, 6) Source(95, 6) + SourceIndex(0) +3 >Emitted(46, 9) Source(95, 9) + SourceIndex(0) +4 >Emitted(46, 10) Source(95, 10) + SourceIndex(0) +5 >Emitted(46, 12) Source(95, 12) + SourceIndex(0) +6 >Emitted(46, 13) Source(95, 13) + SourceIndex(0) +7 >Emitted(46, 16) Source(95, 16) + SourceIndex(0) +8 >Emitted(46, 17) Source(95, 17) + SourceIndex(0) +9 >Emitted(46, 19) Source(95, 19) + SourceIndex(0) +10>Emitted(46, 20) Source(95, 20) + SourceIndex(0) +11>Emitted(46, 22) Source(95, 22) + SourceIndex(0) +12>Emitted(46, 24) Source(95, 24) + SourceIndex(0) +13>Emitted(46, 25) Source(95, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(47, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(47, 25) Source(96, 25) + SourceIndex(0) +7 >Emitted(47, 26) Source(96, 26) + SourceIndex(0) +8 >Emitted(47, 27) Source(96, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(48, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(48, 2) Source(97, 2) + SourceIndex(0) +--- +>>>for ((_14 = robot.name, nameA = _14 === void 0 ? "noName" : _14, _15 = robot.skill, skillA = _15 === void 0 ? "skill" : _15, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > + > + > +2 >for +3 > +4 > ( +5 > { +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , +10> skill: skillA = "skill" +11> +12> skill: skillA = "skill" +13> } = +14> robot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(49, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(100, 6) + SourceIndex(0) +5 >Emitted(49, 7) Source(100, 7) + SourceIndex(0) +6 >Emitted(49, 23) Source(100, 29) + SourceIndex(0) +7 >Emitted(49, 25) Source(100, 7) + SourceIndex(0) +8 >Emitted(49, 64) Source(100, 29) + SourceIndex(0) +9 >Emitted(49, 66) Source(100, 31) + SourceIndex(0) +10>Emitted(49, 83) Source(100, 54) + SourceIndex(0) +11>Emitted(49, 85) Source(100, 31) + SourceIndex(0) +12>Emitted(49, 124) Source(100, 54) + SourceIndex(0) +13>Emitted(49, 126) Source(100, 59) + SourceIndex(0) +14>Emitted(49, 131) Source(100, 64) + SourceIndex(0) +15>Emitted(49, 132) Source(100, 64) + SourceIndex(0) +16>Emitted(49, 134) Source(100, 66) + SourceIndex(0) +17>Emitted(49, 135) Source(100, 67) + SourceIndex(0) +18>Emitted(49, 138) Source(100, 70) + SourceIndex(0) +19>Emitted(49, 139) Source(100, 71) + SourceIndex(0) +20>Emitted(49, 141) Source(100, 73) + SourceIndex(0) +21>Emitted(49, 142) Source(100, 74) + SourceIndex(0) +22>Emitted(49, 145) Source(100, 77) + SourceIndex(0) +23>Emitted(49, 146) Source(100, 78) + SourceIndex(0) +24>Emitted(49, 148) Source(100, 80) + SourceIndex(0) +25>Emitted(49, 149) Source(100, 81) + SourceIndex(0) +26>Emitted(49, 151) Source(100, 83) + SourceIndex(0) +27>Emitted(49, 153) Source(100, 85) + SourceIndex(0) +28>Emitted(49, 154) Source(100, 86) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(50, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(50, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(50, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(50, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(50, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(50, 22) Source(101, 22) + SourceIndex(0) +7 >Emitted(50, 23) Source(101, 23) + SourceIndex(0) +8 >Emitted(50, 24) Source(101, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(51, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(51, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for ((_16 = getRobot(), _17 = _16.name, nameA = _17 === void 0 ? "noName" : _17, _18 = _16.skill, skillA = _18 === void 0 ? "skill" : _18, _16), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName", skill: skillA = "skill" } = getRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = getRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(52, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(52, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(52, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(52, 6) Source(103, 6) + SourceIndex(0) +5 >Emitted(52, 7) Source(103, 6) + SourceIndex(0) +6 >Emitted(52, 23) Source(103, 69) + SourceIndex(0) +7 >Emitted(52, 25) Source(103, 7) + SourceIndex(0) +8 >Emitted(52, 39) Source(103, 29) + SourceIndex(0) +9 >Emitted(52, 41) Source(103, 7) + SourceIndex(0) +10>Emitted(52, 80) Source(103, 29) + SourceIndex(0) +11>Emitted(52, 82) Source(103, 31) + SourceIndex(0) +12>Emitted(52, 97) Source(103, 54) + SourceIndex(0) +13>Emitted(52, 99) Source(103, 31) + SourceIndex(0) +14>Emitted(52, 138) Source(103, 54) + SourceIndex(0) +15>Emitted(52, 144) Source(103, 69) + SourceIndex(0) +16>Emitted(52, 146) Source(103, 71) + SourceIndex(0) +17>Emitted(52, 147) Source(103, 72) + SourceIndex(0) +18>Emitted(52, 150) Source(103, 75) + SourceIndex(0) +19>Emitted(52, 151) Source(103, 76) + SourceIndex(0) +20>Emitted(52, 153) Source(103, 78) + SourceIndex(0) +21>Emitted(52, 154) Source(103, 79) + SourceIndex(0) +22>Emitted(52, 157) Source(103, 82) + SourceIndex(0) +23>Emitted(52, 158) Source(103, 83) + SourceIndex(0) +24>Emitted(52, 160) Source(103, 85) + SourceIndex(0) +25>Emitted(52, 161) Source(103, 86) + SourceIndex(0) +26>Emitted(52, 163) Source(103, 88) + SourceIndex(0) +27>Emitted(52, 165) Source(103, 90) + SourceIndex(0) +28>Emitted(52, 166) Source(103, 91) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(104, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(104, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(104, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(54, 1) Source(105, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for ((_19 = { name: "trimmer", skill: "trimming" }, _20 = _19.name, nameA = _20 === void 0 ? "noName" : _20, _21 = _19.skill, skillA = _21 === void 0 ? "skill" : _21, _19), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , +12> skill: skillA = "skill" +13> +14> skill: skillA = "skill" +15> } = { name: "trimmer", skill: "trimming" } +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(55, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(106, 6) + SourceIndex(0) +5 >Emitted(55, 7) Source(106, 6) + SourceIndex(0) +6 >Emitted(55, 51) Source(106, 104) + SourceIndex(0) +7 >Emitted(55, 53) Source(106, 7) + SourceIndex(0) +8 >Emitted(55, 67) Source(106, 29) + SourceIndex(0) +9 >Emitted(55, 69) Source(106, 7) + SourceIndex(0) +10>Emitted(55, 108) Source(106, 29) + SourceIndex(0) +11>Emitted(55, 110) Source(106, 31) + SourceIndex(0) +12>Emitted(55, 125) Source(106, 54) + SourceIndex(0) +13>Emitted(55, 127) Source(106, 31) + SourceIndex(0) +14>Emitted(55, 166) Source(106, 54) + SourceIndex(0) +15>Emitted(55, 172) Source(106, 104) + SourceIndex(0) +16>Emitted(55, 174) Source(106, 106) + SourceIndex(0) +17>Emitted(55, 175) Source(106, 107) + SourceIndex(0) +18>Emitted(55, 178) Source(106, 110) + SourceIndex(0) +19>Emitted(55, 179) Source(106, 111) + SourceIndex(0) +20>Emitted(55, 181) Source(106, 113) + SourceIndex(0) +21>Emitted(55, 182) Source(106, 114) + SourceIndex(0) +22>Emitted(55, 185) Source(106, 117) + SourceIndex(0) +23>Emitted(55, 186) Source(106, 118) + SourceIndex(0) +24>Emitted(55, 188) Source(106, 120) + SourceIndex(0) +25>Emitted(55, 189) Source(106, 121) + SourceIndex(0) +26>Emitted(55, 191) Source(106, 123) + SourceIndex(0) +27>Emitted(55, 193) Source(106, 125) + SourceIndex(0) +28>Emitted(55, 194) Source(106, 126) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(56, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(56, 12) Source(107, 12) + SourceIndex(0) +3 >Emitted(56, 13) Source(107, 13) + SourceIndex(0) +4 >Emitted(56, 16) Source(107, 16) + SourceIndex(0) +5 >Emitted(56, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(56, 22) Source(107, 22) + SourceIndex(0) +7 >Emitted(56, 23) Source(107, 23) + SourceIndex(0) +8 >Emitted(56, 24) Source(107, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(57, 1) Source(108, 1) + SourceIndex(0) +2 >Emitted(57, 2) Source(108, 2) + SourceIndex(0) +--- +>>>for ((_22 = multiRobot.name, nameA = _22 === void 0 ? "noName" : _22, _23 = multiRobot.skills, _24 = _23 === void 0 ? { primary: "none", secondary: "none" } : _23, _25 = _24.primary, primaryA = _25 === void 0 ? "primary" : _25, _26 = _24.secondary, secondaryA = _26 === void 0 ? "secondary" : _26, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , + > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> primary: primaryA = "primary" +15> +16> primary: primaryA = "primary" +17> , + > +18> secondary: secondaryA = "secondary" +19> +20> secondary: secondaryA = "secondary" +21> + > } = { primary: "none", secondary: "none" } + > } = +22> multiRobot +23> +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(58, 1) Source(109, 1) + SourceIndex(0) +2 >Emitted(58, 4) Source(109, 4) + SourceIndex(0) +3 >Emitted(58, 5) Source(109, 5) + SourceIndex(0) +4 >Emitted(58, 6) Source(109, 6) + SourceIndex(0) +5 >Emitted(58, 7) Source(110, 5) + SourceIndex(0) +6 >Emitted(58, 28) Source(110, 27) + SourceIndex(0) +7 >Emitted(58, 30) Source(110, 5) + SourceIndex(0) +8 >Emitted(58, 69) Source(110, 27) + SourceIndex(0) +9 >Emitted(58, 71) Source(111, 5) + SourceIndex(0) +10>Emitted(58, 94) Source(114, 47) + SourceIndex(0) +11>Emitted(58, 96) Source(111, 5) + SourceIndex(0) +12>Emitted(58, 163) Source(114, 47) + SourceIndex(0) +13>Emitted(58, 165) Source(112, 9) + SourceIndex(0) +14>Emitted(58, 182) Source(112, 38) + SourceIndex(0) +15>Emitted(58, 184) Source(112, 9) + SourceIndex(0) +16>Emitted(58, 227) Source(112, 38) + SourceIndex(0) +17>Emitted(58, 229) Source(113, 9) + SourceIndex(0) +18>Emitted(58, 248) Source(113, 44) + SourceIndex(0) +19>Emitted(58, 250) Source(113, 9) + SourceIndex(0) +20>Emitted(58, 297) Source(113, 44) + SourceIndex(0) +21>Emitted(58, 299) Source(115, 5) + SourceIndex(0) +22>Emitted(58, 309) Source(115, 15) + SourceIndex(0) +23>Emitted(58, 310) Source(115, 15) + SourceIndex(0) +24>Emitted(58, 312) Source(115, 17) + SourceIndex(0) +25>Emitted(58, 313) Source(115, 18) + SourceIndex(0) +26>Emitted(58, 316) Source(115, 21) + SourceIndex(0) +27>Emitted(58, 317) Source(115, 22) + SourceIndex(0) +28>Emitted(58, 319) Source(115, 24) + SourceIndex(0) +29>Emitted(58, 320) Source(115, 25) + SourceIndex(0) +30>Emitted(58, 323) Source(115, 28) + SourceIndex(0) +31>Emitted(58, 324) Source(115, 29) + SourceIndex(0) +32>Emitted(58, 326) Source(115, 31) + SourceIndex(0) +33>Emitted(58, 327) Source(115, 32) + SourceIndex(0) +34>Emitted(58, 329) Source(115, 34) + SourceIndex(0) +35>Emitted(58, 331) Source(115, 36) + SourceIndex(0) +36>Emitted(58, 332) Source(115, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(59, 5) Source(116, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(116, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(116, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(116, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(116, 17) + SourceIndex(0) +6 >Emitted(59, 25) Source(116, 25) + SourceIndex(0) +7 >Emitted(59, 26) Source(116, 26) + SourceIndex(0) +8 >Emitted(59, 27) Source(116, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(60, 1) Source(117, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(117, 2) + SourceIndex(0) +--- +>>>for ((_27 = getMultiRobot(), _28 = _27.name, nameA = _28 === void 0 ? "noName" : _28, _29 = _27.skills, _30 = _29 === void 0 ? { primary: "none", secondary: "none" } : _29, _31 = _30.primary, primaryA = _31 === void 0 ? "primary" : _31, _32 = _30.secondary, secondaryA = _32 === void 0 ? "secondary" : _32, _27), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(61, 1) Source(118, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(118, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(118, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(118, 6) + SourceIndex(0) +5 >Emitted(61, 7) Source(118, 6) + SourceIndex(0) +6 >Emitted(61, 28) Source(124, 20) + SourceIndex(0) +7 >Emitted(61, 30) Source(119, 5) + SourceIndex(0) +8 >Emitted(61, 44) Source(119, 27) + SourceIndex(0) +9 >Emitted(61, 46) Source(119, 5) + SourceIndex(0) +10>Emitted(61, 85) Source(119, 27) + SourceIndex(0) +11>Emitted(61, 87) Source(120, 5) + SourceIndex(0) +12>Emitted(61, 103) Source(123, 47) + SourceIndex(0) +13>Emitted(61, 105) Source(120, 5) + SourceIndex(0) +14>Emitted(61, 172) Source(123, 47) + SourceIndex(0) +15>Emitted(61, 174) Source(121, 9) + SourceIndex(0) +16>Emitted(61, 191) Source(121, 38) + SourceIndex(0) +17>Emitted(61, 193) Source(121, 9) + SourceIndex(0) +18>Emitted(61, 236) Source(121, 38) + SourceIndex(0) +19>Emitted(61, 238) Source(122, 9) + SourceIndex(0) +20>Emitted(61, 257) Source(122, 44) + SourceIndex(0) +21>Emitted(61, 259) Source(122, 9) + SourceIndex(0) +22>Emitted(61, 306) Source(122, 44) + SourceIndex(0) +23>Emitted(61, 312) Source(124, 20) + SourceIndex(0) +24>Emitted(61, 314) Source(124, 22) + SourceIndex(0) +25>Emitted(61, 315) Source(124, 23) + SourceIndex(0) +26>Emitted(61, 318) Source(124, 26) + SourceIndex(0) +27>Emitted(61, 319) Source(124, 27) + SourceIndex(0) +28>Emitted(61, 321) Source(124, 29) + SourceIndex(0) +29>Emitted(61, 322) Source(124, 30) + SourceIndex(0) +30>Emitted(61, 325) Source(124, 33) + SourceIndex(0) +31>Emitted(61, 326) Source(124, 34) + SourceIndex(0) +32>Emitted(61, 328) Source(124, 36) + SourceIndex(0) +33>Emitted(61, 329) Source(124, 37) + SourceIndex(0) +34>Emitted(61, 331) Source(124, 39) + SourceIndex(0) +35>Emitted(61, 333) Source(124, 41) + SourceIndex(0) +36>Emitted(61, 334) Source(124, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(62, 5) Source(125, 5) + SourceIndex(0) +2 >Emitted(62, 12) Source(125, 12) + SourceIndex(0) +3 >Emitted(62, 13) Source(125, 13) + SourceIndex(0) +4 >Emitted(62, 16) Source(125, 16) + SourceIndex(0) +5 >Emitted(62, 17) Source(125, 17) + SourceIndex(0) +6 >Emitted(62, 25) Source(125, 25) + SourceIndex(0) +7 >Emitted(62, 26) Source(125, 26) + SourceIndex(0) +8 >Emitted(62, 27) Source(125, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(63, 1) Source(126, 1) + SourceIndex(0) +2 >Emitted(63, 2) Source(126, 2) + SourceIndex(0) +--- +>>>for ((_33 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _34 = _33.name, nameA = _34 === void 0 ? "noName" : _34, _35 = _33.skills, _36 = _35 === void 0 ? { primary: "none", secondary: "none" } : _35, _37 = _36.primary, primaryA = _37 === void 0 ? "primary" : _37, _38 = _36.secondary, secondaryA = _38 === void 0 ? "secondary" : _38, _33), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name: nameA = "noName" +9 > +10> name: nameA = "noName" +11> , + > +12> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary: primaryA = "primary" +17> +18> primary: primaryA = "primary" +19> , + > +20> secondary: secondaryA = "secondary" +21> +22> secondary: secondaryA = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(64, 1) Source(127, 1) + SourceIndex(0) +2 >Emitted(64, 4) Source(127, 4) + SourceIndex(0) +3 >Emitted(64, 5) Source(127, 5) + SourceIndex(0) +4 >Emitted(64, 6) Source(127, 6) + SourceIndex(0) +5 >Emitted(64, 7) Source(127, 6) + SourceIndex(0) +6 >Emitted(64, 86) Source(133, 90) + SourceIndex(0) +7 >Emitted(64, 88) Source(128, 5) + SourceIndex(0) +8 >Emitted(64, 102) Source(128, 27) + SourceIndex(0) +9 >Emitted(64, 104) Source(128, 5) + SourceIndex(0) +10>Emitted(64, 143) Source(128, 27) + SourceIndex(0) +11>Emitted(64, 145) Source(129, 5) + SourceIndex(0) +12>Emitted(64, 161) Source(132, 47) + SourceIndex(0) +13>Emitted(64, 163) Source(129, 5) + SourceIndex(0) +14>Emitted(64, 230) Source(132, 47) + SourceIndex(0) +15>Emitted(64, 232) Source(130, 9) + SourceIndex(0) +16>Emitted(64, 249) Source(130, 38) + SourceIndex(0) +17>Emitted(64, 251) Source(130, 9) + SourceIndex(0) +18>Emitted(64, 294) Source(130, 38) + SourceIndex(0) +19>Emitted(64, 296) Source(131, 9) + SourceIndex(0) +20>Emitted(64, 315) Source(131, 44) + SourceIndex(0) +21>Emitted(64, 317) Source(131, 9) + SourceIndex(0) +22>Emitted(64, 364) Source(131, 44) + SourceIndex(0) +23>Emitted(64, 370) Source(133, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(65, 5) Source(134, 5) + SourceIndex(0) +2 >Emitted(65, 6) Source(134, 6) + SourceIndex(0) +3 >Emitted(65, 9) Source(134, 9) + SourceIndex(0) +4 >Emitted(65, 10) Source(134, 10) + SourceIndex(0) +5 >Emitted(65, 12) Source(134, 12) + SourceIndex(0) +6 >Emitted(65, 13) Source(134, 13) + SourceIndex(0) +7 >Emitted(65, 16) Source(134, 16) + SourceIndex(0) +8 >Emitted(65, 17) Source(134, 17) + SourceIndex(0) +9 >Emitted(65, 19) Source(134, 19) + SourceIndex(0) +10>Emitted(65, 20) Source(134, 20) + SourceIndex(0) +11>Emitted(65, 22) Source(134, 22) + SourceIndex(0) +12>Emitted(65, 24) Source(134, 24) + SourceIndex(0) +13>Emitted(65, 25) Source(134, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(66, 5) Source(135, 5) + SourceIndex(0) +2 >Emitted(66, 12) Source(135, 12) + SourceIndex(0) +3 >Emitted(66, 13) Source(135, 13) + SourceIndex(0) +4 >Emitted(66, 16) Source(135, 16) + SourceIndex(0) +5 >Emitted(66, 17) Source(135, 17) + SourceIndex(0) +6 >Emitted(66, 25) Source(135, 25) + SourceIndex(0) +7 >Emitted(66, 26) Source(135, 26) + SourceIndex(0) +8 >Emitted(66, 27) Source(135, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(67, 1) Source(136, 1) + SourceIndex(0) +2 >Emitted(67, 2) Source(136, 2) + SourceIndex(0) +--- +>>>for ((_39 = robot.name, name = _39 === void 0 ? "noName" : _39, _40 = robot.skill, skill = _40 === void 0 ? "skill" : _40, robot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > + > +2 >for +3 > +4 > ( +5 > { +6 > name = "noName" +7 > +8 > name = "noName" +9 > , +10> skill = "skill" +11> +12> skill = "skill" +13> } = +14> robot +15> +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(68, 1) Source(138, 1) + SourceIndex(0) +2 >Emitted(68, 4) Source(138, 4) + SourceIndex(0) +3 >Emitted(68, 5) Source(138, 5) + SourceIndex(0) +4 >Emitted(68, 6) Source(138, 6) + SourceIndex(0) +5 >Emitted(68, 7) Source(138, 8) + SourceIndex(0) +6 >Emitted(68, 23) Source(138, 23) + SourceIndex(0) +7 >Emitted(68, 25) Source(138, 8) + SourceIndex(0) +8 >Emitted(68, 63) Source(138, 23) + SourceIndex(0) +9 >Emitted(68, 65) Source(138, 25) + SourceIndex(0) +10>Emitted(68, 82) Source(138, 40) + SourceIndex(0) +11>Emitted(68, 84) Source(138, 25) + SourceIndex(0) +12>Emitted(68, 122) Source(138, 40) + SourceIndex(0) +13>Emitted(68, 124) Source(138, 45) + SourceIndex(0) +14>Emitted(68, 129) Source(138, 50) + SourceIndex(0) +15>Emitted(68, 130) Source(138, 50) + SourceIndex(0) +16>Emitted(68, 132) Source(138, 52) + SourceIndex(0) +17>Emitted(68, 133) Source(138, 53) + SourceIndex(0) +18>Emitted(68, 136) Source(138, 56) + SourceIndex(0) +19>Emitted(68, 137) Source(138, 57) + SourceIndex(0) +20>Emitted(68, 139) Source(138, 59) + SourceIndex(0) +21>Emitted(68, 140) Source(138, 60) + SourceIndex(0) +22>Emitted(68, 143) Source(138, 63) + SourceIndex(0) +23>Emitted(68, 144) Source(138, 64) + SourceIndex(0) +24>Emitted(68, 146) Source(138, 66) + SourceIndex(0) +25>Emitted(68, 147) Source(138, 67) + SourceIndex(0) +26>Emitted(68, 149) Source(138, 69) + SourceIndex(0) +27>Emitted(68, 151) Source(138, 71) + SourceIndex(0) +28>Emitted(68, 152) Source(138, 72) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(69, 5) Source(139, 5) + SourceIndex(0) +2 >Emitted(69, 12) Source(139, 12) + SourceIndex(0) +3 >Emitted(69, 13) Source(139, 13) + SourceIndex(0) +4 >Emitted(69, 16) Source(139, 16) + SourceIndex(0) +5 >Emitted(69, 17) Source(139, 17) + SourceIndex(0) +6 >Emitted(69, 22) Source(139, 22) + SourceIndex(0) +7 >Emitted(69, 23) Source(139, 23) + SourceIndex(0) +8 >Emitted(69, 24) Source(139, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(70, 1) Source(140, 1) + SourceIndex(0) +2 >Emitted(70, 2) Source(140, 2) + SourceIndex(0) +--- +>>>for ((_41 = getRobot(), _42 = _41.name, name = _42 === void 0 ? "noName" : _42, _43 = _41.skill, skill = _43 === void 0 ? "skill" : _43, _41), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName", skill = "skill" } = getRobot() +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , +12> skill = "skill" +13> +14> skill = "skill" +15> } = getRobot() +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(71, 1) Source(141, 1) + SourceIndex(0) +2 >Emitted(71, 4) Source(141, 4) + SourceIndex(0) +3 >Emitted(71, 5) Source(141, 5) + SourceIndex(0) +4 >Emitted(71, 6) Source(141, 6) + SourceIndex(0) +5 >Emitted(71, 7) Source(141, 6) + SourceIndex(0) +6 >Emitted(71, 23) Source(141, 55) + SourceIndex(0) +7 >Emitted(71, 25) Source(141, 8) + SourceIndex(0) +8 >Emitted(71, 39) Source(141, 23) + SourceIndex(0) +9 >Emitted(71, 41) Source(141, 8) + SourceIndex(0) +10>Emitted(71, 79) Source(141, 23) + SourceIndex(0) +11>Emitted(71, 81) Source(141, 25) + SourceIndex(0) +12>Emitted(71, 96) Source(141, 40) + SourceIndex(0) +13>Emitted(71, 98) Source(141, 25) + SourceIndex(0) +14>Emitted(71, 136) Source(141, 40) + SourceIndex(0) +15>Emitted(71, 142) Source(141, 55) + SourceIndex(0) +16>Emitted(71, 144) Source(141, 57) + SourceIndex(0) +17>Emitted(71, 145) Source(141, 58) + SourceIndex(0) +18>Emitted(71, 148) Source(141, 61) + SourceIndex(0) +19>Emitted(71, 149) Source(141, 62) + SourceIndex(0) +20>Emitted(71, 151) Source(141, 64) + SourceIndex(0) +21>Emitted(71, 152) Source(141, 65) + SourceIndex(0) +22>Emitted(71, 155) Source(141, 68) + SourceIndex(0) +23>Emitted(71, 156) Source(141, 69) + SourceIndex(0) +24>Emitted(71, 158) Source(141, 71) + SourceIndex(0) +25>Emitted(71, 159) Source(141, 72) + SourceIndex(0) +26>Emitted(71, 161) Source(141, 74) + SourceIndex(0) +27>Emitted(71, 163) Source(141, 76) + SourceIndex(0) +28>Emitted(71, 164) Source(141, 77) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(142, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(142, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(142, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(142, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(142, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(142, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(142, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(142, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(73, 1) Source(143, 1) + SourceIndex(0) +2 >Emitted(73, 2) Source(143, 2) + SourceIndex(0) +--- +>>>for ((_44 = { name: "trimmer", skill: "trimming" }, _45 = _44.name, name = _45 === void 0 ? "noName" : _45, _46 = _44.skill, skill = _46 === void 0 ? "skill" : _46, _44), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ +28> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , +12> skill = "skill" +13> +14> skill = "skill" +15> } = { name: "trimmer", skill: "trimming" } +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) +28> { +1->Emitted(74, 1) Source(144, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(144, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(144, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(144, 6) + SourceIndex(0) +5 >Emitted(74, 7) Source(144, 6) + SourceIndex(0) +6 >Emitted(74, 51) Source(144, 90) + SourceIndex(0) +7 >Emitted(74, 53) Source(144, 8) + SourceIndex(0) +8 >Emitted(74, 67) Source(144, 23) + SourceIndex(0) +9 >Emitted(74, 69) Source(144, 8) + SourceIndex(0) +10>Emitted(74, 107) Source(144, 23) + SourceIndex(0) +11>Emitted(74, 109) Source(144, 25) + SourceIndex(0) +12>Emitted(74, 124) Source(144, 40) + SourceIndex(0) +13>Emitted(74, 126) Source(144, 25) + SourceIndex(0) +14>Emitted(74, 164) Source(144, 40) + SourceIndex(0) +15>Emitted(74, 170) Source(144, 90) + SourceIndex(0) +16>Emitted(74, 172) Source(144, 92) + SourceIndex(0) +17>Emitted(74, 173) Source(144, 93) + SourceIndex(0) +18>Emitted(74, 176) Source(144, 96) + SourceIndex(0) +19>Emitted(74, 177) Source(144, 97) + SourceIndex(0) +20>Emitted(74, 179) Source(144, 99) + SourceIndex(0) +21>Emitted(74, 180) Source(144, 100) + SourceIndex(0) +22>Emitted(74, 183) Source(144, 103) + SourceIndex(0) +23>Emitted(74, 184) Source(144, 104) + SourceIndex(0) +24>Emitted(74, 186) Source(144, 106) + SourceIndex(0) +25>Emitted(74, 187) Source(144, 107) + SourceIndex(0) +26>Emitted(74, 189) Source(144, 109) + SourceIndex(0) +27>Emitted(74, 191) Source(144, 111) + SourceIndex(0) +28>Emitted(74, 192) Source(144, 112) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(145, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(145, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(145, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(145, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(145, 17) + SourceIndex(0) +6 >Emitted(75, 22) Source(145, 22) + SourceIndex(0) +7 >Emitted(75, 23) Source(145, 23) + SourceIndex(0) +8 >Emitted(75, 24) Source(145, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(76, 1) Source(146, 1) + SourceIndex(0) +2 >Emitted(76, 2) Source(146, 2) + SourceIndex(0) +--- +>>>for ((_47 = multiRobot.name, name = _47 === void 0 ? "noName" : _47, _48 = multiRobot.skills, _49 = _48 === void 0 ? { primary: "none", secondary: "none" } : _48, _50 = _49.primary, primary = _50 === void 0 ? "primary" : _50, _51 = _49.secondary, secondary = _51 === void 0 ? "secondary" : _51, multiRobot), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > { + > +6 > name = "noName" +7 > +8 > name = "noName" +9 > , + > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +11> +12> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> primary = "primary" +15> +16> primary = "primary" +17> , + > +18> secondary = "secondary" +19> +20> secondary = "secondary" +21> + > } = { primary: "none", secondary: "none" } + > } = +22> multiRobot +23> +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(77, 1) Source(147, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(147, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(147, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(147, 6) + SourceIndex(0) +5 >Emitted(77, 7) Source(148, 5) + SourceIndex(0) +6 >Emitted(77, 28) Source(148, 20) + SourceIndex(0) +7 >Emitted(77, 30) Source(148, 5) + SourceIndex(0) +8 >Emitted(77, 68) Source(148, 20) + SourceIndex(0) +9 >Emitted(77, 70) Source(149, 5) + SourceIndex(0) +10>Emitted(77, 93) Source(152, 47) + SourceIndex(0) +11>Emitted(77, 95) Source(149, 5) + SourceIndex(0) +12>Emitted(77, 162) Source(152, 47) + SourceIndex(0) +13>Emitted(77, 164) Source(150, 9) + SourceIndex(0) +14>Emitted(77, 181) Source(150, 28) + SourceIndex(0) +15>Emitted(77, 183) Source(150, 9) + SourceIndex(0) +16>Emitted(77, 225) Source(150, 28) + SourceIndex(0) +17>Emitted(77, 227) Source(151, 9) + SourceIndex(0) +18>Emitted(77, 246) Source(151, 32) + SourceIndex(0) +19>Emitted(77, 248) Source(151, 9) + SourceIndex(0) +20>Emitted(77, 294) Source(151, 32) + SourceIndex(0) +21>Emitted(77, 296) Source(153, 5) + SourceIndex(0) +22>Emitted(77, 306) Source(153, 15) + SourceIndex(0) +23>Emitted(77, 307) Source(153, 15) + SourceIndex(0) +24>Emitted(77, 309) Source(153, 17) + SourceIndex(0) +25>Emitted(77, 310) Source(153, 18) + SourceIndex(0) +26>Emitted(77, 313) Source(153, 21) + SourceIndex(0) +27>Emitted(77, 314) Source(153, 22) + SourceIndex(0) +28>Emitted(77, 316) Source(153, 24) + SourceIndex(0) +29>Emitted(77, 317) Source(153, 25) + SourceIndex(0) +30>Emitted(77, 320) Source(153, 28) + SourceIndex(0) +31>Emitted(77, 321) Source(153, 29) + SourceIndex(0) +32>Emitted(77, 323) Source(153, 31) + SourceIndex(0) +33>Emitted(77, 324) Source(153, 32) + SourceIndex(0) +34>Emitted(77, 326) Source(153, 34) + SourceIndex(0) +35>Emitted(77, 328) Source(153, 36) + SourceIndex(0) +36>Emitted(77, 329) Source(153, 37) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(78, 5) Source(154, 5) + SourceIndex(0) +2 >Emitted(78, 12) Source(154, 12) + SourceIndex(0) +3 >Emitted(78, 13) Source(154, 13) + SourceIndex(0) +4 >Emitted(78, 16) Source(154, 16) + SourceIndex(0) +5 >Emitted(78, 17) Source(154, 17) + SourceIndex(0) +6 >Emitted(78, 25) Source(154, 25) + SourceIndex(0) +7 >Emitted(78, 26) Source(154, 26) + SourceIndex(0) +8 >Emitted(78, 27) Source(154, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(79, 1) Source(155, 1) + SourceIndex(0) +2 >Emitted(79, 2) Source(155, 2) + SourceIndex(0) +--- +>>>for ((_52 = getMultiRobot(), _53 = _52.name, name = _53 === void 0 ? "noName" : _53, _54 = _52.skills, _55 = _54 === void 0 ? { primary: "none", secondary: "none" } : _54, _56 = _55.primary, primary = _56 === void 0 ? "primary" : _56, _57 = _55.secondary, secondary = _57 === void 0 ? "secondary" : _57, _52), i = 0; i < 1; i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^^ +31> ^ +32> ^^ +33> ^ +34> ^^ +35> ^^ +36> ^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , + > +12> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary = "primary" +17> +18> primary = "primary" +19> , + > +20> secondary = "secondary" +21> +22> secondary = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = getMultiRobot() +24> , +25> i +26> = +27> 0 +28> ; +29> i +30> < +31> 1 +32> ; +33> i +34> ++ +35> ) +36> { +1->Emitted(80, 1) Source(156, 1) + SourceIndex(0) +2 >Emitted(80, 4) Source(156, 4) + SourceIndex(0) +3 >Emitted(80, 5) Source(156, 5) + SourceIndex(0) +4 >Emitted(80, 6) Source(156, 6) + SourceIndex(0) +5 >Emitted(80, 7) Source(156, 6) + SourceIndex(0) +6 >Emitted(80, 28) Source(162, 20) + SourceIndex(0) +7 >Emitted(80, 30) Source(157, 5) + SourceIndex(0) +8 >Emitted(80, 44) Source(157, 20) + SourceIndex(0) +9 >Emitted(80, 46) Source(157, 5) + SourceIndex(0) +10>Emitted(80, 84) Source(157, 20) + SourceIndex(0) +11>Emitted(80, 86) Source(158, 5) + SourceIndex(0) +12>Emitted(80, 102) Source(161, 47) + SourceIndex(0) +13>Emitted(80, 104) Source(158, 5) + SourceIndex(0) +14>Emitted(80, 171) Source(161, 47) + SourceIndex(0) +15>Emitted(80, 173) Source(159, 9) + SourceIndex(0) +16>Emitted(80, 190) Source(159, 28) + SourceIndex(0) +17>Emitted(80, 192) Source(159, 9) + SourceIndex(0) +18>Emitted(80, 234) Source(159, 28) + SourceIndex(0) +19>Emitted(80, 236) Source(160, 9) + SourceIndex(0) +20>Emitted(80, 255) Source(160, 32) + SourceIndex(0) +21>Emitted(80, 257) Source(160, 9) + SourceIndex(0) +22>Emitted(80, 303) Source(160, 32) + SourceIndex(0) +23>Emitted(80, 309) Source(162, 20) + SourceIndex(0) +24>Emitted(80, 311) Source(162, 22) + SourceIndex(0) +25>Emitted(80, 312) Source(162, 23) + SourceIndex(0) +26>Emitted(80, 315) Source(162, 26) + SourceIndex(0) +27>Emitted(80, 316) Source(162, 27) + SourceIndex(0) +28>Emitted(80, 318) Source(162, 29) + SourceIndex(0) +29>Emitted(80, 319) Source(162, 30) + SourceIndex(0) +30>Emitted(80, 322) Source(162, 33) + SourceIndex(0) +31>Emitted(80, 323) Source(162, 34) + SourceIndex(0) +32>Emitted(80, 325) Source(162, 36) + SourceIndex(0) +33>Emitted(80, 326) Source(162, 37) + SourceIndex(0) +34>Emitted(80, 328) Source(162, 39) + SourceIndex(0) +35>Emitted(80, 330) Source(162, 41) + SourceIndex(0) +36>Emitted(80, 331) Source(162, 42) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(81, 5) Source(163, 5) + SourceIndex(0) +2 >Emitted(81, 12) Source(163, 12) + SourceIndex(0) +3 >Emitted(81, 13) Source(163, 13) + SourceIndex(0) +4 >Emitted(81, 16) Source(163, 16) + SourceIndex(0) +5 >Emitted(81, 17) Source(163, 17) + SourceIndex(0) +6 >Emitted(81, 25) Source(163, 25) + SourceIndex(0) +7 >Emitted(81, 26) Source(163, 26) + SourceIndex(0) +8 >Emitted(81, 27) Source(163, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(82, 1) Source(164, 1) + SourceIndex(0) +2 >Emitted(82, 2) Source(164, 2) + SourceIndex(0) +--- +>>>for ((_58 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _59 = _58.name, name = _59 === void 0 ? "noName" : _59, _60 = _58.skills, _61 = _60 === void 0 ? { primary: "none", secondary: "none" } : _60, _62 = _61.primary, primary = _62 === void 0 ? "primary" : _62, _63 = _61.secondary, secondary = _63 === void 0 ? "secondary" : _63, _58), +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +23> ^^^^^^ +1-> + > +2 >for +3 > +4 > ( +5 > +6 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +7 > +8 > name = "noName" +9 > +10> name = "noName" +11> , + > +12> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +13> +14> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "none", secondary: "none" } +15> +16> primary = "primary" +17> +18> primary = "primary" +19> , + > +20> secondary = "secondary" +21> +22> secondary = "secondary" +23> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } +1->Emitted(83, 1) Source(165, 1) + SourceIndex(0) +2 >Emitted(83, 4) Source(165, 4) + SourceIndex(0) +3 >Emitted(83, 5) Source(165, 5) + SourceIndex(0) +4 >Emitted(83, 6) Source(165, 6) + SourceIndex(0) +5 >Emitted(83, 7) Source(165, 6) + SourceIndex(0) +6 >Emitted(83, 86) Source(171, 90) + SourceIndex(0) +7 >Emitted(83, 88) Source(166, 5) + SourceIndex(0) +8 >Emitted(83, 102) Source(166, 20) + SourceIndex(0) +9 >Emitted(83, 104) Source(166, 5) + SourceIndex(0) +10>Emitted(83, 142) Source(166, 20) + SourceIndex(0) +11>Emitted(83, 144) Source(167, 5) + SourceIndex(0) +12>Emitted(83, 160) Source(170, 47) + SourceIndex(0) +13>Emitted(83, 162) Source(167, 5) + SourceIndex(0) +14>Emitted(83, 229) Source(170, 47) + SourceIndex(0) +15>Emitted(83, 231) Source(168, 9) + SourceIndex(0) +16>Emitted(83, 248) Source(168, 28) + SourceIndex(0) +17>Emitted(83, 250) Source(168, 9) + SourceIndex(0) +18>Emitted(83, 292) Source(168, 28) + SourceIndex(0) +19>Emitted(83, 294) Source(169, 9) + SourceIndex(0) +20>Emitted(83, 313) Source(169, 32) + SourceIndex(0) +21>Emitted(83, 315) Source(169, 9) + SourceIndex(0) +22>Emitted(83, 361) Source(169, 32) + SourceIndex(0) +23>Emitted(83, 367) Source(171, 90) + SourceIndex(0) +--- +>>> i = 0; i < 1; i++) { +1 >^^^^ +2 > ^ +3 > ^^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^ +12> ^^ +13> ^ +14> ^^^-> +1 >, + > +2 > i +3 > = +4 > 0 +5 > ; +6 > i +7 > < +8 > 1 +9 > ; +10> i +11> ++ +12> ) +13> { +1 >Emitted(84, 5) Source(172, 5) + SourceIndex(0) +2 >Emitted(84, 6) Source(172, 6) + SourceIndex(0) +3 >Emitted(84, 9) Source(172, 9) + SourceIndex(0) +4 >Emitted(84, 10) Source(172, 10) + SourceIndex(0) +5 >Emitted(84, 12) Source(172, 12) + SourceIndex(0) +6 >Emitted(84, 13) Source(172, 13) + SourceIndex(0) +7 >Emitted(84, 16) Source(172, 16) + SourceIndex(0) +8 >Emitted(84, 17) Source(172, 17) + SourceIndex(0) +9 >Emitted(84, 19) Source(172, 19) + SourceIndex(0) +10>Emitted(84, 20) Source(172, 20) + SourceIndex(0) +11>Emitted(84, 22) Source(172, 22) + SourceIndex(0) +12>Emitted(84, 24) Source(172, 24) + SourceIndex(0) +13>Emitted(84, 25) Source(172, 25) + SourceIndex(0) +--- +>>> console.log(primaryA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1->Emitted(85, 5) Source(173, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(173, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(173, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(173, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(173, 17) + SourceIndex(0) +6 >Emitted(85, 25) Source(173, 25) + SourceIndex(0) +7 >Emitted(85, 26) Source(173, 26) + SourceIndex(0) +8 >Emitted(85, 27) Source(173, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(86, 1) Source(174, 1) + SourceIndex(0) +2 >Emitted(86, 2) Source(174, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..20ccd1136c3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.symbols @@ -0,0 +1,628 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 9, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 10, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 11, 25)) + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 20)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 35)) + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 30)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 45)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 55)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 74)) + +function getRobot() { +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) + + return robot; +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +} +function getMultiRobot() { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) + + return multiRobot; +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 26, 53)) + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 28, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 34, 41)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 34, 58)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 37, 6)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 38, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 39, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 41, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 41, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 45, 6)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 46, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 47, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 49, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 49, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 53, 6)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 54, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 55, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 57, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 57, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 58, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 63, 6)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 66, 6)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 69, 6)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 69, 35)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 69, 52)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 72, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 73, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 74, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 76, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 76, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 80, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 81, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 82, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 84, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 84, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 88, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 89, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 90, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 92, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 92, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 93, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 99, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 99, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 102, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 102, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 67)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 66)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 105, 83)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 108, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 109, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 110, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 111, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 113, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 113, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 117, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 118, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 119, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 120, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 122, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 122, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 126, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 127, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 128, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 129, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 36)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 131, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 131, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 132, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 137, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 137, 23)) +>robot : Symbol(robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 16, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 140, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 140, 23)) +>getRobot : Symbol(getRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 97)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 23)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 52)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 143, 69)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 146, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 147, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 148, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 149, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 151, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 151, 26)) + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : Symbol(multiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 17, 3)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 155, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 156, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 157, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 158, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 160, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 160, 26)) + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot : Symbol(getMultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 20, 1)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 164, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 165, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 166, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 167, 28)) + + } = { primary: "none", secondary: "none" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 169, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 169, 26)) + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 17)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 34)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 44)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 170, 65)) + + i = 0; i < 1; i++) { +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 56)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts, 25, 18)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..aa8c95bae01 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types @@ -0,0 +1,1020 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +>robot : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>multiRobot : MultiRobot +>MultiRobot : MultiRobot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function getRobot() { +>getRobot : () => Robot + + return robot; +>robot : Robot +} +function getMultiRobot() { +>getMultiRobot : () => MultiRobot + + return multiRobot; +>multiRobot : MultiRobot +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { +>{name: nameA = "noName" } = robot, i = 0 : number +>{name: nameA = "noName" } = robot : Robot +>{name: nameA = "noName" } : { name?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +>{name: nameA = "noName" } = getRobot(), i = 0 : number +>{name: nameA = "noName" } = getRobot() : Robot +>{name: nameA = "noName" } : { name?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } : Robot +>{name: nameA = "noName" } : { name?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { +>{ name = "noName" } = robot, i = 0 : number +>{ name = "noName" } = robot : Robot +>{ name = "noName" } : { name?: string; } +>name : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { +>{ name = "noName" } = getRobot(), i = 0 : number +>{ name = "noName" } = getRobot() : Robot +>{ name = "noName" } : { name?: string; } +>name : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName" } = { name: "trimmer", skill: "trimming" } : Robot +>{ name = "noName" } : { name?: string; } +>name : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +>{name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = robot : Robot +>{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : string +>skillA = "skill" : string +>skillA : string +>"skill" : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +>{name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = getRobot() : Robot +>{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : string +>skillA = "skill" : string +>skillA : string +>"skill" : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } : Robot +>{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : string +>skillA = "skill" : string +>skillA : string +>"skill" : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : string +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { +>{ name = "noName", skill = "skill" } = robot, i = 0 : number +>{ name = "noName", skill = "skill" } = robot : Robot +>{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } +>name : string +>skill : string +>robot : Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { +>{ name = "noName", skill = "skill" } = getRobot(), i = 0 : number +>{ name = "noName", skill = "skill" } = getRobot() : Robot +>{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } +>name : string +>skill : string +>getRobot() : Robot +>getRobot : () => Robot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +>{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } : Robot +>{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } +>name : string +>skill : string +>{ name: "trimmer", skill: "trimming" } : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = multiRobot, i = 0; i < 1; i++) { +>multiRobot : MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = getMultiRobot(), i = 0; i < 1; i++) { +>getMultiRobot() : MultiRobot +>getMultiRobot : () => MultiRobot +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "none", secondary: "none" } +>{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>primary : string +>"none" : string +>secondary : string +>"none" : string + +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot +>MultiRobot : MultiRobot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + i = 0; i < 1; i++) { +>i = 0 : number +>i : number +>0 : number +>i < 1 : boolean +>i : number +>1 : number +>i++ : number +>i : number + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js new file mode 100644 index 00000000000..daf39ece7be --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js @@ -0,0 +1,207 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA] of robots) { + console.log(nameA); +} +for (let [, nameA] of getRobots()) { + console.log(nameA); +} +for (let [, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB] of robots) { + console.log(numberB); +} +for (let [numberB] of getRobots()) { + console.log(numberB); +} +for (let [numberB] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB] of multiRobots) { + console.log(nameB); +} +for (let [nameB] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var _a = robots_1[_i], nameA = _a[1]; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + var _d = _c[_b], nameA = _d[1]; + console.log(nameA); +} +for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { + var _g = _f[_e], nameA = _g[1]; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + var _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; + console.log(primarySkillA); +} +for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { + var _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; + console.log(primarySkillA); +} +for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { + var _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; + console.log(primarySkillA); +} +for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { + var numberB = robots_2[_u][0]; + console.log(numberB); +} +for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { + var numberB = _w[_v][0]; + console.log(numberB); +} +for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { + var numberB = _y[_x][0]; + console.log(numberB); +} +for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { + var nameB = multiRobots_2[_z][0]; + console.log(nameB); +} +for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { + var nameB = _1[_0][0]; + console.log(nameB); +} +for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { + var nameB = _3[_2][0]; + console.log(nameB); +} +for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { + var _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; + console.log(nameA2); +} +for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { + var _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; + console.log(nameA2); +} +for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { + var _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; + console.log(nameA2); +} +for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { + var _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; + console.log(nameMA); +} +for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { + var _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; + console.log(nameMA); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + var _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; + console.log(nameMA); +} +for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { + var _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); + console.log(numberA3); +} +for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { + var _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); + console.log(numberA3); +} +for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { + var _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); + console.log(numberA3); +} +for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { + var multiRobotAInfo = multiRobots_4[_31].slice(0); + console.log(multiRobotAInfo); +} +for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { + var multiRobotAInfo = _33[_32].slice(0); + console.log(multiRobotAInfo); +} +for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { + var multiRobotAInfo = _35[_34].slice(0); + console.log(multiRobotAInfo); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map new file mode 100644 index 00000000000..076b6994fa3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,qBAAa,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,eAAa,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAAlC,eAAa,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6C,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAxD,0BAAwC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAA6C,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7D,eAAwC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAA6C,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAAvE,eAAwC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnB,6BAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxB,uBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7B,uBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAgB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtB,gCAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAgB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3B,qBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAgB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAArC,qBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAAoC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA1C,qBAA+B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAoC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA/C,eAA+B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAoC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB,CAAC;IAApD,iBAA+B,EAA1B,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAA9D,4BAA8C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAnE,kBAA8C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAA7E,kBAA8C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAkC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAxC,uBAA6B,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAkC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAA7C,kBAA6B,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAkC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAlD,kBAA6B,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAnC,iDAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAA6B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAxC,uCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAA6B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAlD,uCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..17110072800 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt @@ -0,0 +1,2661 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let [, nameA] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 23) + SourceIndex(0) +5 >Emitted(13, 16) Source(21, 29) + SourceIndex(0) +6 >Emitted(13, 18) Source(21, 23) + SourceIndex(0) +7 >Emitted(13, 35) Source(21, 29) + SourceIndex(0) +8 >Emitted(13, 37) Source(21, 23) + SourceIndex(0) +9 >Emitted(13, 57) Source(21, 29) + SourceIndex(0) +10>Emitted(13, 59) Source(21, 23) + SourceIndex(0) +11>Emitted(13, 63) Source(21, 29) + SourceIndex(0) +12>Emitted(13, 64) Source(21, 30) + SourceIndex(0) +--- +>>> var _a = robots_1[_i], nameA = _a[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > let [, nameA] +3 > +4 > nameA +1 >Emitted(14, 5) Source(21, 6) + SourceIndex(0) +2 >Emitted(14, 26) Source(21, 19) + SourceIndex(0) +3 >Emitted(14, 28) Source(21, 13) + SourceIndex(0) +4 >Emitted(14, 41) Source(21, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(16, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [, nameA] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(24, 23) + SourceIndex(0) +5 >Emitted(17, 16) Source(24, 34) + SourceIndex(0) +6 >Emitted(17, 18) Source(24, 23) + SourceIndex(0) +7 >Emitted(17, 23) Source(24, 23) + SourceIndex(0) +8 >Emitted(17, 32) Source(24, 32) + SourceIndex(0) +9 >Emitted(17, 34) Source(24, 34) + SourceIndex(0) +10>Emitted(17, 36) Source(24, 23) + SourceIndex(0) +11>Emitted(17, 50) Source(24, 34) + SourceIndex(0) +12>Emitted(17, 52) Source(24, 23) + SourceIndex(0) +13>Emitted(17, 56) Source(24, 34) + SourceIndex(0) +14>Emitted(17, 57) Source(24, 35) + SourceIndex(0) +--- +>>> var _d = _c[_b], nameA = _d[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > let [, nameA] +3 > +4 > nameA +1 >Emitted(18, 5) Source(24, 6) + SourceIndex(0) +2 >Emitted(18, 20) Source(24, 19) + SourceIndex(0) +3 >Emitted(18, 22) Source(24, 13) + SourceIndex(0) +4 >Emitted(18, 35) Source(24, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [, nameA] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(27, 23) + SourceIndex(0) +5 >Emitted(21, 16) Source(27, 39) + SourceIndex(0) +6 >Emitted(21, 18) Source(27, 23) + SourceIndex(0) +7 >Emitted(21, 24) Source(27, 24) + SourceIndex(0) +8 >Emitted(21, 30) Source(27, 30) + SourceIndex(0) +9 >Emitted(21, 32) Source(27, 32) + SourceIndex(0) +10>Emitted(21, 38) Source(27, 38) + SourceIndex(0) +11>Emitted(21, 39) Source(27, 39) + SourceIndex(0) +12>Emitted(21, 41) Source(27, 23) + SourceIndex(0) +13>Emitted(21, 55) Source(27, 39) + SourceIndex(0) +14>Emitted(21, 57) Source(27, 23) + SourceIndex(0) +15>Emitted(21, 61) Source(27, 39) + SourceIndex(0) +16>Emitted(21, 62) Source(27, 40) + SourceIndex(0) +--- +>>> var _g = _f[_e], nameA = _g[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > let [, nameA] +3 > +4 > nameA +1 >Emitted(22, 5) Source(27, 6) + SourceIndex(0) +2 >Emitted(22, 20) Source(27, 19) + SourceIndex(0) +3 >Emitted(22, 22) Source(27, 13) + SourceIndex(0) +4 >Emitted(22, 35) Source(27, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(25, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(30, 50) + SourceIndex(0) +5 >Emitted(25, 16) Source(30, 61) + SourceIndex(0) +6 >Emitted(25, 18) Source(30, 50) + SourceIndex(0) +7 >Emitted(25, 45) Source(30, 61) + SourceIndex(0) +8 >Emitted(25, 47) Source(30, 50) + SourceIndex(0) +9 >Emitted(25, 72) Source(30, 61) + SourceIndex(0) +10>Emitted(25, 74) Source(30, 50) + SourceIndex(0) +11>Emitted(25, 78) Source(30, 61) + SourceIndex(0) +12>Emitted(25, 79) Source(30, 62) + SourceIndex(0) +--- +>>> var _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(26, 5) Source(30, 6) + SourceIndex(0) +2 >Emitted(26, 31) Source(30, 46) + SourceIndex(0) +3 >Emitted(26, 33) Source(30, 13) + SourceIndex(0) +4 >Emitted(26, 43) Source(30, 45) + SourceIndex(0) +5 >Emitted(26, 45) Source(30, 14) + SourceIndex(0) +6 >Emitted(26, 66) Source(30, 27) + SourceIndex(0) +7 >Emitted(26, 68) Source(30, 29) + SourceIndex(0) +8 >Emitted(26, 91) Source(30, 44) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(31, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(31, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(31, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(31, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(31, 17) + SourceIndex(0) +6 >Emitted(27, 30) Source(31, 30) + SourceIndex(0) +7 >Emitted(27, 31) Source(31, 31) + SourceIndex(0) +8 >Emitted(27, 32) Source(31, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(32, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(29, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(33, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(33, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(33, 50) + SourceIndex(0) +5 >Emitted(29, 16) Source(33, 66) + SourceIndex(0) +6 >Emitted(29, 18) Source(33, 50) + SourceIndex(0) +7 >Emitted(29, 23) Source(33, 50) + SourceIndex(0) +8 >Emitted(29, 37) Source(33, 64) + SourceIndex(0) +9 >Emitted(29, 39) Source(33, 66) + SourceIndex(0) +10>Emitted(29, 41) Source(33, 50) + SourceIndex(0) +11>Emitted(29, 55) Source(33, 66) + SourceIndex(0) +12>Emitted(29, 57) Source(33, 50) + SourceIndex(0) +13>Emitted(29, 61) Source(33, 66) + SourceIndex(0) +14>Emitted(29, 62) Source(33, 67) + SourceIndex(0) +--- +>>> var _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(30, 5) Source(33, 6) + SourceIndex(0) +2 >Emitted(30, 20) Source(33, 46) + SourceIndex(0) +3 >Emitted(30, 22) Source(33, 13) + SourceIndex(0) +4 >Emitted(30, 32) Source(33, 45) + SourceIndex(0) +5 >Emitted(30, 34) Source(33, 14) + SourceIndex(0) +6 >Emitted(30, 55) Source(33, 27) + SourceIndex(0) +7 >Emitted(30, 57) Source(33, 29) + SourceIndex(0) +8 >Emitted(30, 80) Source(33, 44) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(33, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(36, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(36, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(36, 50) + SourceIndex(0) +5 >Emitted(33, 16) Source(36, 76) + SourceIndex(0) +6 >Emitted(33, 18) Source(36, 50) + SourceIndex(0) +7 >Emitted(33, 24) Source(36, 51) + SourceIndex(0) +8 >Emitted(33, 35) Source(36, 62) + SourceIndex(0) +9 >Emitted(33, 37) Source(36, 64) + SourceIndex(0) +10>Emitted(33, 48) Source(36, 75) + SourceIndex(0) +11>Emitted(33, 49) Source(36, 76) + SourceIndex(0) +12>Emitted(33, 51) Source(36, 50) + SourceIndex(0) +13>Emitted(33, 65) Source(36, 76) + SourceIndex(0) +14>Emitted(33, 67) Source(36, 50) + SourceIndex(0) +15>Emitted(33, 71) Source(36, 76) + SourceIndex(0) +16>Emitted(33, 72) Source(36, 77) + SourceIndex(0) +--- +>>> var _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(34, 5) Source(36, 6) + SourceIndex(0) +2 >Emitted(34, 20) Source(36, 46) + SourceIndex(0) +3 >Emitted(34, 22) Source(36, 13) + SourceIndex(0) +4 >Emitted(34, 32) Source(36, 45) + SourceIndex(0) +5 >Emitted(34, 34) Source(36, 14) + SourceIndex(0) +6 >Emitted(34, 55) Source(36, 27) + SourceIndex(0) +7 >Emitted(34, 57) Source(36, 29) + SourceIndex(0) +8 >Emitted(34, 80) Source(36, 44) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(37, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(37, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(37, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(37, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(37, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(37, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(37, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(37, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(38, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let [numberB] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(40, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(40, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(40, 23) + SourceIndex(0) +5 >Emitted(37, 16) Source(40, 29) + SourceIndex(0) +6 >Emitted(37, 18) Source(40, 23) + SourceIndex(0) +7 >Emitted(37, 35) Source(40, 29) + SourceIndex(0) +8 >Emitted(37, 37) Source(40, 23) + SourceIndex(0) +9 >Emitted(37, 57) Source(40, 29) + SourceIndex(0) +10>Emitted(37, 59) Source(40, 23) + SourceIndex(0) +11>Emitted(37, 63) Source(40, 29) + SourceIndex(0) +12>Emitted(37, 64) Source(40, 30) + SourceIndex(0) +--- +>>> var numberB = robots_2[_u][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(38, 5) Source(40, 11) + SourceIndex(0) +2 >Emitted(38, 34) Source(40, 18) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(39, 5) Source(41, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(41, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(41, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(41, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(41, 17) + SourceIndex(0) +6 >Emitted(39, 24) Source(41, 24) + SourceIndex(0) +7 >Emitted(39, 25) Source(41, 25) + SourceIndex(0) +8 >Emitted(39, 26) Source(41, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(42, 2) + SourceIndex(0) +--- +>>>for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [numberB] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(43, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(43, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(43, 23) + SourceIndex(0) +5 >Emitted(41, 16) Source(43, 34) + SourceIndex(0) +6 >Emitted(41, 18) Source(43, 23) + SourceIndex(0) +7 >Emitted(41, 23) Source(43, 23) + SourceIndex(0) +8 >Emitted(41, 32) Source(43, 32) + SourceIndex(0) +9 >Emitted(41, 34) Source(43, 34) + SourceIndex(0) +10>Emitted(41, 36) Source(43, 23) + SourceIndex(0) +11>Emitted(41, 50) Source(43, 34) + SourceIndex(0) +12>Emitted(41, 52) Source(43, 23) + SourceIndex(0) +13>Emitted(41, 56) Source(43, 34) + SourceIndex(0) +14>Emitted(41, 57) Source(43, 35) + SourceIndex(0) +--- +>>> var numberB = _w[_v][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(42, 5) Source(43, 11) + SourceIndex(0) +2 >Emitted(42, 28) Source(43, 18) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(44, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(44, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(44, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [numberB] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(45, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(46, 23) + SourceIndex(0) +5 >Emitted(45, 16) Source(46, 39) + SourceIndex(0) +6 >Emitted(45, 18) Source(46, 23) + SourceIndex(0) +7 >Emitted(45, 24) Source(46, 24) + SourceIndex(0) +8 >Emitted(45, 30) Source(46, 30) + SourceIndex(0) +9 >Emitted(45, 32) Source(46, 32) + SourceIndex(0) +10>Emitted(45, 38) Source(46, 38) + SourceIndex(0) +11>Emitted(45, 39) Source(46, 39) + SourceIndex(0) +12>Emitted(45, 41) Source(46, 23) + SourceIndex(0) +13>Emitted(45, 55) Source(46, 39) + SourceIndex(0) +14>Emitted(45, 57) Source(46, 23) + SourceIndex(0) +15>Emitted(45, 61) Source(46, 39) + SourceIndex(0) +16>Emitted(45, 62) Source(46, 40) + SourceIndex(0) +--- +>>> var numberB = _y[_x][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(46, 5) Source(46, 11) + SourceIndex(0) +2 >Emitted(46, 28) Source(46, 18) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(47, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(47, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(47, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(47, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > (let [nameB] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(49, 21) + SourceIndex(0) +5 >Emitted(49, 16) Source(49, 32) + SourceIndex(0) +6 >Emitted(49, 18) Source(49, 21) + SourceIndex(0) +7 >Emitted(49, 45) Source(49, 32) + SourceIndex(0) +8 >Emitted(49, 47) Source(49, 21) + SourceIndex(0) +9 >Emitted(49, 72) Source(49, 32) + SourceIndex(0) +10>Emitted(49, 74) Source(49, 21) + SourceIndex(0) +11>Emitted(49, 78) Source(49, 32) + SourceIndex(0) +12>Emitted(49, 79) Source(49, 33) + SourceIndex(0) +--- +>>> var nameB = multiRobots_2[_z][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(50, 5) Source(49, 11) + SourceIndex(0) +2 >Emitted(50, 37) Source(49, 16) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(51, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(51, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(51, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(51, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [nameB] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(52, 21) + SourceIndex(0) +5 >Emitted(53, 16) Source(52, 37) + SourceIndex(0) +6 >Emitted(53, 18) Source(52, 21) + SourceIndex(0) +7 >Emitted(53, 23) Source(52, 21) + SourceIndex(0) +8 >Emitted(53, 37) Source(52, 35) + SourceIndex(0) +9 >Emitted(53, 39) Source(52, 37) + SourceIndex(0) +10>Emitted(53, 41) Source(52, 21) + SourceIndex(0) +11>Emitted(53, 55) Source(52, 37) + SourceIndex(0) +12>Emitted(53, 57) Source(52, 21) + SourceIndex(0) +13>Emitted(53, 61) Source(52, 37) + SourceIndex(0) +14>Emitted(53, 62) Source(52, 38) + SourceIndex(0) +--- +>>> var nameB = _1[_0][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(54, 5) Source(52, 11) + SourceIndex(0) +2 >Emitted(54, 26) Source(52, 16) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [nameB] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(57, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(55, 21) + SourceIndex(0) +5 >Emitted(57, 16) Source(55, 47) + SourceIndex(0) +6 >Emitted(57, 18) Source(55, 21) + SourceIndex(0) +7 >Emitted(57, 24) Source(55, 22) + SourceIndex(0) +8 >Emitted(57, 35) Source(55, 33) + SourceIndex(0) +9 >Emitted(57, 37) Source(55, 35) + SourceIndex(0) +10>Emitted(57, 48) Source(55, 46) + SourceIndex(0) +11>Emitted(57, 49) Source(55, 47) + SourceIndex(0) +12>Emitted(57, 51) Source(55, 21) + SourceIndex(0) +13>Emitted(57, 65) Source(55, 47) + SourceIndex(0) +14>Emitted(57, 67) Source(55, 21) + SourceIndex(0) +15>Emitted(57, 71) Source(55, 47) + SourceIndex(0) +16>Emitted(57, 72) Source(55, 48) + SourceIndex(0) +--- +>>> var nameB = _3[_2][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(58, 5) Source(55, 11) + SourceIndex(0) +2 >Emitted(58, 26) Source(55, 16) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(59, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA2, nameA2, skillA2] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(61, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(59, 41) + SourceIndex(0) +5 >Emitted(61, 16) Source(59, 47) + SourceIndex(0) +6 >Emitted(61, 18) Source(59, 41) + SourceIndex(0) +7 >Emitted(61, 35) Source(59, 47) + SourceIndex(0) +8 >Emitted(61, 37) Source(59, 41) + SourceIndex(0) +9 >Emitted(61, 57) Source(59, 47) + SourceIndex(0) +10>Emitted(61, 59) Source(59, 41) + SourceIndex(0) +11>Emitted(61, 63) Source(59, 47) + SourceIndex(0) +12>Emitted(61, 64) Source(59, 48) + SourceIndex(0) +--- +>>> var _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(62, 5) Source(59, 6) + SourceIndex(0) +2 >Emitted(62, 26) Source(59, 37) + SourceIndex(0) +3 >Emitted(62, 28) Source(59, 11) + SourceIndex(0) +4 >Emitted(62, 44) Source(59, 19) + SourceIndex(0) +5 >Emitted(62, 46) Source(59, 21) + SourceIndex(0) +6 >Emitted(62, 60) Source(59, 27) + SourceIndex(0) +7 >Emitted(62, 62) Source(59, 29) + SourceIndex(0) +8 >Emitted(62, 77) Source(59, 36) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(63, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(63, 23) Source(60, 23) + SourceIndex(0) +7 >Emitted(63, 24) Source(60, 24) + SourceIndex(0) +8 >Emitted(63, 25) Source(60, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2, nameA2, skillA2] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(65, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(62, 41) + SourceIndex(0) +5 >Emitted(65, 16) Source(62, 52) + SourceIndex(0) +6 >Emitted(65, 18) Source(62, 41) + SourceIndex(0) +7 >Emitted(65, 23) Source(62, 41) + SourceIndex(0) +8 >Emitted(65, 32) Source(62, 50) + SourceIndex(0) +9 >Emitted(65, 34) Source(62, 52) + SourceIndex(0) +10>Emitted(65, 36) Source(62, 41) + SourceIndex(0) +11>Emitted(65, 50) Source(62, 52) + SourceIndex(0) +12>Emitted(65, 52) Source(62, 41) + SourceIndex(0) +13>Emitted(65, 56) Source(62, 52) + SourceIndex(0) +14>Emitted(65, 57) Source(62, 53) + SourceIndex(0) +--- +>>> var _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(66, 5) Source(62, 6) + SourceIndex(0) +2 >Emitted(66, 20) Source(62, 37) + SourceIndex(0) +3 >Emitted(66, 22) Source(62, 11) + SourceIndex(0) +4 >Emitted(66, 38) Source(62, 19) + SourceIndex(0) +5 >Emitted(66, 40) Source(62, 21) + SourceIndex(0) +6 >Emitted(66, 54) Source(62, 27) + SourceIndex(0) +7 >Emitted(66, 56) Source(62, 29) + SourceIndex(0) +8 >Emitted(66, 71) Source(62, 36) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(63, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(63, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(63, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2, nameA2, skillA2] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(69, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(65, 41) + SourceIndex(0) +5 >Emitted(69, 16) Source(65, 57) + SourceIndex(0) +6 >Emitted(69, 18) Source(65, 41) + SourceIndex(0) +7 >Emitted(69, 25) Source(65, 42) + SourceIndex(0) +8 >Emitted(69, 31) Source(65, 48) + SourceIndex(0) +9 >Emitted(69, 33) Source(65, 50) + SourceIndex(0) +10>Emitted(69, 39) Source(65, 56) + SourceIndex(0) +11>Emitted(69, 40) Source(65, 57) + SourceIndex(0) +12>Emitted(69, 42) Source(65, 41) + SourceIndex(0) +13>Emitted(69, 57) Source(65, 57) + SourceIndex(0) +14>Emitted(69, 59) Source(65, 41) + SourceIndex(0) +15>Emitted(69, 63) Source(65, 57) + SourceIndex(0) +16>Emitted(69, 64) Source(65, 58) + SourceIndex(0) +--- +>>> var _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(70, 5) Source(65, 6) + SourceIndex(0) +2 >Emitted(70, 22) Source(65, 37) + SourceIndex(0) +3 >Emitted(70, 24) Source(65, 11) + SourceIndex(0) +4 >Emitted(70, 41) Source(65, 19) + SourceIndex(0) +5 >Emitted(70, 43) Source(65, 21) + SourceIndex(0) +6 >Emitted(70, 58) Source(65, 27) + SourceIndex(0) +7 >Emitted(70, 60) Source(65, 29) + SourceIndex(0) +8 >Emitted(70, 76) Source(65, 36) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(66, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(66, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(66, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(67, 2) + SourceIndex(0) +--- +>>>for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(73, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(68, 56) + SourceIndex(0) +5 >Emitted(73, 17) Source(68, 67) + SourceIndex(0) +6 >Emitted(73, 19) Source(68, 56) + SourceIndex(0) +7 >Emitted(73, 46) Source(68, 67) + SourceIndex(0) +8 >Emitted(73, 48) Source(68, 56) + SourceIndex(0) +9 >Emitted(73, 74) Source(68, 67) + SourceIndex(0) +10>Emitted(73, 76) Source(68, 56) + SourceIndex(0) +11>Emitted(73, 81) Source(68, 67) + SourceIndex(0) +12>Emitted(73, 82) Source(68, 68) + SourceIndex(0) +--- +>>> var _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(74, 5) Source(68, 6) + SourceIndex(0) +2 >Emitted(74, 33) Source(68, 52) + SourceIndex(0) +3 >Emitted(74, 35) Source(68, 11) + SourceIndex(0) +4 >Emitted(74, 50) Source(68, 17) + SourceIndex(0) +5 >Emitted(74, 52) Source(68, 19) + SourceIndex(0) +6 >Emitted(74, 64) Source(68, 51) + SourceIndex(0) +7 >Emitted(74, 66) Source(68, 20) + SourceIndex(0) +8 >Emitted(74, 88) Source(68, 33) + SourceIndex(0) +9 >Emitted(74, 90) Source(68, 35) + SourceIndex(0) +10>Emitted(74, 114) Source(68, 50) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(77, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(71, 56) + SourceIndex(0) +5 >Emitted(77, 17) Source(71, 72) + SourceIndex(0) +6 >Emitted(77, 19) Source(71, 56) + SourceIndex(0) +7 >Emitted(77, 25) Source(71, 56) + SourceIndex(0) +8 >Emitted(77, 39) Source(71, 70) + SourceIndex(0) +9 >Emitted(77, 41) Source(71, 72) + SourceIndex(0) +10>Emitted(77, 43) Source(71, 56) + SourceIndex(0) +11>Emitted(77, 59) Source(71, 72) + SourceIndex(0) +12>Emitted(77, 61) Source(71, 56) + SourceIndex(0) +13>Emitted(77, 66) Source(71, 72) + SourceIndex(0) +14>Emitted(77, 67) Source(71, 73) + SourceIndex(0) +--- +>>> var _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(78, 5) Source(71, 6) + SourceIndex(0) +2 >Emitted(78, 23) Source(71, 52) + SourceIndex(0) +3 >Emitted(78, 25) Source(71, 11) + SourceIndex(0) +4 >Emitted(78, 40) Source(71, 17) + SourceIndex(0) +5 >Emitted(78, 42) Source(71, 19) + SourceIndex(0) +6 >Emitted(78, 54) Source(71, 51) + SourceIndex(0) +7 >Emitted(78, 56) Source(71, 20) + SourceIndex(0) +8 >Emitted(78, 78) Source(71, 33) + SourceIndex(0) +9 >Emitted(78, 80) Source(71, 35) + SourceIndex(0) +10>Emitted(78, 104) Source(71, 50) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(81, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(74, 56) + SourceIndex(0) +5 >Emitted(81, 17) Source(74, 82) + SourceIndex(0) +6 >Emitted(81, 19) Source(74, 56) + SourceIndex(0) +7 >Emitted(81, 26) Source(74, 57) + SourceIndex(0) +8 >Emitted(81, 37) Source(74, 68) + SourceIndex(0) +9 >Emitted(81, 39) Source(74, 70) + SourceIndex(0) +10>Emitted(81, 50) Source(74, 81) + SourceIndex(0) +11>Emitted(81, 51) Source(74, 82) + SourceIndex(0) +12>Emitted(81, 53) Source(74, 56) + SourceIndex(0) +13>Emitted(81, 69) Source(74, 82) + SourceIndex(0) +14>Emitted(81, 71) Source(74, 56) + SourceIndex(0) +15>Emitted(81, 76) Source(74, 82) + SourceIndex(0) +16>Emitted(81, 77) Source(74, 83) + SourceIndex(0) +--- +>>> var _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(82, 5) Source(74, 6) + SourceIndex(0) +2 >Emitted(82, 23) Source(74, 52) + SourceIndex(0) +3 >Emitted(82, 25) Source(74, 11) + SourceIndex(0) +4 >Emitted(82, 40) Source(74, 17) + SourceIndex(0) +5 >Emitted(82, 42) Source(74, 19) + SourceIndex(0) +6 >Emitted(82, 54) Source(74, 51) + SourceIndex(0) +7 >Emitted(82, 56) Source(74, 20) + SourceIndex(0) +8 >Emitted(82, 78) Source(74, 33) + SourceIndex(0) +9 >Emitted(82, 80) Source(74, 35) + SourceIndex(0) +10>Emitted(82, 104) Source(74, 50) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA3, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(85, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(78, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(78, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(78, 39) + SourceIndex(0) +5 >Emitted(85, 17) Source(78, 45) + SourceIndex(0) +6 >Emitted(85, 19) Source(78, 39) + SourceIndex(0) +7 >Emitted(85, 36) Source(78, 45) + SourceIndex(0) +8 >Emitted(85, 38) Source(78, 39) + SourceIndex(0) +9 >Emitted(85, 59) Source(78, 45) + SourceIndex(0) +10>Emitted(85, 61) Source(78, 39) + SourceIndex(0) +11>Emitted(85, 66) Source(78, 45) + SourceIndex(0) +12>Emitted(85, 67) Source(78, 46) + SourceIndex(0) +--- +>>> var _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(86, 5) Source(78, 6) + SourceIndex(0) +2 >Emitted(86, 28) Source(78, 35) + SourceIndex(0) +3 >Emitted(86, 30) Source(78, 11) + SourceIndex(0) +4 >Emitted(86, 47) Source(78, 19) + SourceIndex(0) +5 >Emitted(86, 49) Source(78, 21) + SourceIndex(0) +6 >Emitted(86, 74) Source(78, 34) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(87, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(87, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(87, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(87, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(89, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(81, 39) + SourceIndex(0) +5 >Emitted(89, 17) Source(81, 50) + SourceIndex(0) +6 >Emitted(89, 19) Source(81, 39) + SourceIndex(0) +7 >Emitted(89, 25) Source(81, 39) + SourceIndex(0) +8 >Emitted(89, 34) Source(81, 48) + SourceIndex(0) +9 >Emitted(89, 36) Source(81, 50) + SourceIndex(0) +10>Emitted(89, 38) Source(81, 39) + SourceIndex(0) +11>Emitted(89, 54) Source(81, 50) + SourceIndex(0) +12>Emitted(89, 56) Source(81, 39) + SourceIndex(0) +13>Emitted(89, 61) Source(81, 50) + SourceIndex(0) +14>Emitted(89, 62) Source(81, 51) + SourceIndex(0) +--- +>>> var _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(90, 5) Source(81, 6) + SourceIndex(0) +2 >Emitted(90, 23) Source(81, 35) + SourceIndex(0) +3 >Emitted(90, 25) Source(81, 11) + SourceIndex(0) +4 >Emitted(90, 42) Source(81, 19) + SourceIndex(0) +5 >Emitted(90, 44) Source(81, 21) + SourceIndex(0) +6 >Emitted(90, 69) Source(81, 34) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(82, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(82, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(82, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(93, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(84, 39) + SourceIndex(0) +5 >Emitted(93, 17) Source(84, 55) + SourceIndex(0) +6 >Emitted(93, 19) Source(84, 39) + SourceIndex(0) +7 >Emitted(93, 26) Source(84, 40) + SourceIndex(0) +8 >Emitted(93, 32) Source(84, 46) + SourceIndex(0) +9 >Emitted(93, 34) Source(84, 48) + SourceIndex(0) +10>Emitted(93, 40) Source(84, 54) + SourceIndex(0) +11>Emitted(93, 41) Source(84, 55) + SourceIndex(0) +12>Emitted(93, 43) Source(84, 39) + SourceIndex(0) +13>Emitted(93, 59) Source(84, 55) + SourceIndex(0) +14>Emitted(93, 61) Source(84, 39) + SourceIndex(0) +15>Emitted(93, 66) Source(84, 55) + SourceIndex(0) +16>Emitted(93, 67) Source(84, 56) + SourceIndex(0) +--- +>>> var _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(94, 5) Source(84, 6) + SourceIndex(0) +2 >Emitted(94, 23) Source(84, 35) + SourceIndex(0) +3 >Emitted(94, 25) Source(84, 11) + SourceIndex(0) +4 >Emitted(94, 42) Source(84, 19) + SourceIndex(0) +5 >Emitted(94, 44) Source(84, 21) + SourceIndex(0) +6 >Emitted(94, 69) Source(84, 34) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(85, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(85, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(85, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > (let [...multiRobotAInfo] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(97, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(97, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(97, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(97, 6) Source(87, 34) + SourceIndex(0) +5 >Emitted(97, 17) Source(87, 45) + SourceIndex(0) +6 >Emitted(97, 19) Source(87, 34) + SourceIndex(0) +7 >Emitted(97, 46) Source(87, 45) + SourceIndex(0) +8 >Emitted(97, 48) Source(87, 34) + SourceIndex(0) +9 >Emitted(97, 74) Source(87, 45) + SourceIndex(0) +10>Emitted(97, 76) Source(87, 34) + SourceIndex(0) +11>Emitted(97, 81) Source(87, 45) + SourceIndex(0) +12>Emitted(97, 82) Source(87, 46) + SourceIndex(0) +--- +>>> var multiRobotAInfo = multiRobots_4[_31].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(98, 5) Source(87, 11) + SourceIndex(0) +2 >Emitted(98, 54) Source(87, 29) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(99, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(99, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(99, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(99, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(99, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(99, 32) Source(88, 32) + SourceIndex(0) +7 >Emitted(99, 33) Source(88, 33) + SourceIndex(0) +8 >Emitted(99, 34) Source(88, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(100, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let [...multiRobotAInfo] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(101, 1) Source(90, 1) + SourceIndex(0) +2 >Emitted(101, 4) Source(90, 4) + SourceIndex(0) +3 >Emitted(101, 5) Source(90, 5) + SourceIndex(0) +4 >Emitted(101, 6) Source(90, 34) + SourceIndex(0) +5 >Emitted(101, 17) Source(90, 50) + SourceIndex(0) +6 >Emitted(101, 19) Source(90, 34) + SourceIndex(0) +7 >Emitted(101, 25) Source(90, 34) + SourceIndex(0) +8 >Emitted(101, 39) Source(90, 48) + SourceIndex(0) +9 >Emitted(101, 41) Source(90, 50) + SourceIndex(0) +10>Emitted(101, 43) Source(90, 34) + SourceIndex(0) +11>Emitted(101, 59) Source(90, 50) + SourceIndex(0) +12>Emitted(101, 61) Source(90, 34) + SourceIndex(0) +13>Emitted(101, 66) Source(90, 50) + SourceIndex(0) +14>Emitted(101, 67) Source(90, 51) + SourceIndex(0) +--- +>>> var multiRobotAInfo = _33[_32].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(102, 5) Source(90, 11) + SourceIndex(0) +2 >Emitted(102, 44) Source(90, 29) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(103, 5) Source(91, 5) + SourceIndex(0) +2 >Emitted(103, 12) Source(91, 12) + SourceIndex(0) +3 >Emitted(103, 13) Source(91, 13) + SourceIndex(0) +4 >Emitted(103, 16) Source(91, 16) + SourceIndex(0) +5 >Emitted(103, 17) Source(91, 17) + SourceIndex(0) +6 >Emitted(103, 32) Source(91, 32) + SourceIndex(0) +7 >Emitted(103, 33) Source(91, 33) + SourceIndex(0) +8 >Emitted(103, 34) Source(91, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(104, 2) Source(92, 2) + SourceIndex(0) +--- +>>>for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [...multiRobotAInfo] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(105, 1) Source(93, 1) + SourceIndex(0) +2 >Emitted(105, 4) Source(93, 4) + SourceIndex(0) +3 >Emitted(105, 5) Source(93, 5) + SourceIndex(0) +4 >Emitted(105, 6) Source(93, 34) + SourceIndex(0) +5 >Emitted(105, 17) Source(93, 60) + SourceIndex(0) +6 >Emitted(105, 19) Source(93, 34) + SourceIndex(0) +7 >Emitted(105, 26) Source(93, 35) + SourceIndex(0) +8 >Emitted(105, 37) Source(93, 46) + SourceIndex(0) +9 >Emitted(105, 39) Source(93, 48) + SourceIndex(0) +10>Emitted(105, 50) Source(93, 59) + SourceIndex(0) +11>Emitted(105, 51) Source(93, 60) + SourceIndex(0) +12>Emitted(105, 53) Source(93, 34) + SourceIndex(0) +13>Emitted(105, 69) Source(93, 60) + SourceIndex(0) +14>Emitted(105, 71) Source(93, 34) + SourceIndex(0) +15>Emitted(105, 76) Source(93, 60) + SourceIndex(0) +16>Emitted(105, 77) Source(93, 61) + SourceIndex(0) +--- +>>> var multiRobotAInfo = _35[_34].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(106, 5) Source(93, 11) + SourceIndex(0) +2 >Emitted(106, 44) Source(93, 29) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(107, 5) Source(94, 5) + SourceIndex(0) +2 >Emitted(107, 12) Source(94, 12) + SourceIndex(0) +3 >Emitted(107, 13) Source(94, 13) + SourceIndex(0) +4 >Emitted(107, 16) Source(94, 16) + SourceIndex(0) +5 >Emitted(107, 17) Source(94, 17) + SourceIndex(0) +6 >Emitted(107, 32) Source(94, 32) + SourceIndex(0) +7 >Emitted(107, 33) Source(94, 33) + SourceIndex(0) +8 >Emitted(107, 34) Source(94, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(108, 2) Source(95, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.symbols new file mode 100644 index 00000000000..7d4412805e0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.symbols @@ -0,0 +1,323 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) +} + +for (let [, nameA] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 20, 11)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 20, 11)) +} +for (let [, nameA] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 23, 11)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 23, 11)) +} +for (let [, nameA] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 26, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 26, 11)) +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 29, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 29, 27)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 29, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 32, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 32, 27)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 32, 13)) +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 35, 13)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 35, 27)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 35, 13)) +} + +for (let [numberB] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 39, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 39, 10)) +} +for (let [numberB] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 42, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 42, 10)) +} +for (let [numberB] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 45, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 45, 10)) +} +for (let [nameB] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 48, 10)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 48, 10)) +} +for (let [nameB] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 51, 10)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 51, 10)) +} +for (let [nameB] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 54, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 54, 10)) +} + +for (let [numberA2, nameA2, skillA2] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 27)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 58, 19)) +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 27)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 61, 19)) +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 27)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 64, 19)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 33)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 67, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 33)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 70, 10)) +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 10)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 19)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 33)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 73, 10)) +} + +for (let [numberA3, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 77, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 77, 19)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 77, 10)) +} +for (let [numberA3, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 80, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 80, 19)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 80, 10)) +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 83, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 83, 19)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 83, 10)) +} +for (let [...multiRobotAInfo] of multiRobots) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 86, 10)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 86, 10)) +} +for (let [...multiRobotAInfo] of getMultiRobots()) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 89, 10)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 15, 45)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 89, 10)) +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 92, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 14, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern.ts, 92, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types new file mode 100644 index 00000000000..95c947f8fcc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types @@ -0,0 +1,389 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +for (let [, nameA] of robots) { +> : undefined +>nameA : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] of getRobots()) { +> : undefined +>nameA : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA] of [robotA, robotB]) { +> : undefined +>nameA : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +> : undefined +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB] of robots) { +>numberB : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] of getRobots()) { +>numberB : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB] of [robotA, robotB]) { +>numberB : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB] of multiRobots) { +>nameB : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] of getMultiRobots()) { +>nameB : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB] of [multiRobotA, multiRobotB]) { +>nameB : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2, nameA2, skillA2] of robots) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3, ...robotAInfo] of robots) { +>numberA3 : number +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] of getRobots()) { +>numberA3 : number +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : number +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [...multiRobotAInfo] of multiRobots) { +>multiRobotAInfo : (string | [string, string])[] +>multiRobots : [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] of getMultiRobots()) { +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>multiRobotAInfo : (string | [string, string])[] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js new file mode 100644 index 00000000000..8b21faf3ad9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js @@ -0,0 +1,217 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA] of robots) { + console.log(nameA); +} +for ([, nameA] of getRobots()) { + console.log(nameA); +} +for ([, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB] of robots) { + console.log(numberB); +} +for ([numberB] of getRobots()) { + console.log(numberB); +} +for ([numberB] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB] of multiRobots) { + console.log(nameB); +} +for ([nameB] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for ([...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPattern2.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + _a = robots_1[_i], nameA = _a[1]; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + _d = _c[_b], nameA = _d[1]; + console.log(nameA); +} +for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { + _g = _f[_e], nameA = _g[1]; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; + console.log(primarySkillA); +} +for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { + _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; + console.log(primarySkillA); +} +for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { + _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; + console.log(primarySkillA); +} +for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { + numberB = robots_2[_u][0]; + console.log(numberB); +} +for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { + numberB = _w[_v][0]; + console.log(numberB); +} +for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { + numberB = _y[_x][0]; + console.log(numberB); +} +for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { + nameB = multiRobots_2[_z][0]; + console.log(nameB); +} +for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { + nameB = _1[_0][0]; + console.log(nameB); +} +for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { + nameB = _3[_2][0]; + console.log(nameB); +} +for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { + _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; + console.log(nameA2); +} +for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { + _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; + console.log(nameA2); +} +for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { + _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; + console.log(nameA2); +} +for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { + _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; + console.log(nameMA); +} +for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { + _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; + console.log(nameMA); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; + console.log(nameMA); +} +for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { + _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); + console.log(numberA3); +} +for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { + _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); + console.log(numberA3); +} +for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { + _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); + console.log(numberA3); +} +for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { + multiRobotAInfo = multiRobots_4[_31].slice(0); + console.log(multiRobotAInfo); +} +for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { + multiRobotAInfo = _33[_32].slice(0); + console.log(multiRobotAInfo); +} +for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { + multiRobotAInfo = _35[_34].slice(0); + console.log(multiRobotAInfo); +} +var _a, _d, _g, _j, _k, _o, _p, _s, _t, _5, _8, _11, _13, _14, _17, _18, _21, _22, _24, _27, _30; +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map new file mode 100644 index 00000000000..cae221df0f2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,GAAG,CAAC,CAAc,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAApB,iBAAS,EAAN,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAc,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAzB,WAAS,EAAN,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAc,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA9B,WAAS,EAAN,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAApD,sBAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAAyC,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAAzD,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAAyC,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAAnE,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAc,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnB,yBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAc,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxB,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAc,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7B,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAY,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtB,4BAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3B,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAArC,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAAgC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAtC,iBAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAgC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA3C,WAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAgC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB,CAAC;IAAhD,aAA2B,EAA1B,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAA1D,wBAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA/D,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAzE,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAA8B,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAApC,mBAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA8B,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAzC,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA8B,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA9C,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAnC,6CAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAAyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAxC,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAAyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAlD,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..72970488233 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,2777 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 10) Source(21, 18) + SourceIndex(0) +4 >Emitted(13, 12) Source(21, 20) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 43) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 66) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 12) Source(22, 20) + SourceIndex(0) +4 >Emitted(14, 14) Source(22, 22) + SourceIndex(0) +5 >Emitted(14, 19) Source(22, 35) + SourceIndex(0) +6 >Emitted(14, 20) Source(22, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(15, 13) Source(23, 21) + SourceIndex(0) +4 >Emitted(15, 15) Source(23, 23) + SourceIndex(0) +5 >Emitted(15, 21) Source(23, 37) + SourceIndex(0) +6 >Emitted(15, 23) Source(23, 39) + SourceIndex(0) +7 >Emitted(15, 30) Source(23, 54) + SourceIndex(0) +8 >Emitted(15, 32) Source(23, 56) + SourceIndex(0) +9 >Emitted(15, 38) Source(23, 70) + SourceIndex(0) +10>Emitted(15, 39) Source(23, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(16, 13) Source(24, 21) + SourceIndex(0) +4 >Emitted(16, 15) Source(24, 23) + SourceIndex(0) +5 >Emitted(16, 25) Source(24, 54) + SourceIndex(0) +6 >Emitted(16, 27) Source(24, 56) + SourceIndex(0) +7 >Emitted(16, 42) Source(24, 102) + SourceIndex(0) +8 >Emitted(16, 43) Source(24, 103) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ([, nameA] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(26, 19) + SourceIndex(0) +5 >Emitted(17, 16) Source(26, 25) + SourceIndex(0) +6 >Emitted(17, 18) Source(26, 19) + SourceIndex(0) +7 >Emitted(17, 35) Source(26, 25) + SourceIndex(0) +8 >Emitted(17, 37) Source(26, 19) + SourceIndex(0) +9 >Emitted(17, 57) Source(26, 25) + SourceIndex(0) +10>Emitted(17, 59) Source(26, 19) + SourceIndex(0) +11>Emitted(17, 63) Source(26, 25) + SourceIndex(0) +12>Emitted(17, 64) Source(26, 26) + SourceIndex(0) +--- +>>> _a = robots_1[_i], nameA = _a[1]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > [, nameA] +3 > +4 > nameA +1 >Emitted(18, 5) Source(26, 6) + SourceIndex(0) +2 >Emitted(18, 22) Source(26, 15) + SourceIndex(0) +3 >Emitted(18, 24) Source(26, 9) + SourceIndex(0) +4 >Emitted(18, 37) Source(26, 14) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([, nameA] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(21, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(29, 19) + SourceIndex(0) +5 >Emitted(21, 16) Source(29, 30) + SourceIndex(0) +6 >Emitted(21, 18) Source(29, 19) + SourceIndex(0) +7 >Emitted(21, 23) Source(29, 19) + SourceIndex(0) +8 >Emitted(21, 32) Source(29, 28) + SourceIndex(0) +9 >Emitted(21, 34) Source(29, 30) + SourceIndex(0) +10>Emitted(21, 36) Source(29, 19) + SourceIndex(0) +11>Emitted(21, 50) Source(29, 30) + SourceIndex(0) +12>Emitted(21, 52) Source(29, 19) + SourceIndex(0) +13>Emitted(21, 56) Source(29, 30) + SourceIndex(0) +14>Emitted(21, 57) Source(29, 31) + SourceIndex(0) +--- +>>> _d = _c[_b], nameA = _d[1]; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > [, nameA] +3 > +4 > nameA +1 >Emitted(22, 5) Source(29, 6) + SourceIndex(0) +2 >Emitted(22, 16) Source(29, 15) + SourceIndex(0) +3 >Emitted(22, 18) Source(29, 9) + SourceIndex(0) +4 >Emitted(22, 31) Source(29, 14) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([, nameA] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(25, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(32, 19) + SourceIndex(0) +5 >Emitted(25, 16) Source(32, 35) + SourceIndex(0) +6 >Emitted(25, 18) Source(32, 19) + SourceIndex(0) +7 >Emitted(25, 24) Source(32, 20) + SourceIndex(0) +8 >Emitted(25, 30) Source(32, 26) + SourceIndex(0) +9 >Emitted(25, 32) Source(32, 28) + SourceIndex(0) +10>Emitted(25, 38) Source(32, 34) + SourceIndex(0) +11>Emitted(25, 39) Source(32, 35) + SourceIndex(0) +12>Emitted(25, 41) Source(32, 19) + SourceIndex(0) +13>Emitted(25, 55) Source(32, 35) + SourceIndex(0) +14>Emitted(25, 57) Source(32, 19) + SourceIndex(0) +15>Emitted(25, 61) Source(32, 35) + SourceIndex(0) +16>Emitted(25, 62) Source(32, 36) + SourceIndex(0) +--- +>>> _g = _f[_e], nameA = _g[1]; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +1 > +2 > [, nameA] +3 > +4 > nameA +1 >Emitted(26, 5) Source(32, 6) + SourceIndex(0) +2 >Emitted(26, 16) Source(32, 15) + SourceIndex(0) +3 >Emitted(26, 18) Source(32, 9) + SourceIndex(0) +4 >Emitted(26, 31) Source(32, 14) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(27, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(27, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(27, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(29, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(35, 46) + SourceIndex(0) +5 >Emitted(29, 16) Source(35, 57) + SourceIndex(0) +6 >Emitted(29, 18) Source(35, 46) + SourceIndex(0) +7 >Emitted(29, 45) Source(35, 57) + SourceIndex(0) +8 >Emitted(29, 47) Source(35, 46) + SourceIndex(0) +9 >Emitted(29, 72) Source(35, 57) + SourceIndex(0) +10>Emitted(29, 74) Source(35, 46) + SourceIndex(0) +11>Emitted(29, 78) Source(35, 57) + SourceIndex(0) +12>Emitted(29, 79) Source(35, 58) + SourceIndex(0) +--- +>>> _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(30, 5) Source(35, 6) + SourceIndex(0) +2 >Emitted(30, 27) Source(35, 42) + SourceIndex(0) +3 >Emitted(30, 29) Source(35, 9) + SourceIndex(0) +4 >Emitted(30, 39) Source(35, 41) + SourceIndex(0) +5 >Emitted(30, 41) Source(35, 10) + SourceIndex(0) +6 >Emitted(30, 62) Source(35, 23) + SourceIndex(0) +7 >Emitted(30, 64) Source(35, 25) + SourceIndex(0) +8 >Emitted(30, 87) Source(35, 40) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(36, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(36, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(36, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(33, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(38, 46) + SourceIndex(0) +5 >Emitted(33, 16) Source(38, 62) + SourceIndex(0) +6 >Emitted(33, 18) Source(38, 46) + SourceIndex(0) +7 >Emitted(33, 23) Source(38, 46) + SourceIndex(0) +8 >Emitted(33, 37) Source(38, 60) + SourceIndex(0) +9 >Emitted(33, 39) Source(38, 62) + SourceIndex(0) +10>Emitted(33, 41) Source(38, 46) + SourceIndex(0) +11>Emitted(33, 55) Source(38, 62) + SourceIndex(0) +12>Emitted(33, 57) Source(38, 46) + SourceIndex(0) +13>Emitted(33, 61) Source(38, 62) + SourceIndex(0) +14>Emitted(33, 62) Source(38, 63) + SourceIndex(0) +--- +>>> _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(34, 5) Source(38, 6) + SourceIndex(0) +2 >Emitted(34, 16) Source(38, 42) + SourceIndex(0) +3 >Emitted(34, 18) Source(38, 9) + SourceIndex(0) +4 >Emitted(34, 28) Source(38, 41) + SourceIndex(0) +5 >Emitted(34, 30) Source(38, 10) + SourceIndex(0) +6 >Emitted(34, 51) Source(38, 23) + SourceIndex(0) +7 >Emitted(34, 53) Source(38, 25) + SourceIndex(0) +8 >Emitted(34, 76) Source(38, 40) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(39, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(39, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(39, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(37, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(41, 46) + SourceIndex(0) +5 >Emitted(37, 16) Source(41, 72) + SourceIndex(0) +6 >Emitted(37, 18) Source(41, 46) + SourceIndex(0) +7 >Emitted(37, 24) Source(41, 47) + SourceIndex(0) +8 >Emitted(37, 35) Source(41, 58) + SourceIndex(0) +9 >Emitted(37, 37) Source(41, 60) + SourceIndex(0) +10>Emitted(37, 48) Source(41, 71) + SourceIndex(0) +11>Emitted(37, 49) Source(41, 72) + SourceIndex(0) +12>Emitted(37, 51) Source(41, 46) + SourceIndex(0) +13>Emitted(37, 65) Source(41, 72) + SourceIndex(0) +14>Emitted(37, 67) Source(41, 46) + SourceIndex(0) +15>Emitted(37, 71) Source(41, 72) + SourceIndex(0) +16>Emitted(37, 72) Source(41, 73) + SourceIndex(0) +--- +>>> _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [primarySkillA, secondarySkillA]] +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(38, 5) Source(41, 6) + SourceIndex(0) +2 >Emitted(38, 16) Source(41, 42) + SourceIndex(0) +3 >Emitted(38, 18) Source(41, 9) + SourceIndex(0) +4 >Emitted(38, 28) Source(41, 41) + SourceIndex(0) +5 >Emitted(38, 30) Source(41, 10) + SourceIndex(0) +6 >Emitted(38, 51) Source(41, 23) + SourceIndex(0) +7 >Emitted(38, 53) Source(41, 25) + SourceIndex(0) +8 >Emitted(38, 76) Source(41, 40) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(39, 30) Source(42, 30) + SourceIndex(0) +7 >Emitted(39, 31) Source(42, 31) + SourceIndex(0) +8 >Emitted(39, 32) Source(42, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ([numberB] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(41, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(45, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(45, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(45, 19) + SourceIndex(0) +5 >Emitted(41, 16) Source(45, 25) + SourceIndex(0) +6 >Emitted(41, 18) Source(45, 19) + SourceIndex(0) +7 >Emitted(41, 35) Source(45, 25) + SourceIndex(0) +8 >Emitted(41, 37) Source(45, 19) + SourceIndex(0) +9 >Emitted(41, 57) Source(45, 25) + SourceIndex(0) +10>Emitted(41, 59) Source(45, 19) + SourceIndex(0) +11>Emitted(41, 63) Source(45, 25) + SourceIndex(0) +12>Emitted(41, 64) Source(45, 26) + SourceIndex(0) +--- +>>> numberB = robots_2[_u][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB +1 >Emitted(42, 5) Source(45, 7) + SourceIndex(0) +2 >Emitted(42, 30) Source(45, 14) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(46, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(46, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(46, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(46, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(46, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(46, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(46, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(47, 2) + SourceIndex(0) +--- +>>>for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([numberB] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(45, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(48, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(48, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(48, 19) + SourceIndex(0) +5 >Emitted(45, 16) Source(48, 30) + SourceIndex(0) +6 >Emitted(45, 18) Source(48, 19) + SourceIndex(0) +7 >Emitted(45, 23) Source(48, 19) + SourceIndex(0) +8 >Emitted(45, 32) Source(48, 28) + SourceIndex(0) +9 >Emitted(45, 34) Source(48, 30) + SourceIndex(0) +10>Emitted(45, 36) Source(48, 19) + SourceIndex(0) +11>Emitted(45, 50) Source(48, 30) + SourceIndex(0) +12>Emitted(45, 52) Source(48, 19) + SourceIndex(0) +13>Emitted(45, 56) Source(48, 30) + SourceIndex(0) +14>Emitted(45, 57) Source(48, 31) + SourceIndex(0) +--- +>>> numberB = _w[_v][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > numberB +1 >Emitted(46, 5) Source(48, 7) + SourceIndex(0) +2 >Emitted(46, 24) Source(48, 14) + SourceIndex(0) +--- +>>> console.log(numberB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1->] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1->Emitted(47, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(49, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(49, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(49, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([numberB] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(49, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(51, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(51, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(51, 19) + SourceIndex(0) +5 >Emitted(49, 16) Source(51, 35) + SourceIndex(0) +6 >Emitted(49, 18) Source(51, 19) + SourceIndex(0) +7 >Emitted(49, 24) Source(51, 20) + SourceIndex(0) +8 >Emitted(49, 30) Source(51, 26) + SourceIndex(0) +9 >Emitted(49, 32) Source(51, 28) + SourceIndex(0) +10>Emitted(49, 38) Source(51, 34) + SourceIndex(0) +11>Emitted(49, 39) Source(51, 35) + SourceIndex(0) +12>Emitted(49, 41) Source(51, 19) + SourceIndex(0) +13>Emitted(49, 55) Source(51, 35) + SourceIndex(0) +14>Emitted(49, 57) Source(51, 19) + SourceIndex(0) +15>Emitted(49, 61) Source(51, 35) + SourceIndex(0) +16>Emitted(49, 62) Source(51, 36) + SourceIndex(0) +--- +>>> numberB = _y[_x][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > numberB +1 >Emitted(50, 5) Source(51, 7) + SourceIndex(0) +2 >Emitted(50, 24) Source(51, 14) + SourceIndex(0) +--- +>>> console.log(numberB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1->] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1->Emitted(51, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(52, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(52, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(52, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(52, 17) + SourceIndex(0) +6 >Emitted(51, 24) Source(52, 24) + SourceIndex(0) +7 >Emitted(51, 25) Source(52, 25) + SourceIndex(0) +8 >Emitted(51, 26) Source(52, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(53, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ([nameB] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(53, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(54, 17) + SourceIndex(0) +5 >Emitted(53, 16) Source(54, 28) + SourceIndex(0) +6 >Emitted(53, 18) Source(54, 17) + SourceIndex(0) +7 >Emitted(53, 45) Source(54, 28) + SourceIndex(0) +8 >Emitted(53, 47) Source(54, 17) + SourceIndex(0) +9 >Emitted(53, 72) Source(54, 28) + SourceIndex(0) +10>Emitted(53, 74) Source(54, 17) + SourceIndex(0) +11>Emitted(53, 78) Source(54, 28) + SourceIndex(0) +12>Emitted(53, 79) Source(54, 29) + SourceIndex(0) +--- +>>> nameB = multiRobots_2[_z][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB +1 >Emitted(54, 5) Source(54, 7) + SourceIndex(0) +2 >Emitted(54, 33) Source(54, 12) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(55, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(55, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(55, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(55, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(55, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(55, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(55, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(56, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([nameB] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(57, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(57, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(57, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(57, 17) + SourceIndex(0) +5 >Emitted(57, 16) Source(57, 33) + SourceIndex(0) +6 >Emitted(57, 18) Source(57, 17) + SourceIndex(0) +7 >Emitted(57, 23) Source(57, 17) + SourceIndex(0) +8 >Emitted(57, 37) Source(57, 31) + SourceIndex(0) +9 >Emitted(57, 39) Source(57, 33) + SourceIndex(0) +10>Emitted(57, 41) Source(57, 17) + SourceIndex(0) +11>Emitted(57, 55) Source(57, 33) + SourceIndex(0) +12>Emitted(57, 57) Source(57, 17) + SourceIndex(0) +13>Emitted(57, 61) Source(57, 33) + SourceIndex(0) +14>Emitted(57, 62) Source(57, 34) + SourceIndex(0) +--- +>>> nameB = _1[_0][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > nameB +1 >Emitted(58, 5) Source(57, 7) + SourceIndex(0) +2 >Emitted(58, 22) Source(57, 12) + SourceIndex(0) +--- +>>> console.log(nameB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1->] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1->Emitted(59, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(58, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(58, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(58, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([nameB] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(61, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(60, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(60, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(60, 17) + SourceIndex(0) +5 >Emitted(61, 16) Source(60, 43) + SourceIndex(0) +6 >Emitted(61, 18) Source(60, 17) + SourceIndex(0) +7 >Emitted(61, 24) Source(60, 18) + SourceIndex(0) +8 >Emitted(61, 35) Source(60, 29) + SourceIndex(0) +9 >Emitted(61, 37) Source(60, 31) + SourceIndex(0) +10>Emitted(61, 48) Source(60, 42) + SourceIndex(0) +11>Emitted(61, 49) Source(60, 43) + SourceIndex(0) +12>Emitted(61, 51) Source(60, 17) + SourceIndex(0) +13>Emitted(61, 65) Source(60, 43) + SourceIndex(0) +14>Emitted(61, 67) Source(60, 17) + SourceIndex(0) +15>Emitted(61, 71) Source(60, 43) + SourceIndex(0) +16>Emitted(61, 72) Source(60, 44) + SourceIndex(0) +--- +>>> nameB = _3[_2][0]; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^-> +1 > +2 > nameB +1 >Emitted(62, 5) Source(60, 7) + SourceIndex(0) +2 >Emitted(62, 22) Source(60, 12) + SourceIndex(0) +--- +>>> console.log(nameB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1->] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1->Emitted(63, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(63, 22) Source(61, 22) + SourceIndex(0) +7 >Emitted(63, 23) Source(61, 23) + SourceIndex(0) +8 >Emitted(63, 24) Source(61, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA2, nameA2, skillA2] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(65, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(64, 37) + SourceIndex(0) +5 >Emitted(65, 16) Source(64, 43) + SourceIndex(0) +6 >Emitted(65, 18) Source(64, 37) + SourceIndex(0) +7 >Emitted(65, 35) Source(64, 43) + SourceIndex(0) +8 >Emitted(65, 37) Source(64, 37) + SourceIndex(0) +9 >Emitted(65, 57) Source(64, 43) + SourceIndex(0) +10>Emitted(65, 59) Source(64, 37) + SourceIndex(0) +11>Emitted(65, 63) Source(64, 43) + SourceIndex(0) +12>Emitted(65, 64) Source(64, 44) + SourceIndex(0) +--- +>>> _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(66, 5) Source(64, 6) + SourceIndex(0) +2 >Emitted(66, 22) Source(64, 33) + SourceIndex(0) +3 >Emitted(66, 24) Source(64, 7) + SourceIndex(0) +4 >Emitted(66, 40) Source(64, 15) + SourceIndex(0) +5 >Emitted(66, 42) Source(64, 17) + SourceIndex(0) +6 >Emitted(66, 56) Source(64, 23) + SourceIndex(0) +7 >Emitted(66, 58) Source(64, 25) + SourceIndex(0) +8 >Emitted(66, 73) Source(64, 32) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(65, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(65, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(65, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2, nameA2, skillA2] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(69, 1) Source(67, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(67, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(67, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(67, 37) + SourceIndex(0) +5 >Emitted(69, 16) Source(67, 48) + SourceIndex(0) +6 >Emitted(69, 18) Source(67, 37) + SourceIndex(0) +7 >Emitted(69, 23) Source(67, 37) + SourceIndex(0) +8 >Emitted(69, 32) Source(67, 46) + SourceIndex(0) +9 >Emitted(69, 34) Source(67, 48) + SourceIndex(0) +10>Emitted(69, 36) Source(67, 37) + SourceIndex(0) +11>Emitted(69, 50) Source(67, 48) + SourceIndex(0) +12>Emitted(69, 52) Source(67, 37) + SourceIndex(0) +13>Emitted(69, 56) Source(67, 48) + SourceIndex(0) +14>Emitted(69, 57) Source(67, 49) + SourceIndex(0) +--- +>>> _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +1-> +2 > [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(70, 5) Source(67, 6) + SourceIndex(0) +2 >Emitted(70, 16) Source(67, 33) + SourceIndex(0) +3 >Emitted(70, 18) Source(67, 7) + SourceIndex(0) +4 >Emitted(70, 34) Source(67, 15) + SourceIndex(0) +5 >Emitted(70, 36) Source(67, 17) + SourceIndex(0) +6 >Emitted(70, 50) Source(67, 23) + SourceIndex(0) +7 >Emitted(70, 52) Source(67, 25) + SourceIndex(0) +8 >Emitted(70, 67) Source(67, 32) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(68, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(68, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(68, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2, nameA2, skillA2] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(73, 1) Source(70, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(70, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(70, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(70, 37) + SourceIndex(0) +5 >Emitted(73, 16) Source(70, 53) + SourceIndex(0) +6 >Emitted(73, 18) Source(70, 37) + SourceIndex(0) +7 >Emitted(73, 25) Source(70, 38) + SourceIndex(0) +8 >Emitted(73, 31) Source(70, 44) + SourceIndex(0) +9 >Emitted(73, 33) Source(70, 46) + SourceIndex(0) +10>Emitted(73, 39) Source(70, 52) + SourceIndex(0) +11>Emitted(73, 40) Source(70, 53) + SourceIndex(0) +12>Emitted(73, 42) Source(70, 37) + SourceIndex(0) +13>Emitted(73, 57) Source(70, 53) + SourceIndex(0) +14>Emitted(73, 59) Source(70, 37) + SourceIndex(0) +15>Emitted(73, 63) Source(70, 53) + SourceIndex(0) +16>Emitted(73, 64) Source(70, 54) + SourceIndex(0) +--- +>>> _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; +1->^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2, nameA2, skillA2] +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +1->Emitted(74, 5) Source(70, 6) + SourceIndex(0) +2 >Emitted(74, 18) Source(70, 33) + SourceIndex(0) +3 >Emitted(74, 20) Source(70, 7) + SourceIndex(0) +4 >Emitted(74, 37) Source(70, 15) + SourceIndex(0) +5 >Emitted(74, 39) Source(70, 17) + SourceIndex(0) +6 >Emitted(74, 54) Source(70, 23) + SourceIndex(0) +7 >Emitted(74, 56) Source(70, 25) + SourceIndex(0) +8 >Emitted(74, 72) Source(70, 32) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(75, 5) Source(71, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(71, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(71, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(71, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(71, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(71, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(71, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(71, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(72, 2) + SourceIndex(0) +--- +>>>for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA, [primarySkillA, secondarySkillA]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(77, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(73, 52) + SourceIndex(0) +5 >Emitted(77, 17) Source(73, 63) + SourceIndex(0) +6 >Emitted(77, 19) Source(73, 52) + SourceIndex(0) +7 >Emitted(77, 46) Source(73, 63) + SourceIndex(0) +8 >Emitted(77, 48) Source(73, 52) + SourceIndex(0) +9 >Emitted(77, 74) Source(73, 63) + SourceIndex(0) +10>Emitted(77, 76) Source(73, 52) + SourceIndex(0) +11>Emitted(77, 81) Source(73, 63) + SourceIndex(0) +12>Emitted(77, 82) Source(73, 64) + SourceIndex(0) +--- +>>> _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(78, 5) Source(73, 6) + SourceIndex(0) +2 >Emitted(78, 29) Source(73, 48) + SourceIndex(0) +3 >Emitted(78, 31) Source(73, 7) + SourceIndex(0) +4 >Emitted(78, 46) Source(73, 13) + SourceIndex(0) +5 >Emitted(78, 48) Source(73, 15) + SourceIndex(0) +6 >Emitted(78, 60) Source(73, 47) + SourceIndex(0) +7 >Emitted(78, 62) Source(73, 16) + SourceIndex(0) +8 >Emitted(78, 84) Source(73, 29) + SourceIndex(0) +9 >Emitted(78, 86) Source(73, 31) + SourceIndex(0) +10>Emitted(78, 110) Source(73, 46) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(74, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(74, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(74, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(74, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(74, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(74, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(74, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(74, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(75, 2) + SourceIndex(0) +--- +>>>for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA, [primarySkillA, secondarySkillA]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(81, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(76, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(76, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(76, 52) + SourceIndex(0) +5 >Emitted(81, 17) Source(76, 68) + SourceIndex(0) +6 >Emitted(81, 19) Source(76, 52) + SourceIndex(0) +7 >Emitted(81, 25) Source(76, 52) + SourceIndex(0) +8 >Emitted(81, 39) Source(76, 66) + SourceIndex(0) +9 >Emitted(81, 41) Source(76, 68) + SourceIndex(0) +10>Emitted(81, 43) Source(76, 52) + SourceIndex(0) +11>Emitted(81, 59) Source(76, 68) + SourceIndex(0) +12>Emitted(81, 61) Source(76, 52) + SourceIndex(0) +13>Emitted(81, 66) Source(76, 68) + SourceIndex(0) +14>Emitted(81, 67) Source(76, 69) + SourceIndex(0) +--- +>>> _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(82, 5) Source(76, 6) + SourceIndex(0) +2 >Emitted(82, 19) Source(76, 48) + SourceIndex(0) +3 >Emitted(82, 21) Source(76, 7) + SourceIndex(0) +4 >Emitted(82, 36) Source(76, 13) + SourceIndex(0) +5 >Emitted(82, 38) Source(76, 15) + SourceIndex(0) +6 >Emitted(82, 50) Source(76, 47) + SourceIndex(0) +7 >Emitted(82, 52) Source(76, 16) + SourceIndex(0) +8 >Emitted(82, 74) Source(76, 29) + SourceIndex(0) +9 >Emitted(82, 76) Source(76, 31) + SourceIndex(0) +10>Emitted(82, 100) Source(76, 46) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(77, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(77, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(77, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(77, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(77, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(77, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(77, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(77, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(78, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA, [primarySkillA, secondarySkillA]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(85, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(79, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(79, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(79, 52) + SourceIndex(0) +5 >Emitted(85, 17) Source(79, 78) + SourceIndex(0) +6 >Emitted(85, 19) Source(79, 52) + SourceIndex(0) +7 >Emitted(85, 26) Source(79, 53) + SourceIndex(0) +8 >Emitted(85, 37) Source(79, 64) + SourceIndex(0) +9 >Emitted(85, 39) Source(79, 66) + SourceIndex(0) +10>Emitted(85, 50) Source(79, 77) + SourceIndex(0) +11>Emitted(85, 51) Source(79, 78) + SourceIndex(0) +12>Emitted(85, 53) Source(79, 52) + SourceIndex(0) +13>Emitted(85, 69) Source(79, 78) + SourceIndex(0) +14>Emitted(85, 71) Source(79, 52) + SourceIndex(0) +15>Emitted(85, 76) Source(79, 78) + SourceIndex(0) +16>Emitted(85, 77) Source(79, 79) + SourceIndex(0) +--- +>>> _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA, [primarySkillA, secondarySkillA]] +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +1->Emitted(86, 5) Source(79, 6) + SourceIndex(0) +2 >Emitted(86, 19) Source(79, 48) + SourceIndex(0) +3 >Emitted(86, 21) Source(79, 7) + SourceIndex(0) +4 >Emitted(86, 36) Source(79, 13) + SourceIndex(0) +5 >Emitted(86, 38) Source(79, 15) + SourceIndex(0) +6 >Emitted(86, 50) Source(79, 47) + SourceIndex(0) +7 >Emitted(86, 52) Source(79, 16) + SourceIndex(0) +8 >Emitted(86, 74) Source(79, 29) + SourceIndex(0) +9 >Emitted(86, 76) Source(79, 31) + SourceIndex(0) +10>Emitted(86, 100) Source(79, 46) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(87, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(80, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(80, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(80, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(80, 17) + SourceIndex(0) +6 >Emitted(87, 23) Source(80, 23) + SourceIndex(0) +7 >Emitted(87, 24) Source(80, 24) + SourceIndex(0) +8 >Emitted(87, 25) Source(80, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(81, 2) + SourceIndex(0) +--- +>>>for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA3, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(89, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(83, 35) + SourceIndex(0) +5 >Emitted(89, 17) Source(83, 41) + SourceIndex(0) +6 >Emitted(89, 19) Source(83, 35) + SourceIndex(0) +7 >Emitted(89, 36) Source(83, 41) + SourceIndex(0) +8 >Emitted(89, 38) Source(83, 35) + SourceIndex(0) +9 >Emitted(89, 59) Source(83, 41) + SourceIndex(0) +10>Emitted(89, 61) Source(83, 35) + SourceIndex(0) +11>Emitted(89, 66) Source(83, 41) + SourceIndex(0) +12>Emitted(89, 67) Source(83, 42) + SourceIndex(0) +--- +>>> _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(90, 5) Source(83, 6) + SourceIndex(0) +2 >Emitted(90, 24) Source(83, 31) + SourceIndex(0) +3 >Emitted(90, 26) Source(83, 7) + SourceIndex(0) +4 >Emitted(90, 43) Source(83, 15) + SourceIndex(0) +5 >Emitted(90, 45) Source(83, 17) + SourceIndex(0) +6 >Emitted(90, 70) Source(83, 30) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(84, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(84, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(84, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(84, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(84, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(84, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(84, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(84, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(85, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA3, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(93, 1) Source(86, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(86, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(86, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(86, 35) + SourceIndex(0) +5 >Emitted(93, 17) Source(86, 46) + SourceIndex(0) +6 >Emitted(93, 19) Source(86, 35) + SourceIndex(0) +7 >Emitted(93, 25) Source(86, 35) + SourceIndex(0) +8 >Emitted(93, 34) Source(86, 44) + SourceIndex(0) +9 >Emitted(93, 36) Source(86, 46) + SourceIndex(0) +10>Emitted(93, 38) Source(86, 35) + SourceIndex(0) +11>Emitted(93, 54) Source(86, 46) + SourceIndex(0) +12>Emitted(93, 56) Source(86, 35) + SourceIndex(0) +13>Emitted(93, 61) Source(86, 46) + SourceIndex(0) +14>Emitted(93, 62) Source(86, 47) + SourceIndex(0) +--- +>>> _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1->Emitted(94, 5) Source(86, 6) + SourceIndex(0) +2 >Emitted(94, 19) Source(86, 31) + SourceIndex(0) +3 >Emitted(94, 21) Source(86, 7) + SourceIndex(0) +4 >Emitted(94, 38) Source(86, 15) + SourceIndex(0) +5 >Emitted(94, 40) Source(86, 17) + SourceIndex(0) +6 >Emitted(94, 65) Source(86, 30) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(87, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(87, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(87, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([numberA3, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(97, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(97, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(97, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(97, 6) Source(89, 35) + SourceIndex(0) +5 >Emitted(97, 17) Source(89, 51) + SourceIndex(0) +6 >Emitted(97, 19) Source(89, 35) + SourceIndex(0) +7 >Emitted(97, 26) Source(89, 36) + SourceIndex(0) +8 >Emitted(97, 32) Source(89, 42) + SourceIndex(0) +9 >Emitted(97, 34) Source(89, 44) + SourceIndex(0) +10>Emitted(97, 40) Source(89, 50) + SourceIndex(0) +11>Emitted(97, 41) Source(89, 51) + SourceIndex(0) +12>Emitted(97, 43) Source(89, 35) + SourceIndex(0) +13>Emitted(97, 59) Source(89, 51) + SourceIndex(0) +14>Emitted(97, 61) Source(89, 35) + SourceIndex(0) +15>Emitted(97, 66) Source(89, 51) + SourceIndex(0) +16>Emitted(97, 67) Source(89, 52) + SourceIndex(0) +--- +>>> _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); +1 >^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > [numberA3, ...robotAInfo] +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +1 >Emitted(98, 5) Source(89, 6) + SourceIndex(0) +2 >Emitted(98, 19) Source(89, 31) + SourceIndex(0) +3 >Emitted(98, 21) Source(89, 7) + SourceIndex(0) +4 >Emitted(98, 38) Source(89, 15) + SourceIndex(0) +5 >Emitted(98, 40) Source(89, 17) + SourceIndex(0) +6 >Emitted(98, 65) Source(89, 30) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(99, 5) Source(90, 5) + SourceIndex(0) +2 >Emitted(99, 12) Source(90, 12) + SourceIndex(0) +3 >Emitted(99, 13) Source(90, 13) + SourceIndex(0) +4 >Emitted(99, 16) Source(90, 16) + SourceIndex(0) +5 >Emitted(99, 17) Source(90, 17) + SourceIndex(0) +6 >Emitted(99, 25) Source(90, 25) + SourceIndex(0) +7 >Emitted(99, 26) Source(90, 26) + SourceIndex(0) +8 >Emitted(99, 27) Source(90, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(100, 2) Source(91, 2) + SourceIndex(0) +--- +>>>for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ([...multiRobotAInfo] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(101, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(101, 4) Source(92, 4) + SourceIndex(0) +3 >Emitted(101, 5) Source(92, 5) + SourceIndex(0) +4 >Emitted(101, 6) Source(92, 30) + SourceIndex(0) +5 >Emitted(101, 17) Source(92, 41) + SourceIndex(0) +6 >Emitted(101, 19) Source(92, 30) + SourceIndex(0) +7 >Emitted(101, 46) Source(92, 41) + SourceIndex(0) +8 >Emitted(101, 48) Source(92, 30) + SourceIndex(0) +9 >Emitted(101, 74) Source(92, 41) + SourceIndex(0) +10>Emitted(101, 76) Source(92, 30) + SourceIndex(0) +11>Emitted(101, 81) Source(92, 41) + SourceIndex(0) +12>Emitted(101, 82) Source(92, 42) + SourceIndex(0) +--- +>>> multiRobotAInfo = multiRobots_4[_31].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(102, 5) Source(92, 7) + SourceIndex(0) +2 >Emitted(102, 50) Source(92, 25) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(103, 5) Source(93, 5) + SourceIndex(0) +2 >Emitted(103, 12) Source(93, 12) + SourceIndex(0) +3 >Emitted(103, 13) Source(93, 13) + SourceIndex(0) +4 >Emitted(103, 16) Source(93, 16) + SourceIndex(0) +5 >Emitted(103, 17) Source(93, 17) + SourceIndex(0) +6 >Emitted(103, 32) Source(93, 32) + SourceIndex(0) +7 >Emitted(103, 33) Source(93, 33) + SourceIndex(0) +8 >Emitted(103, 34) Source(93, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(104, 2) Source(94, 2) + SourceIndex(0) +--- +>>>for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([...multiRobotAInfo] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(105, 1) Source(95, 1) + SourceIndex(0) +2 >Emitted(105, 4) Source(95, 4) + SourceIndex(0) +3 >Emitted(105, 5) Source(95, 5) + SourceIndex(0) +4 >Emitted(105, 6) Source(95, 30) + SourceIndex(0) +5 >Emitted(105, 17) Source(95, 46) + SourceIndex(0) +6 >Emitted(105, 19) Source(95, 30) + SourceIndex(0) +7 >Emitted(105, 25) Source(95, 30) + SourceIndex(0) +8 >Emitted(105, 39) Source(95, 44) + SourceIndex(0) +9 >Emitted(105, 41) Source(95, 46) + SourceIndex(0) +10>Emitted(105, 43) Source(95, 30) + SourceIndex(0) +11>Emitted(105, 59) Source(95, 46) + SourceIndex(0) +12>Emitted(105, 61) Source(95, 30) + SourceIndex(0) +13>Emitted(105, 66) Source(95, 46) + SourceIndex(0) +14>Emitted(105, 67) Source(95, 47) + SourceIndex(0) +--- +>>> multiRobotAInfo = _33[_32].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(106, 5) Source(95, 7) + SourceIndex(0) +2 >Emitted(106, 40) Source(95, 25) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(107, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(107, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(107, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(107, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(107, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(107, 32) Source(96, 32) + SourceIndex(0) +7 >Emitted(107, 33) Source(96, 33) + SourceIndex(0) +8 >Emitted(107, 34) Source(96, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(108, 2) Source(97, 2) + SourceIndex(0) +--- +>>>for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([...multiRobotAInfo] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(109, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(109, 4) Source(98, 4) + SourceIndex(0) +3 >Emitted(109, 5) Source(98, 5) + SourceIndex(0) +4 >Emitted(109, 6) Source(98, 30) + SourceIndex(0) +5 >Emitted(109, 17) Source(98, 56) + SourceIndex(0) +6 >Emitted(109, 19) Source(98, 30) + SourceIndex(0) +7 >Emitted(109, 26) Source(98, 31) + SourceIndex(0) +8 >Emitted(109, 37) Source(98, 42) + SourceIndex(0) +9 >Emitted(109, 39) Source(98, 44) + SourceIndex(0) +10>Emitted(109, 50) Source(98, 55) + SourceIndex(0) +11>Emitted(109, 51) Source(98, 56) + SourceIndex(0) +12>Emitted(109, 53) Source(98, 30) + SourceIndex(0) +13>Emitted(109, 69) Source(98, 56) + SourceIndex(0) +14>Emitted(109, 71) Source(98, 30) + SourceIndex(0) +15>Emitted(109, 76) Source(98, 56) + SourceIndex(0) +16>Emitted(109, 77) Source(98, 57) + SourceIndex(0) +--- +>>> multiRobotAInfo = _35[_34].slice(0); +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...multiRobotAInfo +1 >Emitted(110, 5) Source(98, 7) + SourceIndex(0) +2 >Emitted(110, 40) Source(98, 25) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(111, 5) Source(99, 5) + SourceIndex(0) +2 >Emitted(111, 12) Source(99, 12) + SourceIndex(0) +3 >Emitted(111, 13) Source(99, 13) + SourceIndex(0) +4 >Emitted(111, 16) Source(99, 16) + SourceIndex(0) +5 >Emitted(111, 17) Source(99, 17) + SourceIndex(0) +6 >Emitted(111, 32) Source(99, 32) + SourceIndex(0) +7 >Emitted(111, 33) Source(99, 33) + SourceIndex(0) +8 >Emitted(111, 34) Source(99, 34) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(112, 2) Source(100, 2) + SourceIndex(0) +--- +>>>var _a, _d, _g, _j, _k, _o, _p, _s, _t, _5, _8, _11, _13, _14, _17, _18, _21, _22, _24, _27, _30; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.symbols new file mode 100644 index 00000000000..9f7648afccb --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.symbols @@ -0,0 +1,343 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) + +for ([, nameA] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +} +for ([, nameA] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +} +for ([, nameA] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 3)) +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +} + +for ([numberB] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +} +for ([numberB] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +} +for ([numberB] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 3)) +} +for ([nameB] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +} +for ([nameB] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +} +for ([nameB] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 21, 20)) +} + +for ([numberA2, nameA2, skillA2] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +} +for ([numberA2, nameA2, skillA2] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 21)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 20, 41)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 22, 54)) +} + +for ([numberA3, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +} +for ([numberA3, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 3)) +} +for ([...multiRobotAInfo] of multiRobots) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +} +for ([...multiRobotAInfo] of getMultiRobots()) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 15, 45)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 14, 3)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPattern2.ts, 23, 54)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types new file mode 100644 index 00000000000..33b503d0d8f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types @@ -0,0 +1,445 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +for ([, nameA] of robots) { +>[, nameA] : string[] +> : undefined +>nameA : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] of getRobots()) { +>[, nameA] : string[] +> : undefined +>nameA : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA] of [robotA, robotB]) { +>[, nameA] : string[] +> : undefined +>nameA : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { +>[, [primarySkillA, secondarySkillA]] : string[][] +> : undefined +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>[, [primarySkillA, secondarySkillA]] : string[][] +> : undefined +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>[, [primarySkillA, secondarySkillA]] : string[][] +> : undefined +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB] of robots) { +>[numberB] : number[] +>numberB : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] of getRobots()) { +>[numberB] : number[] +>numberB : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB] of [robotA, robotB]) { +>[numberB] : number[] +>numberB : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB] of multiRobots) { +>[nameB] : string[] +>nameB : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] of getMultiRobots()) { +>[nameB] : string[] +>nameB : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB] of [multiRobotA, multiRobotB]) { +>[nameB] : string[] +>nameB : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2, nameA2, skillA2] of robots) { +>[numberA2, nameA2, skillA2] : (number | string)[] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] of getRobots()) { +>[numberA2, nameA2, skillA2] : (number | string)[] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { +>[numberA2, nameA2, skillA2] : (number | string)[] +>numberA2 : number +>nameA2 : string +>skillA2 : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +>[nameMA, [primarySkillA, secondarySkillA]] : (string | string[])[] +>nameMA : string +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +>[nameMA, [primarySkillA, secondarySkillA]] : (string | string[])[] +>nameMA : string +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +>[nameMA, [primarySkillA, secondarySkillA]] : (string | string[])[] +>nameMA : string +>[primarySkillA, secondarySkillA] : string[] +>primarySkillA : string +>secondarySkillA : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3, ...robotAInfo] of robots) { +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] of getRobots()) { +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { +>[numberA3, ...robotAInfo] : (number | string)[] +>numberA3 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([...multiRobotAInfo] of multiRobots) { +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>multiRobots : [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] of getMultiRobots()) { +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..ff692af87f2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js @@ -0,0 +1,204 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA = "noName"] of robots) { + console.log(nameA); +} +for (let [, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for (let [, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB = -1] of robots) { + console.log(numberB); +} +for (let [numberB = -1] of getRobots()) { + console.log(numberB); +} +for (let [numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for (let [nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; + console.log(nameA); +} +for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { + var _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; + console.log(nameA); +} +for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { + var _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; + console.log(nameA); +} +for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { + var _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; + console.log(primarySkillA); +} +for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { + var _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; + console.log(primarySkillA); +} +for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { + var _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; + console.log(primarySkillA); +} +for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { + var _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; + console.log(numberB); +} +for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { + var _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; + console.log(numberB); +} +for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { + var _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; + console.log(numberB); +} +for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { + var _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; + console.log(nameB); +} +for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { + var _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; + console.log(nameB); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + var _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; + console.log(nameB); +} +for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { + var _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; + console.log(nameA2); +} +for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { + var _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; + console.log(nameA2); +} +for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { + var _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; + console.log(nameA2); +} +for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { + var _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; + console.log(nameMA); +} +for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { + var _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; + console.log(nameMA); +} +for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { + var _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; + console.log(nameMA); +} +for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { + var _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); + console.log(numberA3); +} +for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { + var _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); + console.log(numberA3); +} +for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { + var _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); + console.log(numberA3); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..4d12f811df1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAA6B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnC,qBAAwB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxC,eAAwB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6B,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7C,eAAwB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAGyB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAHpC,0BAGoB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAHzC,eAGoB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAHnD,eAGoB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,wBAAY,EAAZ,iCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,mBAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAlC,qBAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAA2B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAjC,+BAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA2B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAtC,qBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA2B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAhD,qBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA8D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAApE,uBAAyD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA8D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAzE,kBAAyD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA8D,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA9E,kBAAyD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAHpC,4BAGoB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAHzC,kBAGoB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAHnD,kBAGoB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAuC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAA7C,uBAAkC,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAlD,kBAAkC,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAvD,kBAAkC,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..de9a60de903 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,2742 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [, nameA = "noName"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) +3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +4 >Emitted(13, 6) Source(21, 34) + SourceIndex(0) +5 >Emitted(13, 16) Source(21, 40) + SourceIndex(0) +6 >Emitted(13, 18) Source(21, 34) + SourceIndex(0) +7 >Emitted(13, 35) Source(21, 40) + SourceIndex(0) +8 >Emitted(13, 37) Source(21, 34) + SourceIndex(0) +9 >Emitted(13, 57) Source(21, 40) + SourceIndex(0) +10>Emitted(13, 59) Source(21, 34) + SourceIndex(0) +11>Emitted(13, 63) Source(21, 40) + SourceIndex(0) +12>Emitted(13, 64) Source(21, 41) + SourceIndex(0) +--- +>>> var _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(14, 5) Source(21, 6) + SourceIndex(0) +2 >Emitted(14, 26) Source(21, 30) + SourceIndex(0) +3 >Emitted(14, 28) Source(21, 13) + SourceIndex(0) +4 >Emitted(14, 38) Source(21, 29) + SourceIndex(0) +5 >Emitted(14, 40) Source(21, 13) + SourceIndex(0) +6 >Emitted(14, 77) Source(21, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(15, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(15, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(15, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(15, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(15, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(15, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(16, 2) Source(23, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, nameA = "noName"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(24, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(24, 34) + SourceIndex(0) +5 >Emitted(17, 16) Source(24, 45) + SourceIndex(0) +6 >Emitted(17, 18) Source(24, 34) + SourceIndex(0) +7 >Emitted(17, 23) Source(24, 34) + SourceIndex(0) +8 >Emitted(17, 32) Source(24, 43) + SourceIndex(0) +9 >Emitted(17, 34) Source(24, 45) + SourceIndex(0) +10>Emitted(17, 36) Source(24, 34) + SourceIndex(0) +11>Emitted(17, 50) Source(24, 45) + SourceIndex(0) +12>Emitted(17, 52) Source(24, 34) + SourceIndex(0) +13>Emitted(17, 56) Source(24, 45) + SourceIndex(0) +14>Emitted(17, 57) Source(24, 46) + SourceIndex(0) +--- +>>> var _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(18, 5) Source(24, 6) + SourceIndex(0) +2 >Emitted(18, 20) Source(24, 30) + SourceIndex(0) +3 >Emitted(18, 22) Source(24, 13) + SourceIndex(0) +4 >Emitted(18, 32) Source(24, 29) + SourceIndex(0) +5 >Emitted(18, 34) Source(24, 13) + SourceIndex(0) +6 >Emitted(18, 71) Source(24, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(25, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(25, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(25, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(25, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(25, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(25, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(25, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(26, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, nameA = "noName"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(27, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(27, 34) + SourceIndex(0) +5 >Emitted(21, 16) Source(27, 50) + SourceIndex(0) +6 >Emitted(21, 18) Source(27, 34) + SourceIndex(0) +7 >Emitted(21, 24) Source(27, 35) + SourceIndex(0) +8 >Emitted(21, 30) Source(27, 41) + SourceIndex(0) +9 >Emitted(21, 32) Source(27, 43) + SourceIndex(0) +10>Emitted(21, 38) Source(27, 49) + SourceIndex(0) +11>Emitted(21, 39) Source(27, 50) + SourceIndex(0) +12>Emitted(21, 41) Source(27, 34) + SourceIndex(0) +13>Emitted(21, 55) Source(27, 50) + SourceIndex(0) +14>Emitted(21, 57) Source(27, 34) + SourceIndex(0) +15>Emitted(21, 61) Source(27, 50) + SourceIndex(0) +16>Emitted(21, 62) Source(27, 51) + SourceIndex(0) +--- +>>> var _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(22, 5) Source(27, 6) + SourceIndex(0) +2 >Emitted(22, 20) Source(27, 30) + SourceIndex(0) +3 >Emitted(22, 22) Source(27, 13) + SourceIndex(0) +4 >Emitted(22, 32) Source(27, 29) + SourceIndex(0) +5 >Emitted(22, 34) Source(27, 13) + SourceIndex(0) +6 >Emitted(22, 71) Source(27, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(28, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(28, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(28, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(28, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(28, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(28, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(28, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(29, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(25, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(30, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(30, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(33, 30) + SourceIndex(0) +5 >Emitted(25, 16) Source(33, 41) + SourceIndex(0) +6 >Emitted(25, 18) Source(33, 30) + SourceIndex(0) +7 >Emitted(25, 45) Source(33, 41) + SourceIndex(0) +8 >Emitted(25, 47) Source(33, 30) + SourceIndex(0) +9 >Emitted(25, 72) Source(33, 41) + SourceIndex(0) +10>Emitted(25, 74) Source(33, 30) + SourceIndex(0) +11>Emitted(25, 78) Source(33, 41) + SourceIndex(0) +12>Emitted(25, 79) Source(33, 42) + SourceIndex(0) +--- +>>> var _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(26, 5) Source(30, 6) + SourceIndex(0) +2 >Emitted(26, 31) Source(33, 26) + SourceIndex(0) +3 >Emitted(26, 33) Source(30, 13) + SourceIndex(0) +4 >Emitted(26, 43) Source(33, 25) + SourceIndex(0) +5 >Emitted(26, 45) Source(30, 13) + SourceIndex(0) +6 >Emitted(26, 91) Source(33, 25) + SourceIndex(0) +7 >Emitted(26, 93) Source(31, 5) + SourceIndex(0) +8 >Emitted(26, 103) Source(31, 30) + SourceIndex(0) +9 >Emitted(26, 105) Source(31, 5) + SourceIndex(0) +10>Emitted(26, 151) Source(31, 30) + SourceIndex(0) +11>Emitted(26, 153) Source(32, 5) + SourceIndex(0) +12>Emitted(26, 163) Source(32, 34) + SourceIndex(0) +13>Emitted(26, 165) Source(32, 5) + SourceIndex(0) +14>Emitted(26, 215) Source(32, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(34, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(34, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(34, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(34, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(34, 17) + SourceIndex(0) +6 >Emitted(27, 30) Source(34, 30) + SourceIndex(0) +7 >Emitted(27, 31) Source(34, 31) + SourceIndex(0) +8 >Emitted(27, 32) Source(34, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(35, 2) + SourceIndex(0) +--- +>>>for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(29, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(36, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(36, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(39, 30) + SourceIndex(0) +5 >Emitted(29, 16) Source(39, 46) + SourceIndex(0) +6 >Emitted(29, 18) Source(39, 30) + SourceIndex(0) +7 >Emitted(29, 23) Source(39, 30) + SourceIndex(0) +8 >Emitted(29, 37) Source(39, 44) + SourceIndex(0) +9 >Emitted(29, 39) Source(39, 46) + SourceIndex(0) +10>Emitted(29, 41) Source(39, 30) + SourceIndex(0) +11>Emitted(29, 55) Source(39, 46) + SourceIndex(0) +12>Emitted(29, 57) Source(39, 30) + SourceIndex(0) +13>Emitted(29, 61) Source(39, 46) + SourceIndex(0) +14>Emitted(29, 62) Source(39, 47) + SourceIndex(0) +--- +>>> var _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(30, 5) Source(36, 6) + SourceIndex(0) +2 >Emitted(30, 20) Source(39, 26) + SourceIndex(0) +3 >Emitted(30, 22) Source(36, 13) + SourceIndex(0) +4 >Emitted(30, 32) Source(39, 25) + SourceIndex(0) +5 >Emitted(30, 34) Source(36, 13) + SourceIndex(0) +6 >Emitted(30, 80) Source(39, 25) + SourceIndex(0) +7 >Emitted(30, 82) Source(37, 5) + SourceIndex(0) +8 >Emitted(30, 92) Source(37, 30) + SourceIndex(0) +9 >Emitted(30, 94) Source(37, 5) + SourceIndex(0) +10>Emitted(30, 140) Source(37, 30) + SourceIndex(0) +11>Emitted(30, 142) Source(38, 5) + SourceIndex(0) +12>Emitted(30, 152) Source(38, 34) + SourceIndex(0) +13>Emitted(30, 154) Source(38, 5) + SourceIndex(0) +14>Emitted(30, 204) Source(38, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(40, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(40, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(40, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(40, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(40, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(40, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(40, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(40, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(41, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(33, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(42, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(42, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(45, 30) + SourceIndex(0) +5 >Emitted(33, 16) Source(45, 56) + SourceIndex(0) +6 >Emitted(33, 18) Source(45, 30) + SourceIndex(0) +7 >Emitted(33, 24) Source(45, 31) + SourceIndex(0) +8 >Emitted(33, 35) Source(45, 42) + SourceIndex(0) +9 >Emitted(33, 37) Source(45, 44) + SourceIndex(0) +10>Emitted(33, 48) Source(45, 55) + SourceIndex(0) +11>Emitted(33, 49) Source(45, 56) + SourceIndex(0) +12>Emitted(33, 51) Source(45, 30) + SourceIndex(0) +13>Emitted(33, 65) Source(45, 56) + SourceIndex(0) +14>Emitted(33, 67) Source(45, 30) + SourceIndex(0) +15>Emitted(33, 71) Source(45, 56) + SourceIndex(0) +16>Emitted(33, 72) Source(45, 57) + SourceIndex(0) +--- +>>> var _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(34, 5) Source(42, 6) + SourceIndex(0) +2 >Emitted(34, 20) Source(45, 26) + SourceIndex(0) +3 >Emitted(34, 22) Source(42, 13) + SourceIndex(0) +4 >Emitted(34, 32) Source(45, 25) + SourceIndex(0) +5 >Emitted(34, 34) Source(42, 13) + SourceIndex(0) +6 >Emitted(34, 80) Source(45, 25) + SourceIndex(0) +7 >Emitted(34, 82) Source(43, 5) + SourceIndex(0) +8 >Emitted(34, 92) Source(43, 30) + SourceIndex(0) +9 >Emitted(34, 94) Source(43, 5) + SourceIndex(0) +10>Emitted(34, 140) Source(43, 30) + SourceIndex(0) +11>Emitted(34, 142) Source(44, 5) + SourceIndex(0) +12>Emitted(34, 152) Source(44, 34) + SourceIndex(0) +13>Emitted(34, 154) Source(44, 5) + SourceIndex(0) +14>Emitted(34, 204) Source(44, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(46, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(46, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(46, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(46, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(46, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(46, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(46, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(47, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberB = -1] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(49, 28) + SourceIndex(0) +5 >Emitted(37, 16) Source(49, 34) + SourceIndex(0) +6 >Emitted(37, 18) Source(49, 28) + SourceIndex(0) +7 >Emitted(37, 35) Source(49, 34) + SourceIndex(0) +8 >Emitted(37, 37) Source(49, 28) + SourceIndex(0) +9 >Emitted(37, 57) Source(49, 34) + SourceIndex(0) +10>Emitted(37, 59) Source(49, 28) + SourceIndex(0) +11>Emitted(37, 63) Source(49, 34) + SourceIndex(0) +12>Emitted(37, 64) Source(49, 35) + SourceIndex(0) +--- +>>> var _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(38, 5) Source(49, 11) + SourceIndex(0) +2 >Emitted(38, 29) Source(49, 23) + SourceIndex(0) +3 >Emitted(38, 31) Source(49, 11) + SourceIndex(0) +4 >Emitted(38, 64) Source(49, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(39, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(39, 24) Source(50, 24) + SourceIndex(0) +7 >Emitted(39, 25) Source(50, 25) + SourceIndex(0) +8 >Emitted(39, 26) Source(50, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberB = -1] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(52, 28) + SourceIndex(0) +5 >Emitted(41, 16) Source(52, 39) + SourceIndex(0) +6 >Emitted(41, 18) Source(52, 28) + SourceIndex(0) +7 >Emitted(41, 23) Source(52, 28) + SourceIndex(0) +8 >Emitted(41, 32) Source(52, 37) + SourceIndex(0) +9 >Emitted(41, 34) Source(52, 39) + SourceIndex(0) +10>Emitted(41, 36) Source(52, 28) + SourceIndex(0) +11>Emitted(41, 50) Source(52, 39) + SourceIndex(0) +12>Emitted(41, 52) Source(52, 28) + SourceIndex(0) +13>Emitted(41, 56) Source(52, 39) + SourceIndex(0) +14>Emitted(41, 57) Source(52, 40) + SourceIndex(0) +--- +>>> var _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(42, 5) Source(52, 11) + SourceIndex(0) +2 >Emitted(42, 24) Source(52, 23) + SourceIndex(0) +3 >Emitted(42, 26) Source(52, 11) + SourceIndex(0) +4 >Emitted(42, 61) Source(52, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(53, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(53, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(53, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [numberB = -1] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(45, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(55, 28) + SourceIndex(0) +5 >Emitted(45, 17) Source(55, 44) + SourceIndex(0) +6 >Emitted(45, 19) Source(55, 28) + SourceIndex(0) +7 >Emitted(45, 26) Source(55, 29) + SourceIndex(0) +8 >Emitted(45, 32) Source(55, 35) + SourceIndex(0) +9 >Emitted(45, 34) Source(55, 37) + SourceIndex(0) +10>Emitted(45, 40) Source(55, 43) + SourceIndex(0) +11>Emitted(45, 41) Source(55, 44) + SourceIndex(0) +12>Emitted(45, 43) Source(55, 28) + SourceIndex(0) +13>Emitted(45, 59) Source(55, 44) + SourceIndex(0) +14>Emitted(45, 61) Source(55, 28) + SourceIndex(0) +15>Emitted(45, 66) Source(55, 44) + SourceIndex(0) +16>Emitted(45, 67) Source(55, 45) + SourceIndex(0) +--- +>>> var _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB = -1 +3 > +4 > numberB = -1 +1 >Emitted(46, 5) Source(55, 11) + SourceIndex(0) +2 >Emitted(46, 26) Source(55, 23) + SourceIndex(0) +3 >Emitted(46, 28) Source(55, 11) + SourceIndex(0) +4 >Emitted(46, 63) Source(55, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(47, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(56, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(56, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(56, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > (let [nameB = "noName"] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(58, 32) + SourceIndex(0) +5 >Emitted(49, 17) Source(58, 43) + SourceIndex(0) +6 >Emitted(49, 19) Source(58, 32) + SourceIndex(0) +7 >Emitted(49, 46) Source(58, 43) + SourceIndex(0) +8 >Emitted(49, 48) Source(58, 32) + SourceIndex(0) +9 >Emitted(49, 74) Source(58, 43) + SourceIndex(0) +10>Emitted(49, 76) Source(58, 32) + SourceIndex(0) +11>Emitted(49, 81) Source(58, 43) + SourceIndex(0) +12>Emitted(49, 82) Source(58, 44) + SourceIndex(0) +--- +>>> var _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(50, 5) Source(58, 11) + SourceIndex(0) +2 >Emitted(50, 36) Source(58, 27) + SourceIndex(0) +3 >Emitted(50, 38) Source(58, 11) + SourceIndex(0) +4 >Emitted(50, 77) Source(58, 27) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(51, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(51, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(51, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(51, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^-> +1-> + > +2 >for +3 > +4 > (let [nameB = "noName"] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(61, 32) + SourceIndex(0) +5 >Emitted(53, 17) Source(61, 48) + SourceIndex(0) +6 >Emitted(53, 19) Source(61, 32) + SourceIndex(0) +7 >Emitted(53, 25) Source(61, 32) + SourceIndex(0) +8 >Emitted(53, 39) Source(61, 46) + SourceIndex(0) +9 >Emitted(53, 41) Source(61, 48) + SourceIndex(0) +10>Emitted(53, 43) Source(61, 32) + SourceIndex(0) +11>Emitted(53, 59) Source(61, 48) + SourceIndex(0) +12>Emitted(53, 61) Source(61, 32) + SourceIndex(0) +13>Emitted(53, 66) Source(61, 48) + SourceIndex(0) +14>Emitted(53, 67) Source(61, 49) + SourceIndex(0) +--- +>>> var _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1->Emitted(54, 5) Source(61, 11) + SourceIndex(0) +2 >Emitted(54, 26) Source(61, 27) + SourceIndex(0) +3 >Emitted(54, 28) Source(61, 11) + SourceIndex(0) +4 >Emitted(54, 67) Source(61, 27) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > (let [nameB = "noName"] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(57, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(64, 32) + SourceIndex(0) +5 >Emitted(57, 17) Source(64, 58) + SourceIndex(0) +6 >Emitted(57, 19) Source(64, 32) + SourceIndex(0) +7 >Emitted(57, 26) Source(64, 33) + SourceIndex(0) +8 >Emitted(57, 37) Source(64, 44) + SourceIndex(0) +9 >Emitted(57, 39) Source(64, 46) + SourceIndex(0) +10>Emitted(57, 50) Source(64, 57) + SourceIndex(0) +11>Emitted(57, 51) Source(64, 58) + SourceIndex(0) +12>Emitted(57, 53) Source(64, 32) + SourceIndex(0) +13>Emitted(57, 69) Source(64, 58) + SourceIndex(0) +14>Emitted(57, 71) Source(64, 32) + SourceIndex(0) +15>Emitted(57, 76) Source(64, 58) + SourceIndex(0) +16>Emitted(57, 77) Source(64, 59) + SourceIndex(0) +--- +>>> var _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(58, 5) Source(64, 11) + SourceIndex(0) +2 >Emitted(58, 26) Source(64, 27) + SourceIndex(0) +3 >Emitted(58, 28) Source(64, 11) + SourceIndex(0) +4 >Emitted(58, 67) Source(64, 27) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(59, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(65, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(65, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(65, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(65, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(65, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(65, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(65, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(66, 2) + SourceIndex(0) +--- +>>>for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(61, 1) Source(68, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(68, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(68, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(68, 67) + SourceIndex(0) +5 >Emitted(61, 17) Source(68, 73) + SourceIndex(0) +6 >Emitted(61, 19) Source(68, 67) + SourceIndex(0) +7 >Emitted(61, 36) Source(68, 73) + SourceIndex(0) +8 >Emitted(61, 38) Source(68, 67) + SourceIndex(0) +9 >Emitted(61, 59) Source(68, 73) + SourceIndex(0) +10>Emitted(61, 61) Source(68, 67) + SourceIndex(0) +11>Emitted(61, 66) Source(68, 73) + SourceIndex(0) +12>Emitted(61, 67) Source(68, 74) + SourceIndex(0) +--- +>>> var _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(62, 5) Source(68, 6) + SourceIndex(0) +2 >Emitted(62, 28) Source(68, 63) + SourceIndex(0) +3 >Emitted(62, 30) Source(68, 11) + SourceIndex(0) +4 >Emitted(62, 42) Source(68, 24) + SourceIndex(0) +5 >Emitted(62, 44) Source(68, 11) + SourceIndex(0) +6 >Emitted(62, 80) Source(68, 24) + SourceIndex(0) +7 >Emitted(62, 82) Source(68, 26) + SourceIndex(0) +8 >Emitted(62, 94) Source(68, 43) + SourceIndex(0) +9 >Emitted(62, 96) Source(68, 26) + SourceIndex(0) +10>Emitted(62, 136) Source(68, 43) + SourceIndex(0) +11>Emitted(62, 138) Source(68, 45) + SourceIndex(0) +12>Emitted(62, 150) Source(68, 62) + SourceIndex(0) +13>Emitted(62, 152) Source(68, 45) + SourceIndex(0) +14>Emitted(62, 192) Source(68, 62) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(63, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(63, 23) Source(69, 23) + SourceIndex(0) +7 >Emitted(63, 24) Source(69, 24) + SourceIndex(0) +8 >Emitted(63, 25) Source(69, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(65, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(71, 67) + SourceIndex(0) +5 >Emitted(65, 17) Source(71, 78) + SourceIndex(0) +6 >Emitted(65, 19) Source(71, 67) + SourceIndex(0) +7 >Emitted(65, 25) Source(71, 67) + SourceIndex(0) +8 >Emitted(65, 34) Source(71, 76) + SourceIndex(0) +9 >Emitted(65, 36) Source(71, 78) + SourceIndex(0) +10>Emitted(65, 38) Source(71, 67) + SourceIndex(0) +11>Emitted(65, 54) Source(71, 78) + SourceIndex(0) +12>Emitted(65, 56) Source(71, 67) + SourceIndex(0) +13>Emitted(65, 61) Source(71, 78) + SourceIndex(0) +14>Emitted(65, 62) Source(71, 79) + SourceIndex(0) +--- +>>> var _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(66, 5) Source(71, 6) + SourceIndex(0) +2 >Emitted(66, 23) Source(71, 63) + SourceIndex(0) +3 >Emitted(66, 25) Source(71, 11) + SourceIndex(0) +4 >Emitted(66, 37) Source(71, 24) + SourceIndex(0) +5 >Emitted(66, 39) Source(71, 11) + SourceIndex(0) +6 >Emitted(66, 75) Source(71, 24) + SourceIndex(0) +7 >Emitted(66, 77) Source(71, 26) + SourceIndex(0) +8 >Emitted(66, 89) Source(71, 43) + SourceIndex(0) +9 >Emitted(66, 91) Source(71, 26) + SourceIndex(0) +10>Emitted(66, 131) Source(71, 43) + SourceIndex(0) +11>Emitted(66, 133) Source(71, 45) + SourceIndex(0) +12>Emitted(66, 145) Source(71, 62) + SourceIndex(0) +13>Emitted(66, 147) Source(71, 45) + SourceIndex(0) +14>Emitted(66, 187) Source(71, 62) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(72, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(72, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(72, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(72, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(72, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(72, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(72, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(72, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(73, 2) + SourceIndex(0) +--- +>>>for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(69, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(74, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(74, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(74, 67) + SourceIndex(0) +5 >Emitted(69, 17) Source(74, 83) + SourceIndex(0) +6 >Emitted(69, 19) Source(74, 67) + SourceIndex(0) +7 >Emitted(69, 26) Source(74, 68) + SourceIndex(0) +8 >Emitted(69, 32) Source(74, 74) + SourceIndex(0) +9 >Emitted(69, 34) Source(74, 76) + SourceIndex(0) +10>Emitted(69, 40) Source(74, 82) + SourceIndex(0) +11>Emitted(69, 41) Source(74, 83) + SourceIndex(0) +12>Emitted(69, 43) Source(74, 67) + SourceIndex(0) +13>Emitted(69, 59) Source(74, 83) + SourceIndex(0) +14>Emitted(69, 61) Source(74, 67) + SourceIndex(0) +15>Emitted(69, 66) Source(74, 83) + SourceIndex(0) +16>Emitted(69, 67) Source(74, 84) + SourceIndex(0) +--- +>>> var _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(70, 5) Source(74, 6) + SourceIndex(0) +2 >Emitted(70, 23) Source(74, 63) + SourceIndex(0) +3 >Emitted(70, 25) Source(74, 11) + SourceIndex(0) +4 >Emitted(70, 37) Source(74, 24) + SourceIndex(0) +5 >Emitted(70, 39) Source(74, 11) + SourceIndex(0) +6 >Emitted(70, 75) Source(74, 24) + SourceIndex(0) +7 >Emitted(70, 77) Source(74, 26) + SourceIndex(0) +8 >Emitted(70, 89) Source(74, 43) + SourceIndex(0) +9 >Emitted(70, 91) Source(74, 26) + SourceIndex(0) +10>Emitted(70, 131) Source(74, 43) + SourceIndex(0) +11>Emitted(70, 133) Source(74, 45) + SourceIndex(0) +12>Emitted(70, 145) Source(74, 62) + SourceIndex(0) +13>Emitted(70, 147) Source(74, 45) + SourceIndex(0) +14>Emitted(70, 187) Source(74, 62) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(75, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(75, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(75, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(75, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(75, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(75, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(75, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(75, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(76, 2) + SourceIndex(0) +--- +>>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(73, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(77, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(77, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(80, 30) + SourceIndex(0) +5 >Emitted(73, 17) Source(80, 41) + SourceIndex(0) +6 >Emitted(73, 19) Source(80, 30) + SourceIndex(0) +7 >Emitted(73, 46) Source(80, 41) + SourceIndex(0) +8 >Emitted(73, 48) Source(80, 30) + SourceIndex(0) +9 >Emitted(73, 74) Source(80, 41) + SourceIndex(0) +10>Emitted(73, 76) Source(80, 30) + SourceIndex(0) +11>Emitted(73, 81) Source(80, 41) + SourceIndex(0) +12>Emitted(73, 82) Source(80, 42) + SourceIndex(0) +--- +>>> var _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(74, 5) Source(77, 6) + SourceIndex(0) +2 >Emitted(74, 33) Source(80, 26) + SourceIndex(0) +3 >Emitted(74, 35) Source(77, 11) + SourceIndex(0) +4 >Emitted(74, 47) Source(77, 28) + SourceIndex(0) +5 >Emitted(74, 49) Source(77, 11) + SourceIndex(0) +6 >Emitted(74, 89) Source(77, 28) + SourceIndex(0) +7 >Emitted(74, 91) Source(77, 30) + SourceIndex(0) +8 >Emitted(74, 103) Source(80, 25) + SourceIndex(0) +9 >Emitted(74, 105) Source(77, 30) + SourceIndex(0) +10>Emitted(74, 154) Source(80, 25) + SourceIndex(0) +11>Emitted(74, 156) Source(78, 5) + SourceIndex(0) +12>Emitted(74, 168) Source(78, 30) + SourceIndex(0) +13>Emitted(74, 170) Source(78, 5) + SourceIndex(0) +14>Emitted(74, 218) Source(78, 30) + SourceIndex(0) +15>Emitted(74, 220) Source(79, 5) + SourceIndex(0) +16>Emitted(74, 232) Source(79, 34) + SourceIndex(0) +17>Emitted(74, 234) Source(79, 5) + SourceIndex(0) +18>Emitted(74, 286) Source(79, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(75, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(81, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(81, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(81, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(81, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(81, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(81, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(81, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(82, 2) + SourceIndex(0) +--- +>>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(77, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(83, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(83, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(86, 30) + SourceIndex(0) +5 >Emitted(77, 17) Source(86, 46) + SourceIndex(0) +6 >Emitted(77, 19) Source(86, 30) + SourceIndex(0) +7 >Emitted(77, 25) Source(86, 30) + SourceIndex(0) +8 >Emitted(77, 39) Source(86, 44) + SourceIndex(0) +9 >Emitted(77, 41) Source(86, 46) + SourceIndex(0) +10>Emitted(77, 43) Source(86, 30) + SourceIndex(0) +11>Emitted(77, 59) Source(86, 46) + SourceIndex(0) +12>Emitted(77, 61) Source(86, 30) + SourceIndex(0) +13>Emitted(77, 66) Source(86, 46) + SourceIndex(0) +14>Emitted(77, 67) Source(86, 47) + SourceIndex(0) +--- +>>> var _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(78, 5) Source(83, 6) + SourceIndex(0) +2 >Emitted(78, 23) Source(86, 26) + SourceIndex(0) +3 >Emitted(78, 25) Source(83, 11) + SourceIndex(0) +4 >Emitted(78, 37) Source(83, 28) + SourceIndex(0) +5 >Emitted(78, 39) Source(83, 11) + SourceIndex(0) +6 >Emitted(78, 79) Source(83, 28) + SourceIndex(0) +7 >Emitted(78, 81) Source(83, 30) + SourceIndex(0) +8 >Emitted(78, 93) Source(86, 25) + SourceIndex(0) +9 >Emitted(78, 95) Source(83, 30) + SourceIndex(0) +10>Emitted(78, 144) Source(86, 25) + SourceIndex(0) +11>Emitted(78, 146) Source(84, 5) + SourceIndex(0) +12>Emitted(78, 158) Source(84, 30) + SourceIndex(0) +13>Emitted(78, 160) Source(84, 5) + SourceIndex(0) +14>Emitted(78, 208) Source(84, 30) + SourceIndex(0) +15>Emitted(78, 210) Source(85, 5) + SourceIndex(0) +16>Emitted(78, 222) Source(85, 34) + SourceIndex(0) +17>Emitted(78, 224) Source(85, 5) + SourceIndex(0) +18>Emitted(78, 276) Source(85, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(87, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(87, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(87, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(87, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(87, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(87, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(87, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(88, 2) + SourceIndex(0) +--- +>>>for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(81, 1) Source(89, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(89, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(89, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(92, 30) + SourceIndex(0) +5 >Emitted(81, 17) Source(92, 56) + SourceIndex(0) +6 >Emitted(81, 19) Source(92, 30) + SourceIndex(0) +7 >Emitted(81, 26) Source(92, 31) + SourceIndex(0) +8 >Emitted(81, 37) Source(92, 42) + SourceIndex(0) +9 >Emitted(81, 39) Source(92, 44) + SourceIndex(0) +10>Emitted(81, 50) Source(92, 55) + SourceIndex(0) +11>Emitted(81, 51) Source(92, 56) + SourceIndex(0) +12>Emitted(81, 53) Source(92, 30) + SourceIndex(0) +13>Emitted(81, 69) Source(92, 56) + SourceIndex(0) +14>Emitted(81, 71) Source(92, 30) + SourceIndex(0) +15>Emitted(81, 76) Source(92, 56) + SourceIndex(0) +16>Emitted(81, 77) Source(92, 57) + SourceIndex(0) +--- +>>> var _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(82, 5) Source(89, 6) + SourceIndex(0) +2 >Emitted(82, 23) Source(92, 26) + SourceIndex(0) +3 >Emitted(82, 25) Source(89, 11) + SourceIndex(0) +4 >Emitted(82, 37) Source(89, 28) + SourceIndex(0) +5 >Emitted(82, 39) Source(89, 11) + SourceIndex(0) +6 >Emitted(82, 79) Source(89, 28) + SourceIndex(0) +7 >Emitted(82, 81) Source(89, 30) + SourceIndex(0) +8 >Emitted(82, 93) Source(92, 25) + SourceIndex(0) +9 >Emitted(82, 95) Source(89, 30) + SourceIndex(0) +10>Emitted(82, 144) Source(92, 25) + SourceIndex(0) +11>Emitted(82, 146) Source(90, 5) + SourceIndex(0) +12>Emitted(82, 158) Source(90, 30) + SourceIndex(0) +13>Emitted(82, 160) Source(90, 5) + SourceIndex(0) +14>Emitted(82, 208) Source(90, 30) + SourceIndex(0) +15>Emitted(82, 210) Source(91, 5) + SourceIndex(0) +16>Emitted(82, 222) Source(91, 34) + SourceIndex(0) +17>Emitted(82, 224) Source(91, 5) + SourceIndex(0) +18>Emitted(82, 276) Source(91, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(93, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(93, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(93, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(93, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(93, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(93, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(93, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(93, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(94, 2) + SourceIndex(0) +--- +>>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let [numberA3 = -1, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(85, 1) Source(96, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(96, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(96, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(96, 44) + SourceIndex(0) +5 >Emitted(85, 17) Source(96, 50) + SourceIndex(0) +6 >Emitted(85, 19) Source(96, 44) + SourceIndex(0) +7 >Emitted(85, 36) Source(96, 50) + SourceIndex(0) +8 >Emitted(85, 38) Source(96, 44) + SourceIndex(0) +9 >Emitted(85, 59) Source(96, 50) + SourceIndex(0) +10>Emitted(85, 61) Source(96, 44) + SourceIndex(0) +11>Emitted(85, 66) Source(96, 50) + SourceIndex(0) +12>Emitted(85, 67) Source(96, 51) + SourceIndex(0) +--- +>>> var _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(86, 5) Source(96, 6) + SourceIndex(0) +2 >Emitted(86, 28) Source(96, 40) + SourceIndex(0) +3 >Emitted(86, 30) Source(96, 11) + SourceIndex(0) +4 >Emitted(86, 42) Source(96, 24) + SourceIndex(0) +5 >Emitted(86, 44) Source(96, 11) + SourceIndex(0) +6 >Emitted(86, 80) Source(96, 24) + SourceIndex(0) +7 >Emitted(86, 82) Source(96, 26) + SourceIndex(0) +8 >Emitted(86, 107) Source(96, 39) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(87, 5) Source(97, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(97, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(97, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(97, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(97, 17) + SourceIndex(0) +6 >Emitted(87, 25) Source(97, 25) + SourceIndex(0) +7 >Emitted(87, 26) Source(97, 26) + SourceIndex(0) +8 >Emitted(87, 27) Source(97, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(98, 2) + SourceIndex(0) +--- +>>>for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3 = -1, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(89, 1) Source(99, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(99, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(99, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(99, 44) + SourceIndex(0) +5 >Emitted(89, 17) Source(99, 55) + SourceIndex(0) +6 >Emitted(89, 19) Source(99, 44) + SourceIndex(0) +7 >Emitted(89, 25) Source(99, 44) + SourceIndex(0) +8 >Emitted(89, 34) Source(99, 53) + SourceIndex(0) +9 >Emitted(89, 36) Source(99, 55) + SourceIndex(0) +10>Emitted(89, 38) Source(99, 44) + SourceIndex(0) +11>Emitted(89, 54) Source(99, 55) + SourceIndex(0) +12>Emitted(89, 56) Source(99, 44) + SourceIndex(0) +13>Emitted(89, 61) Source(99, 55) + SourceIndex(0) +14>Emitted(89, 62) Source(99, 56) + SourceIndex(0) +--- +>>> var _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(90, 5) Source(99, 6) + SourceIndex(0) +2 >Emitted(90, 23) Source(99, 40) + SourceIndex(0) +3 >Emitted(90, 25) Source(99, 11) + SourceIndex(0) +4 >Emitted(90, 37) Source(99, 24) + SourceIndex(0) +5 >Emitted(90, 39) Source(99, 11) + SourceIndex(0) +6 >Emitted(90, 75) Source(99, 24) + SourceIndex(0) +7 >Emitted(90, 77) Source(99, 26) + SourceIndex(0) +8 >Emitted(90, 102) Source(99, 39) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(100, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(100, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(100, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(100, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(100, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(100, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(100, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(100, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(101, 2) + SourceIndex(0) +--- +>>>for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let [numberA3 = -1, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(93, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(102, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(102, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(102, 44) + SourceIndex(0) +5 >Emitted(93, 17) Source(102, 60) + SourceIndex(0) +6 >Emitted(93, 19) Source(102, 44) + SourceIndex(0) +7 >Emitted(93, 26) Source(102, 45) + SourceIndex(0) +8 >Emitted(93, 32) Source(102, 51) + SourceIndex(0) +9 >Emitted(93, 34) Source(102, 53) + SourceIndex(0) +10>Emitted(93, 40) Source(102, 59) + SourceIndex(0) +11>Emitted(93, 41) Source(102, 60) + SourceIndex(0) +12>Emitted(93, 43) Source(102, 44) + SourceIndex(0) +13>Emitted(93, 59) Source(102, 60) + SourceIndex(0) +14>Emitted(93, 61) Source(102, 44) + SourceIndex(0) +15>Emitted(93, 66) Source(102, 60) + SourceIndex(0) +16>Emitted(93, 67) Source(102, 61) + SourceIndex(0) +--- +>>> var _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(94, 5) Source(102, 6) + SourceIndex(0) +2 >Emitted(94, 23) Source(102, 40) + SourceIndex(0) +3 >Emitted(94, 25) Source(102, 11) + SourceIndex(0) +4 >Emitted(94, 37) Source(102, 24) + SourceIndex(0) +5 >Emitted(94, 39) Source(102, 11) + SourceIndex(0) +6 >Emitted(94, 75) Source(102, 24) + SourceIndex(0) +7 >Emitted(94, 77) Source(102, 26) + SourceIndex(0) +8 >Emitted(94, 102) Source(102, 39) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(103, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(103, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(103, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(103, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(103, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(103, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(103, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(103, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(104, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..b398a8e6af5 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,325 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) +} + +for (let [, nameA = "noName"] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 20, 11)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 20, 11)) +} +for (let [, nameA = "noName"] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 23, 11)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 23, 11)) +} +for (let [, nameA = "noName"] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 26, 11)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 26, 11)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 29, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 30, 30)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 29, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 35, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 36, 30)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 35, 13)) +} +for (let [, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 41, 13)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 42, 30)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 41, 13)) +} + +for (let [numberB = -1] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 48, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 48, 10)) +} +for (let [numberB = -1] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 51, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 51, 10)) +} +for (let [numberB = -1] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 54, 10)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 54, 10)) +} +for (let [nameB = "noName"] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 57, 10)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 57, 10)) +} +for (let [nameB = "noName"] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 60, 10)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 60, 10)) +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 63, 10)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 63, 10)) +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 43)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 67, 24)) +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 43)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 70, 24)) +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 10)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 43)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 73, 24)) +} +for (let [nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 76, 10)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 76, 30)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 77, 30)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 76, 10)) +} +for (let [nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 82, 10)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 82, 30)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 83, 30)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 82, 10)) +} +for (let [nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 88, 10)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 88, 30)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 89, 30)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 88, 10)) +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 95, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 95, 24)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 95, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 98, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 98, 24)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 98, 10)) +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 101, 10)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 101, 24)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts, 101, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..488b5c46145 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types @@ -0,0 +1,452 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +for (let [, nameA = "noName"] of robots) { +> : undefined +>nameA : string +>"noName" : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "noName"] of getRobots()) { +> : undefined +>nameA : string +>"noName" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, nameA = "noName"] of [robotA, robotB]) { +> : undefined +>nameA : string +>"noName" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for (let [, [ +> : undefined + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for (let [numberB = -1] of robots) { +>numberB : number +>-1 : number +>1 : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] of getRobots()) { +>numberB : number +>-1 : number +>1 : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [numberB = -1] of [robotA, robotB]) { +>numberB : number +>-1 : number +>1 : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for (let [nameB = "noName"] of multiRobots) { +>nameB : string +>"noName" : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "noName"] of getMultiRobots()) { +>nameB : string +>"noName" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { +>nameB : string +>"noName" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"skill" : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"skill" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"skill" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for (let [nameMA = "noName", [ +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", [ +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for (let [nameMA = "noName", [ +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..9cff7412ea9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js @@ -0,0 +1,214 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA = "noName"] of robots) { + console.log(nameA); +} +for ([, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for ([, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB = -1] of robots) { + console.log(numberB); +} +for ([numberB = -1] of getRobots()) { + console.log(numberB); +} +for ([numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for ([nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} + +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var robots = [robotA, robotB]; +function getRobots() { + return robots; +} +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} +var nameA, primarySkillA, secondarySkillA; +var numberB, nameB; +var numberA2, nameA2, skillA2, nameMA; +var numberA3, robotAInfo, multiRobotAInfo; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; + console.log(nameA); +} +for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { + _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; + console.log(nameA); +} +for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { + _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; + console.log(nameA); +} +for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { + _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; + console.log(primarySkillA); +} +for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { + _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; + console.log(primarySkillA); +} +for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { + _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; + console.log(primarySkillA); +} +for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { + _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; + console.log(numberB); +} +for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { + _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; + console.log(numberB); +} +for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { + _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; + console.log(numberB); +} +for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { + _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; + console.log(nameB); +} +for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { + _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; + console.log(nameB); +} +for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { + _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; + console.log(nameB); +} +for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { + _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; + console.log(nameA2); +} +for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { + _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; + console.log(nameA2); +} +for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { + _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; + console.log(nameA2); +} +for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { + _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; + console.log(nameMA); +} +for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { + _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; + console.log(nameMA); +} +for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { + _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; + console.log(nameMA); +} +for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { + _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); + console.log(numberA3); +} +for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { + _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); + console.log(numberA3); +} +for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { + _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); + console.log(numberA3); +} +var _a, _b, _e, _f, _j, _k, _m, _o, _p, _q, _r, _u, _v, _w, _x, _y, _1, _2, _3, _4, _5, _7, _10, _13, _15, _18, _21, _23, _24, _25, _26, _29, _30, _31, _32, _35, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _67, _68, _71, _72; +//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..ccee72c33bf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,GAAG,CAAC,CAAyB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA/B,iBAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAApC,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAAzC,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAGyB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAHpC,sBAGoB,EAHjB,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAHzC,WAGoB,EAHjB,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B,CAAC;IAHnD,WAGoB,EAHjB,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAmB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,oBAAY,EAAZ,iCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAmB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,eAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAmB,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAlC,iBAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAjC,2BAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAtC,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAAhD,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA0D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAhE,mBAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA0D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAArE,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA0D,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA1E,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAHpC,wBAGoB,EAHnB,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAHzC,cAGoB,EAHnB,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B,CAAC;IAHnD,cAGoB,EAHnB,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAmC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAzC,mBAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAmC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAA9C,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAmC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAnD,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..dc11eb52da9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,2853 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >let +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >let +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var robots = [robotA, robotB]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > robots +4 > = +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> ; +1 >Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(9, 14) + SourceIndex(0) +5 >Emitted(3, 15) Source(9, 15) + SourceIndex(0) +6 >Emitted(3, 21) Source(9, 21) + SourceIndex(0) +7 >Emitted(3, 23) Source(9, 23) + SourceIndex(0) +8 >Emitted(3, 29) Source(9, 29) + SourceIndex(0) +9 >Emitted(3, 30) Source(9, 30) + SourceIndex(0) +10>Emitted(3, 31) Source(9, 31) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(4, 1) Source(10, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(12, 2) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > + > +2 >let +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(14, 16) + SourceIndex(0) +4 >Emitted(7, 19) Source(14, 38) + SourceIndex(0) +5 >Emitted(7, 20) Source(14, 39) + SourceIndex(0) +6 >Emitted(7, 27) Source(14, 46) + SourceIndex(0) +7 >Emitted(7, 29) Source(14, 48) + SourceIndex(0) +8 >Emitted(7, 30) Source(14, 49) + SourceIndex(0) +9 >Emitted(7, 38) Source(14, 57) + SourceIndex(0) +10>Emitted(7, 40) Source(14, 59) + SourceIndex(0) +11>Emitted(7, 42) Source(14, 61) + SourceIndex(0) +12>Emitted(7, 43) Source(14, 62) + SourceIndex(0) +13>Emitted(7, 44) Source(14, 63) + SourceIndex(0) +14>Emitted(7, 45) Source(14, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >let +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +4 >Emitted(8, 19) Source(15, 38) + SourceIndex(0) +5 >Emitted(8, 20) Source(15, 39) + SourceIndex(0) +6 >Emitted(8, 29) Source(15, 48) + SourceIndex(0) +7 >Emitted(8, 31) Source(15, 50) + SourceIndex(0) +8 >Emitted(8, 32) Source(15, 51) + SourceIndex(0) +9 >Emitted(8, 42) Source(15, 61) + SourceIndex(0) +10>Emitted(8, 44) Source(15, 63) + SourceIndex(0) +11>Emitted(8, 52) Source(15, 71) + SourceIndex(0) +12>Emitted(8, 53) Source(15, 72) + SourceIndex(0) +13>Emitted(8, 54) Source(15, 73) + SourceIndex(0) +14>Emitted(8, 55) Source(15, 74) + SourceIndex(0) +--- +>>>var multiRobots = [multiRobotA, multiRobotB]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^ +1 > + > +2 >let +3 > multiRobots +4 > = +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> ; +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(9, 19) Source(16, 19) + SourceIndex(0) +5 >Emitted(9, 20) Source(16, 20) + SourceIndex(0) +6 >Emitted(9, 31) Source(16, 31) + SourceIndex(0) +7 >Emitted(9, 33) Source(16, 33) + SourceIndex(0) +8 >Emitted(9, 44) Source(16, 44) + SourceIndex(0) +9 >Emitted(9, 45) Source(16, 45) + SourceIndex(0) +10>Emitted(9, 46) Source(16, 46) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) +3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>var nameA, primarySkillA, secondarySkillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primarySkillA: string +6 > , +7 > secondarySkillA: string +8 > ; +1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(13, 10) Source(21, 18) + SourceIndex(0) +4 >Emitted(13, 12) Source(21, 20) + SourceIndex(0) +5 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) +6 >Emitted(13, 27) Source(21, 43) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 66) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 67) + SourceIndex(0) +--- +>>>var numberB, nameB; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > numberB: number +4 > , +5 > nameB: string +6 > ; +1 >Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 12) Source(22, 20) + SourceIndex(0) +4 >Emitted(14, 14) Source(22, 22) + SourceIndex(0) +5 >Emitted(14, 19) Source(22, 35) + SourceIndex(0) +6 >Emitted(14, 20) Source(22, 36) + SourceIndex(0) +--- +>>>var numberA2, nameA2, skillA2, nameMA; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +11> ^^^^^-> +1-> + > +2 >let +3 > numberA2: number +4 > , +5 > nameA2: string +6 > , +7 > skillA2: string +8 > , +9 > nameMA: string +10> ; +1->Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(15, 13) Source(23, 21) + SourceIndex(0) +4 >Emitted(15, 15) Source(23, 23) + SourceIndex(0) +5 >Emitted(15, 21) Source(23, 37) + SourceIndex(0) +6 >Emitted(15, 23) Source(23, 39) + SourceIndex(0) +7 >Emitted(15, 30) Source(23, 54) + SourceIndex(0) +8 >Emitted(15, 32) Source(23, 56) + SourceIndex(0) +9 >Emitted(15, 38) Source(23, 70) + SourceIndex(0) +10>Emitted(15, 39) Source(23, 71) + SourceIndex(0) +--- +>>>var numberA3, robotAInfo, multiRobotAInfo; +1-> +2 >^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >let +3 > numberA3: number +4 > , +5 > robotAInfo: (number | string)[] +6 > , +7 > multiRobotAInfo: (string | [string, string])[] +8 > ; +1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(16, 13) Source(24, 21) + SourceIndex(0) +4 >Emitted(16, 15) Source(24, 23) + SourceIndex(0) +5 >Emitted(16, 25) Source(24, 54) + SourceIndex(0) +6 >Emitted(16, 27) Source(24, 56) + SourceIndex(0) +7 >Emitted(16, 42) Source(24, 102) + SourceIndex(0) +8 >Emitted(16, 43) Source(24, 103) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([, nameA = "noName"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 4) Source(26, 4) + SourceIndex(0) +3 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) +4 >Emitted(17, 6) Source(26, 30) + SourceIndex(0) +5 >Emitted(17, 16) Source(26, 36) + SourceIndex(0) +6 >Emitted(17, 18) Source(26, 30) + SourceIndex(0) +7 >Emitted(17, 35) Source(26, 36) + SourceIndex(0) +8 >Emitted(17, 37) Source(26, 30) + SourceIndex(0) +9 >Emitted(17, 57) Source(26, 36) + SourceIndex(0) +10>Emitted(17, 59) Source(26, 30) + SourceIndex(0) +11>Emitted(17, 63) Source(26, 36) + SourceIndex(0) +12>Emitted(17, 64) Source(26, 37) + SourceIndex(0) +--- +>>> _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(18, 5) Source(26, 6) + SourceIndex(0) +2 >Emitted(18, 22) Source(26, 26) + SourceIndex(0) +3 >Emitted(18, 24) Source(26, 9) + SourceIndex(0) +4 >Emitted(18, 34) Source(26, 25) + SourceIndex(0) +5 >Emitted(18, 36) Source(26, 9) + SourceIndex(0) +6 >Emitted(18, 73) Source(26, 25) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +2 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +3 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +4 >Emitted(19, 16) Source(27, 16) + SourceIndex(0) +5 >Emitted(19, 17) Source(27, 17) + SourceIndex(0) +6 >Emitted(19, 22) Source(27, 22) + SourceIndex(0) +7 >Emitted(19, 23) Source(27, 23) + SourceIndex(0) +8 >Emitted(19, 24) Source(27, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(20, 2) Source(28, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, nameA = "noName"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(21, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(21, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(21, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(21, 6) Source(29, 30) + SourceIndex(0) +5 >Emitted(21, 16) Source(29, 41) + SourceIndex(0) +6 >Emitted(21, 18) Source(29, 30) + SourceIndex(0) +7 >Emitted(21, 23) Source(29, 30) + SourceIndex(0) +8 >Emitted(21, 32) Source(29, 39) + SourceIndex(0) +9 >Emitted(21, 34) Source(29, 41) + SourceIndex(0) +10>Emitted(21, 36) Source(29, 30) + SourceIndex(0) +11>Emitted(21, 50) Source(29, 41) + SourceIndex(0) +12>Emitted(21, 52) Source(29, 30) + SourceIndex(0) +13>Emitted(21, 56) Source(29, 41) + SourceIndex(0) +14>Emitted(21, 57) Source(29, 42) + SourceIndex(0) +--- +>>> _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(22, 5) Source(29, 6) + SourceIndex(0) +2 >Emitted(22, 16) Source(29, 26) + SourceIndex(0) +3 >Emitted(22, 18) Source(29, 9) + SourceIndex(0) +4 >Emitted(22, 28) Source(29, 25) + SourceIndex(0) +5 >Emitted(22, 30) Source(29, 9) + SourceIndex(0) +6 >Emitted(22, 67) Source(29, 25) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(23, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(23, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(23, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(23, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(23, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(23, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(23, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(24, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, nameA = "noName"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(25, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(25, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(25, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(25, 6) Source(32, 30) + SourceIndex(0) +5 >Emitted(25, 16) Source(32, 46) + SourceIndex(0) +6 >Emitted(25, 18) Source(32, 30) + SourceIndex(0) +7 >Emitted(25, 24) Source(32, 31) + SourceIndex(0) +8 >Emitted(25, 30) Source(32, 37) + SourceIndex(0) +9 >Emitted(25, 32) Source(32, 39) + SourceIndex(0) +10>Emitted(25, 38) Source(32, 45) + SourceIndex(0) +11>Emitted(25, 39) Source(32, 46) + SourceIndex(0) +12>Emitted(25, 41) Source(32, 30) + SourceIndex(0) +13>Emitted(25, 55) Source(32, 46) + SourceIndex(0) +14>Emitted(25, 57) Source(32, 30) + SourceIndex(0) +15>Emitted(25, 61) Source(32, 46) + SourceIndex(0) +16>Emitted(25, 62) Source(32, 47) + SourceIndex(0) +--- +>>> _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(26, 5) Source(32, 6) + SourceIndex(0) +2 >Emitted(26, 16) Source(32, 26) + SourceIndex(0) +3 >Emitted(26, 18) Source(32, 9) + SourceIndex(0) +4 >Emitted(26, 28) Source(32, 25) + SourceIndex(0) +5 >Emitted(26, 30) Source(32, 9) + SourceIndex(0) +6 >Emitted(26, 67) Source(32, 25) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(27, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(27, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(27, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(27, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(27, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(27, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(27, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(27, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(28, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(29, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(29, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(29, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(29, 6) Source(38, 30) + SourceIndex(0) +5 >Emitted(29, 16) Source(38, 41) + SourceIndex(0) +6 >Emitted(29, 18) Source(38, 30) + SourceIndex(0) +7 >Emitted(29, 45) Source(38, 41) + SourceIndex(0) +8 >Emitted(29, 47) Source(38, 30) + SourceIndex(0) +9 >Emitted(29, 72) Source(38, 41) + SourceIndex(0) +10>Emitted(29, 74) Source(38, 30) + SourceIndex(0) +11>Emitted(29, 78) Source(38, 41) + SourceIndex(0) +12>Emitted(29, 79) Source(38, 42) + SourceIndex(0) +--- +>>> _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(30, 5) Source(35, 6) + SourceIndex(0) +2 >Emitted(30, 27) Source(38, 26) + SourceIndex(0) +3 >Emitted(30, 29) Source(35, 9) + SourceIndex(0) +4 >Emitted(30, 39) Source(38, 25) + SourceIndex(0) +5 >Emitted(30, 41) Source(35, 9) + SourceIndex(0) +6 >Emitted(30, 87) Source(38, 25) + SourceIndex(0) +7 >Emitted(30, 89) Source(36, 5) + SourceIndex(0) +8 >Emitted(30, 99) Source(36, 30) + SourceIndex(0) +9 >Emitted(30, 101) Source(36, 5) + SourceIndex(0) +10>Emitted(30, 147) Source(36, 30) + SourceIndex(0) +11>Emitted(30, 149) Source(37, 5) + SourceIndex(0) +12>Emitted(30, 159) Source(37, 34) + SourceIndex(0) +13>Emitted(30, 161) Source(37, 5) + SourceIndex(0) +14>Emitted(30, 211) Source(37, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(31, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(31, 30) Source(39, 30) + SourceIndex(0) +7 >Emitted(31, 31) Source(39, 31) + SourceIndex(0) +8 >Emitted(31, 32) Source(39, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(32, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(33, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(33, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(33, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(33, 6) Source(44, 30) + SourceIndex(0) +5 >Emitted(33, 16) Source(44, 46) + SourceIndex(0) +6 >Emitted(33, 18) Source(44, 30) + SourceIndex(0) +7 >Emitted(33, 23) Source(44, 30) + SourceIndex(0) +8 >Emitted(33, 37) Source(44, 44) + SourceIndex(0) +9 >Emitted(33, 39) Source(44, 46) + SourceIndex(0) +10>Emitted(33, 41) Source(44, 30) + SourceIndex(0) +11>Emitted(33, 55) Source(44, 46) + SourceIndex(0) +12>Emitted(33, 57) Source(44, 30) + SourceIndex(0) +13>Emitted(33, 61) Source(44, 46) + SourceIndex(0) +14>Emitted(33, 62) Source(44, 47) + SourceIndex(0) +--- +>>> _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(34, 5) Source(41, 6) + SourceIndex(0) +2 >Emitted(34, 16) Source(44, 26) + SourceIndex(0) +3 >Emitted(34, 18) Source(41, 9) + SourceIndex(0) +4 >Emitted(34, 28) Source(44, 25) + SourceIndex(0) +5 >Emitted(34, 30) Source(41, 9) + SourceIndex(0) +6 >Emitted(34, 76) Source(44, 25) + SourceIndex(0) +7 >Emitted(34, 78) Source(42, 5) + SourceIndex(0) +8 >Emitted(34, 88) Source(42, 30) + SourceIndex(0) +9 >Emitted(34, 90) Source(42, 5) + SourceIndex(0) +10>Emitted(34, 136) Source(42, 30) + SourceIndex(0) +11>Emitted(34, 138) Source(43, 5) + SourceIndex(0) +12>Emitted(34, 148) Source(43, 34) + SourceIndex(0) +13>Emitted(34, 150) Source(43, 5) + SourceIndex(0) +14>Emitted(34, 200) Source(43, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(45, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(45, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(45, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(45, 17) + SourceIndex(0) +6 >Emitted(35, 30) Source(45, 30) + SourceIndex(0) +7 >Emitted(35, 31) Source(45, 31) + SourceIndex(0) +8 >Emitted(35, 32) Source(45, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(46, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(37, 1) Source(47, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(47, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(47, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(50, 30) + SourceIndex(0) +5 >Emitted(37, 16) Source(50, 56) + SourceIndex(0) +6 >Emitted(37, 18) Source(50, 30) + SourceIndex(0) +7 >Emitted(37, 24) Source(50, 31) + SourceIndex(0) +8 >Emitted(37, 35) Source(50, 42) + SourceIndex(0) +9 >Emitted(37, 37) Source(50, 44) + SourceIndex(0) +10>Emitted(37, 48) Source(50, 55) + SourceIndex(0) +11>Emitted(37, 49) Source(50, 56) + SourceIndex(0) +12>Emitted(37, 51) Source(50, 30) + SourceIndex(0) +13>Emitted(37, 65) Source(50, 56) + SourceIndex(0) +14>Emitted(37, 67) Source(50, 30) + SourceIndex(0) +15>Emitted(37, 71) Source(50, 56) + SourceIndex(0) +16>Emitted(37, 72) Source(50, 57) + SourceIndex(0) +--- +>>> _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; +1->^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +5 > +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , + > +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +1->Emitted(38, 5) Source(47, 6) + SourceIndex(0) +2 >Emitted(38, 16) Source(50, 26) + SourceIndex(0) +3 >Emitted(38, 18) Source(47, 9) + SourceIndex(0) +4 >Emitted(38, 28) Source(50, 25) + SourceIndex(0) +5 >Emitted(38, 30) Source(47, 9) + SourceIndex(0) +6 >Emitted(38, 76) Source(50, 25) + SourceIndex(0) +7 >Emitted(38, 78) Source(48, 5) + SourceIndex(0) +8 >Emitted(38, 88) Source(48, 30) + SourceIndex(0) +9 >Emitted(38, 90) Source(48, 5) + SourceIndex(0) +10>Emitted(38, 136) Source(48, 30) + SourceIndex(0) +11>Emitted(38, 138) Source(49, 5) + SourceIndex(0) +12>Emitted(38, 148) Source(49, 34) + SourceIndex(0) +13>Emitted(38, 150) Source(49, 5) + SourceIndex(0) +14>Emitted(38, 200) Source(49, 34) + SourceIndex(0) +--- +>>> console.log(primarySkillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primarySkillA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(51, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(51, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(51, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(51, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(51, 17) + SourceIndex(0) +6 >Emitted(39, 30) Source(51, 30) + SourceIndex(0) +7 >Emitted(39, 31) Source(51, 31) + SourceIndex(0) +8 >Emitted(39, 32) Source(51, 32) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(52, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ([numberB = -1] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(41, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(54, 24) + SourceIndex(0) +5 >Emitted(41, 16) Source(54, 30) + SourceIndex(0) +6 >Emitted(41, 18) Source(54, 24) + SourceIndex(0) +7 >Emitted(41, 35) Source(54, 30) + SourceIndex(0) +8 >Emitted(41, 37) Source(54, 24) + SourceIndex(0) +9 >Emitted(41, 57) Source(54, 30) + SourceIndex(0) +10>Emitted(41, 59) Source(54, 24) + SourceIndex(0) +11>Emitted(41, 63) Source(54, 30) + SourceIndex(0) +12>Emitted(41, 64) Source(54, 31) + SourceIndex(0) +--- +>>> _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB = -1 +3 > +4 > numberB = -1 +1 >Emitted(42, 5) Source(54, 7) + SourceIndex(0) +2 >Emitted(42, 25) Source(54, 19) + SourceIndex(0) +3 >Emitted(42, 27) Source(54, 7) + SourceIndex(0) +4 >Emitted(42, 60) Source(54, 19) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(43, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(55, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(55, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(55, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(55, 17) + SourceIndex(0) +6 >Emitted(43, 24) Source(55, 24) + SourceIndex(0) +7 >Emitted(43, 25) Source(55, 25) + SourceIndex(0) +8 >Emitted(43, 26) Source(55, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(56, 2) + SourceIndex(0) +--- +>>>for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^-> +1-> + > +2 >for +3 > +4 > ([numberB = -1] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(45, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(57, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(57, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(57, 24) + SourceIndex(0) +5 >Emitted(45, 16) Source(57, 35) + SourceIndex(0) +6 >Emitted(45, 18) Source(57, 24) + SourceIndex(0) +7 >Emitted(45, 23) Source(57, 24) + SourceIndex(0) +8 >Emitted(45, 32) Source(57, 33) + SourceIndex(0) +9 >Emitted(45, 34) Source(57, 35) + SourceIndex(0) +10>Emitted(45, 36) Source(57, 24) + SourceIndex(0) +11>Emitted(45, 50) Source(57, 35) + SourceIndex(0) +12>Emitted(45, 52) Source(57, 24) + SourceIndex(0) +13>Emitted(45, 56) Source(57, 35) + SourceIndex(0) +14>Emitted(45, 57) Source(57, 36) + SourceIndex(0) +--- +>>> _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(46, 5) Source(57, 7) + SourceIndex(0) +2 >Emitted(46, 20) Source(57, 19) + SourceIndex(0) +3 >Emitted(46, 22) Source(57, 7) + SourceIndex(0) +4 >Emitted(46, 57) Source(57, 19) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(47, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(47, 24) Source(58, 24) + SourceIndex(0) +7 >Emitted(47, 25) Source(58, 25) + SourceIndex(0) +8 >Emitted(47, 26) Source(58, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([numberB = -1] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(49, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(60, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(60, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(60, 24) + SourceIndex(0) +5 >Emitted(49, 17) Source(60, 40) + SourceIndex(0) +6 >Emitted(49, 19) Source(60, 24) + SourceIndex(0) +7 >Emitted(49, 26) Source(60, 25) + SourceIndex(0) +8 >Emitted(49, 32) Source(60, 31) + SourceIndex(0) +9 >Emitted(49, 34) Source(60, 33) + SourceIndex(0) +10>Emitted(49, 40) Source(60, 39) + SourceIndex(0) +11>Emitted(49, 41) Source(60, 40) + SourceIndex(0) +12>Emitted(49, 43) Source(60, 24) + SourceIndex(0) +13>Emitted(49, 59) Source(60, 40) + SourceIndex(0) +14>Emitted(49, 61) Source(60, 24) + SourceIndex(0) +15>Emitted(49, 66) Source(60, 40) + SourceIndex(0) +16>Emitted(49, 67) Source(60, 41) + SourceIndex(0) +--- +>>> _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > numberB = -1 +3 > +4 > numberB = -1 +1 >Emitted(50, 5) Source(60, 7) + SourceIndex(0) +2 >Emitted(50, 22) Source(60, 19) + SourceIndex(0) +3 >Emitted(50, 24) Source(60, 7) + SourceIndex(0) +4 >Emitted(50, 59) Source(60, 19) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(51, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(51, 24) Source(61, 24) + SourceIndex(0) +7 >Emitted(51, 25) Source(61, 25) + SourceIndex(0) +8 >Emitted(51, 26) Source(61, 26) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ([nameB = "noName"] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(53, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(63, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(63, 28) + SourceIndex(0) +5 >Emitted(53, 17) Source(63, 39) + SourceIndex(0) +6 >Emitted(53, 19) Source(63, 28) + SourceIndex(0) +7 >Emitted(53, 46) Source(63, 39) + SourceIndex(0) +8 >Emitted(53, 48) Source(63, 28) + SourceIndex(0) +9 >Emitted(53, 74) Source(63, 39) + SourceIndex(0) +10>Emitted(53, 76) Source(63, 28) + SourceIndex(0) +11>Emitted(53, 81) Source(63, 39) + SourceIndex(0) +12>Emitted(53, 82) Source(63, 40) + SourceIndex(0) +--- +>>> _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(54, 5) Source(63, 7) + SourceIndex(0) +2 >Emitted(54, 32) Source(63, 23) + SourceIndex(0) +3 >Emitted(54, 34) Source(63, 7) + SourceIndex(0) +4 >Emitted(54, 73) Source(63, 23) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(55, 5) Source(64, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(64, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(64, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(64, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(64, 17) + SourceIndex(0) +6 >Emitted(55, 22) Source(64, 22) + SourceIndex(0) +7 >Emitted(55, 23) Source(64, 23) + SourceIndex(0) +8 >Emitted(55, 24) Source(64, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(65, 2) + SourceIndex(0) +--- +>>>for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ([nameB = "noName"] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(57, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(66, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(66, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(66, 28) + SourceIndex(0) +5 >Emitted(57, 17) Source(66, 44) + SourceIndex(0) +6 >Emitted(57, 19) Source(66, 28) + SourceIndex(0) +7 >Emitted(57, 25) Source(66, 28) + SourceIndex(0) +8 >Emitted(57, 39) Source(66, 42) + SourceIndex(0) +9 >Emitted(57, 41) Source(66, 44) + SourceIndex(0) +10>Emitted(57, 43) Source(66, 28) + SourceIndex(0) +11>Emitted(57, 59) Source(66, 44) + SourceIndex(0) +12>Emitted(57, 61) Source(66, 28) + SourceIndex(0) +13>Emitted(57, 66) Source(66, 44) + SourceIndex(0) +14>Emitted(57, 67) Source(66, 45) + SourceIndex(0) +--- +>>> _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(58, 5) Source(66, 7) + SourceIndex(0) +2 >Emitted(58, 22) Source(66, 23) + SourceIndex(0) +3 >Emitted(58, 24) Source(66, 7) + SourceIndex(0) +4 >Emitted(58, 63) Source(66, 23) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(59, 5) Source(67, 5) + SourceIndex(0) +2 >Emitted(59, 12) Source(67, 12) + SourceIndex(0) +3 >Emitted(59, 13) Source(67, 13) + SourceIndex(0) +4 >Emitted(59, 16) Source(67, 16) + SourceIndex(0) +5 >Emitted(59, 17) Source(67, 17) + SourceIndex(0) +6 >Emitted(59, 22) Source(67, 22) + SourceIndex(0) +7 >Emitted(59, 23) Source(67, 23) + SourceIndex(0) +8 >Emitted(59, 24) Source(67, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(60, 2) Source(68, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +1-> + > +2 >for +3 > +4 > ([nameB = "noName"] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(61, 1) Source(69, 1) + SourceIndex(0) +2 >Emitted(61, 4) Source(69, 4) + SourceIndex(0) +3 >Emitted(61, 5) Source(69, 5) + SourceIndex(0) +4 >Emitted(61, 6) Source(69, 28) + SourceIndex(0) +5 >Emitted(61, 17) Source(69, 54) + SourceIndex(0) +6 >Emitted(61, 19) Source(69, 28) + SourceIndex(0) +7 >Emitted(61, 26) Source(69, 29) + SourceIndex(0) +8 >Emitted(61, 37) Source(69, 40) + SourceIndex(0) +9 >Emitted(61, 39) Source(69, 42) + SourceIndex(0) +10>Emitted(61, 50) Source(69, 53) + SourceIndex(0) +11>Emitted(61, 51) Source(69, 54) + SourceIndex(0) +12>Emitted(61, 53) Source(69, 28) + SourceIndex(0) +13>Emitted(61, 69) Source(69, 54) + SourceIndex(0) +14>Emitted(61, 71) Source(69, 28) + SourceIndex(0) +15>Emitted(61, 76) Source(69, 54) + SourceIndex(0) +16>Emitted(61, 77) Source(69, 55) + SourceIndex(0) +--- +>>> _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > nameB = "noName" +3 > +4 > nameB = "noName" +1 >Emitted(62, 5) Source(69, 7) + SourceIndex(0) +2 >Emitted(62, 22) Source(69, 23) + SourceIndex(0) +3 >Emitted(62, 24) Source(69, 7) + SourceIndex(0) +4 >Emitted(62, 63) Source(69, 23) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(63, 5) Source(70, 5) + SourceIndex(0) +2 >Emitted(63, 12) Source(70, 12) + SourceIndex(0) +3 >Emitted(63, 13) Source(70, 13) + SourceIndex(0) +4 >Emitted(63, 16) Source(70, 16) + SourceIndex(0) +5 >Emitted(63, 17) Source(70, 17) + SourceIndex(0) +6 >Emitted(63, 22) Source(70, 22) + SourceIndex(0) +7 >Emitted(63, 23) Source(70, 23) + SourceIndex(0) +8 >Emitted(63, 24) Source(70, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(64, 2) Source(71, 2) + SourceIndex(0) +--- +>>>for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(65, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(65, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(65, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(65, 6) Source(73, 63) + SourceIndex(0) +5 >Emitted(65, 17) Source(73, 69) + SourceIndex(0) +6 >Emitted(65, 19) Source(73, 63) + SourceIndex(0) +7 >Emitted(65, 36) Source(73, 69) + SourceIndex(0) +8 >Emitted(65, 38) Source(73, 63) + SourceIndex(0) +9 >Emitted(65, 59) Source(73, 69) + SourceIndex(0) +10>Emitted(65, 61) Source(73, 63) + SourceIndex(0) +11>Emitted(65, 66) Source(73, 69) + SourceIndex(0) +12>Emitted(65, 67) Source(73, 70) + SourceIndex(0) +--- +>>> _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(66, 5) Source(73, 6) + SourceIndex(0) +2 >Emitted(66, 24) Source(73, 59) + SourceIndex(0) +3 >Emitted(66, 26) Source(73, 7) + SourceIndex(0) +4 >Emitted(66, 38) Source(73, 20) + SourceIndex(0) +5 >Emitted(66, 40) Source(73, 7) + SourceIndex(0) +6 >Emitted(66, 76) Source(73, 20) + SourceIndex(0) +7 >Emitted(66, 78) Source(73, 22) + SourceIndex(0) +8 >Emitted(66, 90) Source(73, 39) + SourceIndex(0) +9 >Emitted(66, 92) Source(73, 22) + SourceIndex(0) +10>Emitted(66, 132) Source(73, 39) + SourceIndex(0) +11>Emitted(66, 134) Source(73, 41) + SourceIndex(0) +12>Emitted(66, 146) Source(73, 58) + SourceIndex(0) +13>Emitted(66, 148) Source(73, 41) + SourceIndex(0) +14>Emitted(66, 188) Source(73, 58) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(67, 5) Source(74, 5) + SourceIndex(0) +2 >Emitted(67, 12) Source(74, 12) + SourceIndex(0) +3 >Emitted(67, 13) Source(74, 13) + SourceIndex(0) +4 >Emitted(67, 16) Source(74, 16) + SourceIndex(0) +5 >Emitted(67, 17) Source(74, 17) + SourceIndex(0) +6 >Emitted(67, 23) Source(74, 23) + SourceIndex(0) +7 >Emitted(67, 24) Source(74, 24) + SourceIndex(0) +8 >Emitted(67, 25) Source(74, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(68, 2) Source(75, 2) + SourceIndex(0) +--- +>>>for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(69, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(69, 4) Source(76, 4) + SourceIndex(0) +3 >Emitted(69, 5) Source(76, 5) + SourceIndex(0) +4 >Emitted(69, 6) Source(76, 63) + SourceIndex(0) +5 >Emitted(69, 17) Source(76, 74) + SourceIndex(0) +6 >Emitted(69, 19) Source(76, 63) + SourceIndex(0) +7 >Emitted(69, 25) Source(76, 63) + SourceIndex(0) +8 >Emitted(69, 34) Source(76, 72) + SourceIndex(0) +9 >Emitted(69, 36) Source(76, 74) + SourceIndex(0) +10>Emitted(69, 38) Source(76, 63) + SourceIndex(0) +11>Emitted(69, 54) Source(76, 74) + SourceIndex(0) +12>Emitted(69, 56) Source(76, 63) + SourceIndex(0) +13>Emitted(69, 61) Source(76, 74) + SourceIndex(0) +14>Emitted(69, 62) Source(76, 75) + SourceIndex(0) +--- +>>> _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(70, 5) Source(76, 6) + SourceIndex(0) +2 >Emitted(70, 19) Source(76, 59) + SourceIndex(0) +3 >Emitted(70, 21) Source(76, 7) + SourceIndex(0) +4 >Emitted(70, 33) Source(76, 20) + SourceIndex(0) +5 >Emitted(70, 35) Source(76, 7) + SourceIndex(0) +6 >Emitted(70, 71) Source(76, 20) + SourceIndex(0) +7 >Emitted(70, 73) Source(76, 22) + SourceIndex(0) +8 >Emitted(70, 85) Source(76, 39) + SourceIndex(0) +9 >Emitted(70, 87) Source(76, 22) + SourceIndex(0) +10>Emitted(70, 127) Source(76, 39) + SourceIndex(0) +11>Emitted(70, 129) Source(76, 41) + SourceIndex(0) +12>Emitted(70, 141) Source(76, 58) + SourceIndex(0) +13>Emitted(70, 143) Source(76, 41) + SourceIndex(0) +14>Emitted(70, 183) Source(76, 58) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(71, 5) Source(77, 5) + SourceIndex(0) +2 >Emitted(71, 12) Source(77, 12) + SourceIndex(0) +3 >Emitted(71, 13) Source(77, 13) + SourceIndex(0) +4 >Emitted(71, 16) Source(77, 16) + SourceIndex(0) +5 >Emitted(71, 17) Source(77, 17) + SourceIndex(0) +6 >Emitted(71, 23) Source(77, 23) + SourceIndex(0) +7 >Emitted(71, 24) Source(77, 24) + SourceIndex(0) +8 >Emitted(71, 25) Source(77, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(72, 2) Source(78, 2) + SourceIndex(0) +--- +>>>for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(73, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(73, 4) Source(79, 4) + SourceIndex(0) +3 >Emitted(73, 5) Source(79, 5) + SourceIndex(0) +4 >Emitted(73, 6) Source(79, 63) + SourceIndex(0) +5 >Emitted(73, 17) Source(79, 79) + SourceIndex(0) +6 >Emitted(73, 19) Source(79, 63) + SourceIndex(0) +7 >Emitted(73, 26) Source(79, 64) + SourceIndex(0) +8 >Emitted(73, 32) Source(79, 70) + SourceIndex(0) +9 >Emitted(73, 34) Source(79, 72) + SourceIndex(0) +10>Emitted(73, 40) Source(79, 78) + SourceIndex(0) +11>Emitted(73, 41) Source(79, 79) + SourceIndex(0) +12>Emitted(73, 43) Source(79, 63) + SourceIndex(0) +13>Emitted(73, 59) Source(79, 79) + SourceIndex(0) +14>Emitted(73, 61) Source(79, 63) + SourceIndex(0) +15>Emitted(73, 66) Source(79, 79) + SourceIndex(0) +16>Emitted(73, 67) Source(79, 80) + SourceIndex(0) +--- +>>> _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "noName" +9 > +10> nameA2 = "noName" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(74, 5) Source(79, 6) + SourceIndex(0) +2 >Emitted(74, 19) Source(79, 59) + SourceIndex(0) +3 >Emitted(74, 21) Source(79, 7) + SourceIndex(0) +4 >Emitted(74, 33) Source(79, 20) + SourceIndex(0) +5 >Emitted(74, 35) Source(79, 7) + SourceIndex(0) +6 >Emitted(74, 71) Source(79, 20) + SourceIndex(0) +7 >Emitted(74, 73) Source(79, 22) + SourceIndex(0) +8 >Emitted(74, 85) Source(79, 39) + SourceIndex(0) +9 >Emitted(74, 87) Source(79, 22) + SourceIndex(0) +10>Emitted(74, 127) Source(79, 39) + SourceIndex(0) +11>Emitted(74, 129) Source(79, 41) + SourceIndex(0) +12>Emitted(74, 141) Source(79, 58) + SourceIndex(0) +13>Emitted(74, 143) Source(79, 41) + SourceIndex(0) +14>Emitted(74, 183) Source(79, 58) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(75, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(75, 12) Source(80, 12) + SourceIndex(0) +3 >Emitted(75, 13) Source(80, 13) + SourceIndex(0) +4 >Emitted(75, 16) Source(80, 16) + SourceIndex(0) +5 >Emitted(75, 17) Source(80, 17) + SourceIndex(0) +6 >Emitted(75, 23) Source(80, 23) + SourceIndex(0) +7 >Emitted(75, 24) Source(80, 24) + SourceIndex(0) +8 >Emitted(75, 25) Source(80, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(76, 2) Source(81, 2) + SourceIndex(0) +--- +>>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(77, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(77, 4) Source(82, 4) + SourceIndex(0) +3 >Emitted(77, 5) Source(82, 5) + SourceIndex(0) +4 >Emitted(77, 6) Source(85, 30) + SourceIndex(0) +5 >Emitted(77, 17) Source(85, 41) + SourceIndex(0) +6 >Emitted(77, 19) Source(85, 30) + SourceIndex(0) +7 >Emitted(77, 46) Source(85, 41) + SourceIndex(0) +8 >Emitted(77, 48) Source(85, 30) + SourceIndex(0) +9 >Emitted(77, 74) Source(85, 41) + SourceIndex(0) +10>Emitted(77, 76) Source(85, 30) + SourceIndex(0) +11>Emitted(77, 81) Source(85, 41) + SourceIndex(0) +12>Emitted(77, 82) Source(85, 42) + SourceIndex(0) +--- +>>> _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(78, 5) Source(82, 6) + SourceIndex(0) +2 >Emitted(78, 29) Source(85, 26) + SourceIndex(0) +3 >Emitted(78, 31) Source(82, 7) + SourceIndex(0) +4 >Emitted(78, 43) Source(82, 24) + SourceIndex(0) +5 >Emitted(78, 45) Source(82, 7) + SourceIndex(0) +6 >Emitted(78, 85) Source(82, 24) + SourceIndex(0) +7 >Emitted(78, 87) Source(82, 26) + SourceIndex(0) +8 >Emitted(78, 99) Source(85, 25) + SourceIndex(0) +9 >Emitted(78, 101) Source(82, 26) + SourceIndex(0) +10>Emitted(78, 150) Source(85, 25) + SourceIndex(0) +11>Emitted(78, 152) Source(83, 5) + SourceIndex(0) +12>Emitted(78, 164) Source(83, 30) + SourceIndex(0) +13>Emitted(78, 166) Source(83, 5) + SourceIndex(0) +14>Emitted(78, 214) Source(83, 30) + SourceIndex(0) +15>Emitted(78, 216) Source(84, 5) + SourceIndex(0) +16>Emitted(78, 228) Source(84, 34) + SourceIndex(0) +17>Emitted(78, 230) Source(84, 5) + SourceIndex(0) +18>Emitted(78, 282) Source(84, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(79, 5) Source(86, 5) + SourceIndex(0) +2 >Emitted(79, 12) Source(86, 12) + SourceIndex(0) +3 >Emitted(79, 13) Source(86, 13) + SourceIndex(0) +4 >Emitted(79, 16) Source(86, 16) + SourceIndex(0) +5 >Emitted(79, 17) Source(86, 17) + SourceIndex(0) +6 >Emitted(79, 23) Source(86, 23) + SourceIndex(0) +7 >Emitted(79, 24) Source(86, 24) + SourceIndex(0) +8 >Emitted(79, 25) Source(86, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(80, 2) Source(87, 2) + SourceIndex(0) +--- +>>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(81, 1) Source(88, 1) + SourceIndex(0) +2 >Emitted(81, 4) Source(88, 4) + SourceIndex(0) +3 >Emitted(81, 5) Source(88, 5) + SourceIndex(0) +4 >Emitted(81, 6) Source(91, 30) + SourceIndex(0) +5 >Emitted(81, 17) Source(91, 46) + SourceIndex(0) +6 >Emitted(81, 19) Source(91, 30) + SourceIndex(0) +7 >Emitted(81, 25) Source(91, 30) + SourceIndex(0) +8 >Emitted(81, 39) Source(91, 44) + SourceIndex(0) +9 >Emitted(81, 41) Source(91, 46) + SourceIndex(0) +10>Emitted(81, 43) Source(91, 30) + SourceIndex(0) +11>Emitted(81, 59) Source(91, 46) + SourceIndex(0) +12>Emitted(81, 61) Source(91, 30) + SourceIndex(0) +13>Emitted(81, 66) Source(91, 46) + SourceIndex(0) +14>Emitted(81, 67) Source(91, 47) + SourceIndex(0) +--- +>>> _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(82, 5) Source(88, 6) + SourceIndex(0) +2 >Emitted(82, 19) Source(91, 26) + SourceIndex(0) +3 >Emitted(82, 21) Source(88, 7) + SourceIndex(0) +4 >Emitted(82, 33) Source(88, 24) + SourceIndex(0) +5 >Emitted(82, 35) Source(88, 7) + SourceIndex(0) +6 >Emitted(82, 75) Source(88, 24) + SourceIndex(0) +7 >Emitted(82, 77) Source(88, 26) + SourceIndex(0) +8 >Emitted(82, 89) Source(91, 25) + SourceIndex(0) +9 >Emitted(82, 91) Source(88, 26) + SourceIndex(0) +10>Emitted(82, 140) Source(91, 25) + SourceIndex(0) +11>Emitted(82, 142) Source(89, 5) + SourceIndex(0) +12>Emitted(82, 154) Source(89, 30) + SourceIndex(0) +13>Emitted(82, 156) Source(89, 5) + SourceIndex(0) +14>Emitted(82, 204) Source(89, 30) + SourceIndex(0) +15>Emitted(82, 206) Source(90, 5) + SourceIndex(0) +16>Emitted(82, 218) Source(90, 34) + SourceIndex(0) +17>Emitted(82, 220) Source(90, 5) + SourceIndex(0) +18>Emitted(82, 272) Source(90, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(83, 5) Source(92, 5) + SourceIndex(0) +2 >Emitted(83, 12) Source(92, 12) + SourceIndex(0) +3 >Emitted(83, 13) Source(92, 13) + SourceIndex(0) +4 >Emitted(83, 16) Source(92, 16) + SourceIndex(0) +5 >Emitted(83, 17) Source(92, 17) + SourceIndex(0) +6 >Emitted(83, 23) Source(92, 23) + SourceIndex(0) +7 >Emitted(83, 24) Source(92, 24) + SourceIndex(0) +8 >Emitted(83, 25) Source(92, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(84, 2) Source(93, 2) + SourceIndex(0) +--- +>>>for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] of +5 > [multiRobotA, multiRobotB] +6 > +7 > [ +8 > multiRobotA +9 > , +10> multiRobotB +11> ] +12> +13> [multiRobotA, multiRobotB] +14> +15> [multiRobotA, multiRobotB] +16> ) +1->Emitted(85, 1) Source(94, 1) + SourceIndex(0) +2 >Emitted(85, 4) Source(94, 4) + SourceIndex(0) +3 >Emitted(85, 5) Source(94, 5) + SourceIndex(0) +4 >Emitted(85, 6) Source(97, 30) + SourceIndex(0) +5 >Emitted(85, 17) Source(97, 56) + SourceIndex(0) +6 >Emitted(85, 19) Source(97, 30) + SourceIndex(0) +7 >Emitted(85, 26) Source(97, 31) + SourceIndex(0) +8 >Emitted(85, 37) Source(97, 42) + SourceIndex(0) +9 >Emitted(85, 39) Source(97, 44) + SourceIndex(0) +10>Emitted(85, 50) Source(97, 55) + SourceIndex(0) +11>Emitted(85, 51) Source(97, 56) + SourceIndex(0) +12>Emitted(85, 53) Source(97, 30) + SourceIndex(0) +13>Emitted(85, 69) Source(97, 56) + SourceIndex(0) +14>Emitted(85, 71) Source(97, 30) + SourceIndex(0) +15>Emitted(85, 76) Source(97, 56) + SourceIndex(0) +16>Emitted(85, 77) Source(97, 57) + SourceIndex(0) +--- +>>> _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"]] +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +9 > +10> [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["skill1", "skill2"] +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , + > +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +1->Emitted(86, 5) Source(94, 6) + SourceIndex(0) +2 >Emitted(86, 19) Source(97, 26) + SourceIndex(0) +3 >Emitted(86, 21) Source(94, 7) + SourceIndex(0) +4 >Emitted(86, 33) Source(94, 24) + SourceIndex(0) +5 >Emitted(86, 35) Source(94, 7) + SourceIndex(0) +6 >Emitted(86, 75) Source(94, 24) + SourceIndex(0) +7 >Emitted(86, 77) Source(94, 26) + SourceIndex(0) +8 >Emitted(86, 89) Source(97, 25) + SourceIndex(0) +9 >Emitted(86, 91) Source(94, 26) + SourceIndex(0) +10>Emitted(86, 140) Source(97, 25) + SourceIndex(0) +11>Emitted(86, 142) Source(95, 5) + SourceIndex(0) +12>Emitted(86, 154) Source(95, 30) + SourceIndex(0) +13>Emitted(86, 156) Source(95, 5) + SourceIndex(0) +14>Emitted(86, 204) Source(95, 30) + SourceIndex(0) +15>Emitted(86, 206) Source(96, 5) + SourceIndex(0) +16>Emitted(86, 218) Source(96, 34) + SourceIndex(0) +17>Emitted(86, 220) Source(96, 5) + SourceIndex(0) +18>Emitted(86, 272) Source(96, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(87, 5) Source(98, 5) + SourceIndex(0) +2 >Emitted(87, 12) Source(98, 12) + SourceIndex(0) +3 >Emitted(87, 13) Source(98, 13) + SourceIndex(0) +4 >Emitted(87, 16) Source(98, 16) + SourceIndex(0) +5 >Emitted(87, 17) Source(98, 17) + SourceIndex(0) +6 >Emitted(87, 23) Source(98, 23) + SourceIndex(0) +7 >Emitted(87, 24) Source(98, 24) + SourceIndex(0) +8 >Emitted(87, 25) Source(98, 25) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(88, 2) Source(99, 2) + SourceIndex(0) +--- +>>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ([numberA3 = -1, ...robotAInfo] of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(89, 1) Source(101, 1) + SourceIndex(0) +2 >Emitted(89, 4) Source(101, 4) + SourceIndex(0) +3 >Emitted(89, 5) Source(101, 5) + SourceIndex(0) +4 >Emitted(89, 6) Source(101, 40) + SourceIndex(0) +5 >Emitted(89, 17) Source(101, 46) + SourceIndex(0) +6 >Emitted(89, 19) Source(101, 40) + SourceIndex(0) +7 >Emitted(89, 36) Source(101, 46) + SourceIndex(0) +8 >Emitted(89, 38) Source(101, 40) + SourceIndex(0) +9 >Emitted(89, 59) Source(101, 46) + SourceIndex(0) +10>Emitted(89, 61) Source(101, 40) + SourceIndex(0) +11>Emitted(89, 66) Source(101, 46) + SourceIndex(0) +12>Emitted(89, 67) Source(101, 47) + SourceIndex(0) +--- +>>> _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(90, 5) Source(101, 6) + SourceIndex(0) +2 >Emitted(90, 24) Source(101, 36) + SourceIndex(0) +3 >Emitted(90, 26) Source(101, 7) + SourceIndex(0) +4 >Emitted(90, 38) Source(101, 20) + SourceIndex(0) +5 >Emitted(90, 40) Source(101, 7) + SourceIndex(0) +6 >Emitted(90, 76) Source(101, 20) + SourceIndex(0) +7 >Emitted(90, 78) Source(101, 22) + SourceIndex(0) +8 >Emitted(90, 103) Source(101, 35) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(91, 5) Source(102, 5) + SourceIndex(0) +2 >Emitted(91, 12) Source(102, 12) + SourceIndex(0) +3 >Emitted(91, 13) Source(102, 13) + SourceIndex(0) +4 >Emitted(91, 16) Source(102, 16) + SourceIndex(0) +5 >Emitted(91, 17) Source(102, 17) + SourceIndex(0) +6 >Emitted(91, 25) Source(102, 25) + SourceIndex(0) +7 >Emitted(91, 26) Source(102, 26) + SourceIndex(0) +8 >Emitted(91, 27) Source(102, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(92, 2) Source(103, 2) + SourceIndex(0) +--- +>>>for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA3 = -1, ...robotAInfo] of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(93, 1) Source(104, 1) + SourceIndex(0) +2 >Emitted(93, 4) Source(104, 4) + SourceIndex(0) +3 >Emitted(93, 5) Source(104, 5) + SourceIndex(0) +4 >Emitted(93, 6) Source(104, 40) + SourceIndex(0) +5 >Emitted(93, 17) Source(104, 51) + SourceIndex(0) +6 >Emitted(93, 19) Source(104, 40) + SourceIndex(0) +7 >Emitted(93, 25) Source(104, 40) + SourceIndex(0) +8 >Emitted(93, 34) Source(104, 49) + SourceIndex(0) +9 >Emitted(93, 36) Source(104, 51) + SourceIndex(0) +10>Emitted(93, 38) Source(104, 40) + SourceIndex(0) +11>Emitted(93, 54) Source(104, 51) + SourceIndex(0) +12>Emitted(93, 56) Source(104, 40) + SourceIndex(0) +13>Emitted(93, 61) Source(104, 51) + SourceIndex(0) +14>Emitted(93, 62) Source(104, 52) + SourceIndex(0) +--- +>>> _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(94, 5) Source(104, 6) + SourceIndex(0) +2 >Emitted(94, 19) Source(104, 36) + SourceIndex(0) +3 >Emitted(94, 21) Source(104, 7) + SourceIndex(0) +4 >Emitted(94, 33) Source(104, 20) + SourceIndex(0) +5 >Emitted(94, 35) Source(104, 7) + SourceIndex(0) +6 >Emitted(94, 71) Source(104, 20) + SourceIndex(0) +7 >Emitted(94, 73) Source(104, 22) + SourceIndex(0) +8 >Emitted(94, 98) Source(104, 35) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(95, 5) Source(105, 5) + SourceIndex(0) +2 >Emitted(95, 12) Source(105, 12) + SourceIndex(0) +3 >Emitted(95, 13) Source(105, 13) + SourceIndex(0) +4 >Emitted(95, 16) Source(105, 16) + SourceIndex(0) +5 >Emitted(95, 17) Source(105, 17) + SourceIndex(0) +6 >Emitted(95, 25) Source(105, 25) + SourceIndex(0) +7 >Emitted(95, 26) Source(105, 26) + SourceIndex(0) +8 >Emitted(95, 27) Source(105, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(96, 2) Source(106, 2) + SourceIndex(0) +--- +>>>for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ([numberA3 = -1, ...robotAInfo] of +5 > [robotA, robotB] +6 > +7 > [ +8 > robotA +9 > , +10> robotB +11> ] +12> +13> [robotA, robotB] +14> +15> [robotA, robotB] +16> ) +1->Emitted(97, 1) Source(107, 1) + SourceIndex(0) +2 >Emitted(97, 4) Source(107, 4) + SourceIndex(0) +3 >Emitted(97, 5) Source(107, 5) + SourceIndex(0) +4 >Emitted(97, 6) Source(107, 40) + SourceIndex(0) +5 >Emitted(97, 17) Source(107, 56) + SourceIndex(0) +6 >Emitted(97, 19) Source(107, 40) + SourceIndex(0) +7 >Emitted(97, 26) Source(107, 41) + SourceIndex(0) +8 >Emitted(97, 32) Source(107, 47) + SourceIndex(0) +9 >Emitted(97, 34) Source(107, 49) + SourceIndex(0) +10>Emitted(97, 40) Source(107, 55) + SourceIndex(0) +11>Emitted(97, 41) Source(107, 56) + SourceIndex(0) +12>Emitted(97, 43) Source(107, 40) + SourceIndex(0) +13>Emitted(97, 59) Source(107, 56) + SourceIndex(0) +14>Emitted(97, 61) Source(107, 40) + SourceIndex(0) +15>Emitted(97, 66) Source(107, 56) + SourceIndex(0) +16>Emitted(97, 67) Source(107, 57) + SourceIndex(0) +--- +>>> _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(98, 5) Source(107, 6) + SourceIndex(0) +2 >Emitted(98, 19) Source(107, 36) + SourceIndex(0) +3 >Emitted(98, 21) Source(107, 7) + SourceIndex(0) +4 >Emitted(98, 33) Source(107, 20) + SourceIndex(0) +5 >Emitted(98, 35) Source(107, 7) + SourceIndex(0) +6 >Emitted(98, 71) Source(107, 20) + SourceIndex(0) +7 >Emitted(98, 73) Source(107, 22) + SourceIndex(0) +8 >Emitted(98, 98) Source(107, 35) + SourceIndex(0) +--- +>>> console.log(numberA3); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 >] of [robotA, robotB]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberA3 +7 > ) +8 > ; +1 >Emitted(99, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(99, 12) Source(108, 12) + SourceIndex(0) +3 >Emitted(99, 13) Source(108, 13) + SourceIndex(0) +4 >Emitted(99, 16) Source(108, 16) + SourceIndex(0) +5 >Emitted(99, 17) Source(108, 17) + SourceIndex(0) +6 >Emitted(99, 25) Source(108, 25) + SourceIndex(0) +7 >Emitted(99, 26) Source(108, 26) + SourceIndex(0) +8 >Emitted(99, 27) Source(108, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(100, 2) Source(109, 2) + SourceIndex(0) +--- +>>>var _a, _b, _e, _f, _j, _k, _m, _o, _p, _q, _r, _u, _v, _w, _x, _y, _1, _2, _3, _4, _5, _7, _10, _13, _15, _18, _21, _23, _24, _25, _26, _29, _30, _31, _32, _35, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _67, _68, _71, _72; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..6b16ace03ea --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,345 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 2, 1)) + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 2, 1)) + +let robots = [robotA, robotB]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 3, 38)) + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +let numberB: number, nameB: string; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 54)) + +for ([, nameA = "noName"] of robots) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([, nameA = "noName"] of getRobots()) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([, nameA = "noName"] of [robotA, robotB]) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 3)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +} +for ([, [ + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + + console.log(primarySkillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) +} + +for ([numberB = -1] of robots) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +} +for ([numberB = -1] of getRobots()) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +} +for ([numberB = -1] of [robotA, robotB]) { +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 3)) +} +for ([nameB = "noName"] of multiRobots) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +} +for ([nameB = "noName"] of getMultiRobots()) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 21, 20)) +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 3)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 37)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 21)) +} +for ([nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) +} +for ([nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 15, 45)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) +} +for ([nameMA = "noName", [ +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 18)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 20, 41)) + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 13, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 14, 3)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 22, 54)) +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 8, 30)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 21)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 6, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 7, 3)) + + console.log(numberA3); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 0, 22)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts, 23, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..14189ad9d81 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types @@ -0,0 +1,544 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +let robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +let robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let robots = [robotA, robotB]; +>robots : [number, string, string][] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + +function getRobots() { +>getRobots : () => [number, string, string][] + + return robots; +>robots : [number, string, string][] +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let multiRobots = [multiRobotA, multiRobotB]; +>multiRobots : [string, [string, string]][] +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + +function getMultiRobots() { +>getMultiRobots : () => [string, [string, string]][] + + return multiRobots; +>multiRobots : [string, [string, string]][] +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +>nameA : string +>primarySkillA : string +>secondarySkillA : string + +let numberB: number, nameB: string; +>numberB : number +>nameB : string + +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>nameMA : string + +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +>numberA3 : number +>robotAInfo : (number | string)[] +>multiRobotAInfo : (string | [string, string])[] + +for ([, nameA = "noName"] of robots) { +>[, nameA = "noName"] : string[] +> : undefined +>nameA = "noName" : string +>nameA : string +>"noName" : string +>robots : [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "noName"] of getRobots()) { +>[, nameA = "noName"] : string[] +> : undefined +>nameA = "noName" : string +>nameA : string +>"noName" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, nameA = "noName"] of [robotA, robotB]) { +>[, nameA = "noName"] : string[] +> : undefined +>nameA = "noName" : string +>nameA : string +>"noName" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, string][] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, string][] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} +for ([, [ +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, string][] +> : undefined +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(primarySkillA); +>console.log(primarySkillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primarySkillA : string +} + +for ([numberB = -1] of robots) { +>[numberB = -1] : number[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>robots : [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] of getRobots()) { +>[numberB = -1] : number[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([numberB = -1] of [robotA, robotB]) { +>[numberB = -1] : number[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} +for ([nameB = "noName"] of multiRobots) { +>[nameB = "noName"] : string[] +>nameB = "noName" : string +>nameB : string +>"noName" : string +>multiRobots : [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "noName"] of getMultiRobots()) { +>[nameB = "noName"] : string[] +>nameB = "noName" : string +>nameB : string +>"noName" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { +>[nameB = "noName"] : string[] +>nameB = "noName" : string +>nameB : string +>"noName" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameB : string +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +>[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : (number | string)[] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "noName" : string +>nameA2 : string +>"noName" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>robots : [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +>[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : (number | string)[] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "noName" : string +>nameA2 : string +>"noName" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +>[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : (number | string)[] +>numberA2 = -1 : number +>numberA2 : number +>-1 : number +>1 : number +>nameA2 = "noName" : string +>nameA2 : string +>"noName" : string +>skillA2 = "skill" : string +>skillA2 : string +>"skill" : string +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} +for ([nameMA = "noName", [ +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : (string | [string, string])[] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of multiRobots) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>multiRobots : [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", [ +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : (string | [string, string])[] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of getMultiRobots()) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>getMultiRobots() : [string, [string, string]][] +>getMultiRobots : () => [string, [string, string]][] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} +for ([nameMA = "noName", [ +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : (string | [string, string])[] +>nameMA = "noName" : string +>nameMA : string +>"noName" : string +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] + + primarySkillA = "primary", +>primarySkillA = "primary" : string +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA = "secondary" : string +>secondarySkillA : string +>"secondary" : string + +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +>["skill1", "skill2"] : [string, string] +>"skill1" : string +>"skill2" : string +>[multiRobotA, multiRobotB] : [string, [string, string]][] +>multiRobotA : [string, [string, string]] +>multiRobotB : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robots : [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobots() : [number, string, string][] +>getRobots : () => [number, string, string][] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +>[numberA3 = -1, ...robotAInfo] : (number | string)[] +>numberA3 = -1 : number +>numberA3 : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[robotA, robotB] : [number, string, string][] +>robotA : [number, string, string] +>robotB : [number, string, string] + + console.log(numberA3); +>console.log(numberA3) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberA3 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js new file mode 100644 index 00000000000..247e23ff1f1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js @@ -0,0 +1,130 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA } of robots) { + console.log(nameA); +} +for (let {name: nameA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPattern.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var nameA = robots_1[_i].name; + console.log(nameA); +} +for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { + var nameA = _b[_a].name; + console.log(nameA); +} +for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { + var nameA = _d[_c].name; + console.log(nameA); +} +for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { + var _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; + console.log(primaryA); +} +for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { + var _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; + console.log(primaryA); +} +for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { + var _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; + console.log(primaryA); +} +for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { + var _p = robots_2[_o], nameA = _p.name, skillA = _p.skill; + console.log(nameA); +} +for (var _q = 0, _r = getRobots(); _q < _r.length; _q++) { + var _s = _r[_q], nameA = _s.name, skillA = _s.skill; + console.log(nameA); +} +for (var _t = 0, _u = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _t < _u.length; _t++) { + var _v = _u[_t], nameA = _v.name, skillA = _v.skill; + console.log(nameA); +} +for (var _w = 0, multiRobots_2 = multiRobots; _w < multiRobots_2.length; _w++) { + var _x = multiRobots_2[_w], nameA = _x.name, _y = _x.skills, primaryA = _y.primary, secondaryA = _y.secondary; + console.log(nameA); +} +for (var _z = 0, _0 = getMultiRobots(); _z < _0.length; _z++) { + var _1 = _0[_z], nameA = _1.name, _2 = _1.skills, primaryA = _2.primary, secondaryA = _2.secondary; + console.log(nameA); +} +for (var _3 = 0, _4 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _3 < _4.length; _3++) { + var _5 = _4[_3], nameA = _5.name, _6 = _5.skills, primaryA = _6.primary, secondaryA = _6.secondary; + console.log(nameA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map new file mode 100644 index 00000000000..3f10e267eb9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,6BAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,uBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAA9F,uBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAiE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtE,iCAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAiE,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3E,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAiE,UACS,EADT,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADT,cACS,EADT,IACS,CAAC;IADpE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAEzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAAsC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA5C,qBAAiC,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAsC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAjD,eAAiC,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAsC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAlH,eAAiC,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAxF,0BAAwE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA7F,eAAwE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UACH,EADG,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjJ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADG,cACH,EADG,IACH,CAAC;IAD1E,eAAwE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..5403a0863a3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt @@ -0,0 +1,1811 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let {name: nameA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(29, 28) + SourceIndex(0) +5 >Emitted(10, 16) Source(29, 34) + SourceIndex(0) +6 >Emitted(10, 18) Source(29, 28) + SourceIndex(0) +7 >Emitted(10, 35) Source(29, 34) + SourceIndex(0) +8 >Emitted(10, 37) Source(29, 28) + SourceIndex(0) +9 >Emitted(10, 57) Source(29, 34) + SourceIndex(0) +10>Emitted(10, 59) Source(29, 28) + SourceIndex(0) +11>Emitted(10, 63) Source(29, 34) + SourceIndex(0) +12>Emitted(10, 64) Source(29, 35) + SourceIndex(0) +--- +>>> var nameA = robots_1[_i].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(11, 5) Source(29, 11) + SourceIndex(0) +2 >Emitted(11, 34) Source(29, 22) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 28) + SourceIndex(0) +5 >Emitted(14, 16) Source(32, 39) + SourceIndex(0) +6 >Emitted(14, 18) Source(32, 28) + SourceIndex(0) +7 >Emitted(14, 23) Source(32, 28) + SourceIndex(0) +8 >Emitted(14, 32) Source(32, 37) + SourceIndex(0) +9 >Emitted(14, 34) Source(32, 39) + SourceIndex(0) +10>Emitted(14, 36) Source(32, 28) + SourceIndex(0) +11>Emitted(14, 50) Source(32, 39) + SourceIndex(0) +12>Emitted(14, 52) Source(32, 28) + SourceIndex(0) +13>Emitted(14, 56) Source(32, 39) + SourceIndex(0) +14>Emitted(14, 57) Source(32, 40) + SourceIndex(0) +--- +>>> var nameA = _b[_a].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(15, 5) Source(32, 11) + SourceIndex(0) +2 >Emitted(15, 28) Source(32, 22) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(35, 28) + SourceIndex(0) +5 >Emitted(18, 16) Source(35, 104) + SourceIndex(0) +6 >Emitted(18, 18) Source(35, 28) + SourceIndex(0) +7 >Emitted(18, 24) Source(35, 29) + SourceIndex(0) +8 >Emitted(18, 26) Source(35, 31) + SourceIndex(0) +9 >Emitted(18, 30) Source(35, 35) + SourceIndex(0) +10>Emitted(18, 32) Source(35, 37) + SourceIndex(0) +11>Emitted(18, 39) Source(35, 44) + SourceIndex(0) +12>Emitted(18, 41) Source(35, 46) + SourceIndex(0) +13>Emitted(18, 46) Source(35, 51) + SourceIndex(0) +14>Emitted(18, 48) Source(35, 53) + SourceIndex(0) +15>Emitted(18, 56) Source(35, 61) + SourceIndex(0) +16>Emitted(18, 58) Source(35, 63) + SourceIndex(0) +17>Emitted(18, 60) Source(35, 65) + SourceIndex(0) +18>Emitted(18, 62) Source(35, 67) + SourceIndex(0) +19>Emitted(18, 66) Source(35, 71) + SourceIndex(0) +20>Emitted(18, 68) Source(35, 73) + SourceIndex(0) +21>Emitted(18, 77) Source(35, 82) + SourceIndex(0) +22>Emitted(18, 79) Source(35, 84) + SourceIndex(0) +23>Emitted(18, 84) Source(35, 89) + SourceIndex(0) +24>Emitted(18, 86) Source(35, 91) + SourceIndex(0) +25>Emitted(18, 96) Source(35, 101) + SourceIndex(0) +26>Emitted(18, 98) Source(35, 103) + SourceIndex(0) +27>Emitted(18, 99) Source(35, 104) + SourceIndex(0) +28>Emitted(18, 101) Source(35, 28) + SourceIndex(0) +29>Emitted(18, 115) Source(35, 104) + SourceIndex(0) +30>Emitted(18, 117) Source(35, 28) + SourceIndex(0) +31>Emitted(18, 121) Source(35, 104) + SourceIndex(0) +32>Emitted(18, 122) Source(35, 105) + SourceIndex(0) +--- +>>> var nameA = _d[_c].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(19, 5) Source(35, 11) + SourceIndex(0) +2 >Emitted(19, 28) Source(35, 22) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(20, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(20, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(20, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(21, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(22, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(38, 70) + SourceIndex(0) +5 >Emitted(22, 16) Source(38, 81) + SourceIndex(0) +6 >Emitted(22, 18) Source(38, 70) + SourceIndex(0) +7 >Emitted(22, 45) Source(38, 81) + SourceIndex(0) +8 >Emitted(22, 47) Source(38, 70) + SourceIndex(0) +9 >Emitted(22, 72) Source(38, 81) + SourceIndex(0) +10>Emitted(22, 74) Source(38, 70) + SourceIndex(0) +11>Emitted(22, 78) Source(38, 81) + SourceIndex(0) +12>Emitted(22, 79) Source(38, 82) + SourceIndex(0) +--- +>>> var _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(23, 5) Source(38, 12) + SourceIndex(0) +2 >Emitted(23, 38) Source(38, 64) + SourceIndex(0) +3 >Emitted(23, 40) Source(38, 22) + SourceIndex(0) +4 >Emitted(23, 61) Source(38, 39) + SourceIndex(0) +5 >Emitted(23, 63) Source(38, 41) + SourceIndex(0) +6 >Emitted(23, 88) Source(38, 62) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(39, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(39, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(39, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(25, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(26, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(41, 70) + SourceIndex(0) +5 >Emitted(26, 16) Source(41, 86) + SourceIndex(0) +6 >Emitted(26, 18) Source(41, 70) + SourceIndex(0) +7 >Emitted(26, 23) Source(41, 70) + SourceIndex(0) +8 >Emitted(26, 37) Source(41, 84) + SourceIndex(0) +9 >Emitted(26, 39) Source(41, 86) + SourceIndex(0) +10>Emitted(26, 41) Source(41, 70) + SourceIndex(0) +11>Emitted(26, 55) Source(41, 86) + SourceIndex(0) +12>Emitted(26, 57) Source(41, 70) + SourceIndex(0) +13>Emitted(26, 61) Source(41, 86) + SourceIndex(0) +14>Emitted(26, 62) Source(41, 87) + SourceIndex(0) +--- +>>> var _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(27, 5) Source(41, 12) + SourceIndex(0) +2 >Emitted(27, 27) Source(41, 64) + SourceIndex(0) +3 >Emitted(27, 29) Source(41, 22) + SourceIndex(0) +4 >Emitted(27, 50) Source(41, 39) + SourceIndex(0) +5 >Emitted(27, 52) Source(41, 41) + SourceIndex(0) +6 >Emitted(27, 77) Source(41, 62) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(42, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(42, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(42, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(29, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(44, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(44, 70) + SourceIndex(0) +5 >Emitted(30, 16) Source(45, 79) + SourceIndex(0) +6 >Emitted(30, 18) Source(44, 70) + SourceIndex(0) +7 >Emitted(30, 24) Source(44, 71) + SourceIndex(0) +8 >Emitted(30, 26) Source(44, 73) + SourceIndex(0) +9 >Emitted(30, 30) Source(44, 77) + SourceIndex(0) +10>Emitted(30, 32) Source(44, 79) + SourceIndex(0) +11>Emitted(30, 39) Source(44, 86) + SourceIndex(0) +12>Emitted(30, 41) Source(44, 88) + SourceIndex(0) +13>Emitted(30, 47) Source(44, 94) + SourceIndex(0) +14>Emitted(30, 49) Source(44, 96) + SourceIndex(0) +15>Emitted(30, 51) Source(44, 98) + SourceIndex(0) +16>Emitted(30, 58) Source(44, 105) + SourceIndex(0) +17>Emitted(30, 60) Source(44, 107) + SourceIndex(0) +18>Emitted(30, 68) Source(44, 115) + SourceIndex(0) +19>Emitted(30, 70) Source(44, 117) + SourceIndex(0) +20>Emitted(30, 79) Source(44, 126) + SourceIndex(0) +21>Emitted(30, 81) Source(44, 128) + SourceIndex(0) +22>Emitted(30, 87) Source(44, 134) + SourceIndex(0) +23>Emitted(30, 89) Source(44, 136) + SourceIndex(0) +24>Emitted(30, 91) Source(44, 138) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(31, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(31, 7) Source(45, 7) + SourceIndex(0) +3 >Emitted(31, 11) Source(45, 11) + SourceIndex(0) +4 >Emitted(31, 13) Source(45, 13) + SourceIndex(0) +5 >Emitted(31, 22) Source(45, 22) + SourceIndex(0) +6 >Emitted(31, 24) Source(45, 24) + SourceIndex(0) +7 >Emitted(31, 30) Source(45, 30) + SourceIndex(0) +8 >Emitted(31, 32) Source(45, 32) + SourceIndex(0) +9 >Emitted(31, 34) Source(45, 34) + SourceIndex(0) +10>Emitted(31, 41) Source(45, 41) + SourceIndex(0) +11>Emitted(31, 43) Source(45, 43) + SourceIndex(0) +12>Emitted(31, 53) Source(45, 53) + SourceIndex(0) +13>Emitted(31, 55) Source(45, 55) + SourceIndex(0) +14>Emitted(31, 64) Source(45, 64) + SourceIndex(0) +15>Emitted(31, 66) Source(45, 66) + SourceIndex(0) +16>Emitted(31, 74) Source(45, 74) + SourceIndex(0) +17>Emitted(31, 76) Source(45, 76) + SourceIndex(0) +18>Emitted(31, 78) Source(45, 78) + SourceIndex(0) +19>Emitted(31, 79) Source(45, 79) + SourceIndex(0) +20>Emitted(31, 81) Source(44, 70) + SourceIndex(0) +21>Emitted(31, 95) Source(45, 79) + SourceIndex(0) +22>Emitted(31, 97) Source(44, 70) + SourceIndex(0) +23>Emitted(31, 101) Source(45, 79) + SourceIndex(0) +24>Emitted(31, 102) Source(45, 80) + SourceIndex(0) +--- +>>> var _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1 >Emitted(32, 5) Source(44, 12) + SourceIndex(0) +2 >Emitted(32, 27) Source(44, 64) + SourceIndex(0) +3 >Emitted(32, 29) Source(44, 22) + SourceIndex(0) +4 >Emitted(32, 50) Source(44, 39) + SourceIndex(0) +5 >Emitted(32, 52) Source(44, 41) + SourceIndex(0) +6 >Emitted(32, 77) Source(44, 62) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(33, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(33, 12) Source(46, 12) + SourceIndex(0) +3 >Emitted(33, 13) Source(46, 13) + SourceIndex(0) +4 >Emitted(33, 16) Source(46, 16) + SourceIndex(0) +5 >Emitted(33, 17) Source(46, 17) + SourceIndex(0) +6 >Emitted(33, 25) Source(46, 25) + SourceIndex(0) +7 >Emitted(33, 26) Source(46, 26) + SourceIndex(0) +8 >Emitted(33, 27) Source(46, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(34, 2) Source(47, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > (let {name: nameA, skill: skillA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(35, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(35, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(35, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(35, 6) Source(49, 43) + SourceIndex(0) +5 >Emitted(35, 16) Source(49, 49) + SourceIndex(0) +6 >Emitted(35, 18) Source(49, 43) + SourceIndex(0) +7 >Emitted(35, 35) Source(49, 49) + SourceIndex(0) +8 >Emitted(35, 37) Source(49, 43) + SourceIndex(0) +9 >Emitted(35, 57) Source(49, 49) + SourceIndex(0) +10>Emitted(35, 59) Source(49, 43) + SourceIndex(0) +11>Emitted(35, 63) Source(49, 49) + SourceIndex(0) +12>Emitted(35, 64) Source(49, 50) + SourceIndex(0) +--- +>>> var _p = robots_2[_o], nameA = _p.name, skillA = _p.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > let {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(36, 5) Source(49, 6) + SourceIndex(0) +2 >Emitted(36, 26) Source(49, 39) + SourceIndex(0) +3 >Emitted(36, 28) Source(49, 11) + SourceIndex(0) +4 >Emitted(36, 43) Source(49, 22) + SourceIndex(0) +5 >Emitted(36, 45) Source(49, 24) + SourceIndex(0) +6 >Emitted(36, 62) Source(49, 37) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(50, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(50, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(50, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(38, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _q = 0, _r = getRobots(); _q < _r.length; _q++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skill: skillA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(39, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(52, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(52, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(52, 43) + SourceIndex(0) +5 >Emitted(39, 16) Source(52, 54) + SourceIndex(0) +6 >Emitted(39, 18) Source(52, 43) + SourceIndex(0) +7 >Emitted(39, 23) Source(52, 43) + SourceIndex(0) +8 >Emitted(39, 32) Source(52, 52) + SourceIndex(0) +9 >Emitted(39, 34) Source(52, 54) + SourceIndex(0) +10>Emitted(39, 36) Source(52, 43) + SourceIndex(0) +11>Emitted(39, 50) Source(52, 54) + SourceIndex(0) +12>Emitted(39, 52) Source(52, 43) + SourceIndex(0) +13>Emitted(39, 56) Source(52, 54) + SourceIndex(0) +14>Emitted(39, 57) Source(52, 55) + SourceIndex(0) +--- +>>> var _s = _r[_q], nameA = _s.name, skillA = _s.skill; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1->Emitted(40, 5) Source(52, 6) + SourceIndex(0) +2 >Emitted(40, 20) Source(52, 39) + SourceIndex(0) +3 >Emitted(40, 22) Source(52, 11) + SourceIndex(0) +4 >Emitted(40, 37) Source(52, 22) + SourceIndex(0) +5 >Emitted(40, 39) Source(52, 24) + SourceIndex(0) +6 >Emitted(40, 56) Source(52, 37) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(41, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(53, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(53, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(42, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _t = 0, _u = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _t < _u.length; _t++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA, skill: skillA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(43, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(55, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(55, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(55, 43) + SourceIndex(0) +5 >Emitted(43, 16) Source(55, 119) + SourceIndex(0) +6 >Emitted(43, 18) Source(55, 43) + SourceIndex(0) +7 >Emitted(43, 24) Source(55, 44) + SourceIndex(0) +8 >Emitted(43, 26) Source(55, 46) + SourceIndex(0) +9 >Emitted(43, 30) Source(55, 50) + SourceIndex(0) +10>Emitted(43, 32) Source(55, 52) + SourceIndex(0) +11>Emitted(43, 39) Source(55, 59) + SourceIndex(0) +12>Emitted(43, 41) Source(55, 61) + SourceIndex(0) +13>Emitted(43, 46) Source(55, 66) + SourceIndex(0) +14>Emitted(43, 48) Source(55, 68) + SourceIndex(0) +15>Emitted(43, 56) Source(55, 76) + SourceIndex(0) +16>Emitted(43, 58) Source(55, 78) + SourceIndex(0) +17>Emitted(43, 60) Source(55, 80) + SourceIndex(0) +18>Emitted(43, 62) Source(55, 82) + SourceIndex(0) +19>Emitted(43, 66) Source(55, 86) + SourceIndex(0) +20>Emitted(43, 68) Source(55, 88) + SourceIndex(0) +21>Emitted(43, 77) Source(55, 97) + SourceIndex(0) +22>Emitted(43, 79) Source(55, 99) + SourceIndex(0) +23>Emitted(43, 84) Source(55, 104) + SourceIndex(0) +24>Emitted(43, 86) Source(55, 106) + SourceIndex(0) +25>Emitted(43, 96) Source(55, 116) + SourceIndex(0) +26>Emitted(43, 98) Source(55, 118) + SourceIndex(0) +27>Emitted(43, 99) Source(55, 119) + SourceIndex(0) +28>Emitted(43, 101) Source(55, 43) + SourceIndex(0) +29>Emitted(43, 115) Source(55, 119) + SourceIndex(0) +30>Emitted(43, 117) Source(55, 43) + SourceIndex(0) +31>Emitted(43, 121) Source(55, 119) + SourceIndex(0) +32>Emitted(43, 122) Source(55, 120) + SourceIndex(0) +--- +>>> var _v = _u[_t], nameA = _v.name, skillA = _v.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > let {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(44, 5) Source(55, 6) + SourceIndex(0) +2 >Emitted(44, 20) Source(55, 39) + SourceIndex(0) +3 >Emitted(44, 22) Source(55, 11) + SourceIndex(0) +4 >Emitted(44, 37) Source(55, 22) + SourceIndex(0) +5 >Emitted(44, 39) Source(55, 24) + SourceIndex(0) +6 >Emitted(44, 56) Source(55, 37) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(45, 5) Source(56, 5) + SourceIndex(0) +2 >Emitted(45, 12) Source(56, 12) + SourceIndex(0) +3 >Emitted(45, 13) Source(56, 13) + SourceIndex(0) +4 >Emitted(45, 16) Source(56, 16) + SourceIndex(0) +5 >Emitted(45, 17) Source(56, 17) + SourceIndex(0) +6 >Emitted(45, 22) Source(56, 22) + SourceIndex(0) +7 >Emitted(45, 23) Source(56, 23) + SourceIndex(0) +8 >Emitted(45, 24) Source(56, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(46, 2) Source(57, 2) + SourceIndex(0) +--- +>>>for (var _w = 0, multiRobots_2 = multiRobots; _w < multiRobots_2.length; _w++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(47, 1) Source(58, 1) + SourceIndex(0) +2 >Emitted(47, 4) Source(58, 4) + SourceIndex(0) +3 >Emitted(47, 5) Source(58, 5) + SourceIndex(0) +4 >Emitted(47, 6) Source(58, 82) + SourceIndex(0) +5 >Emitted(47, 16) Source(58, 93) + SourceIndex(0) +6 >Emitted(47, 18) Source(58, 82) + SourceIndex(0) +7 >Emitted(47, 45) Source(58, 93) + SourceIndex(0) +8 >Emitted(47, 47) Source(58, 82) + SourceIndex(0) +9 >Emitted(47, 72) Source(58, 93) + SourceIndex(0) +10>Emitted(47, 74) Source(58, 82) + SourceIndex(0) +11>Emitted(47, 78) Source(58, 93) + SourceIndex(0) +12>Emitted(47, 79) Source(58, 94) + SourceIndex(0) +--- +>>> var _x = multiRobots_2[_w], nameA = _x.name, _y = _x.skills, primaryA = _y.primary, secondaryA = _y.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(48, 5) Source(58, 6) + SourceIndex(0) +2 >Emitted(48, 31) Source(58, 78) + SourceIndex(0) +3 >Emitted(48, 33) Source(58, 11) + SourceIndex(0) +4 >Emitted(48, 48) Source(58, 22) + SourceIndex(0) +5 >Emitted(48, 50) Source(58, 24) + SourceIndex(0) +6 >Emitted(48, 64) Source(58, 76) + SourceIndex(0) +7 >Emitted(48, 66) Source(58, 34) + SourceIndex(0) +8 >Emitted(48, 87) Source(58, 51) + SourceIndex(0) +9 >Emitted(48, 89) Source(58, 53) + SourceIndex(0) +10>Emitted(48, 114) Source(58, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(49, 5) Source(59, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(59, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(59, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(59, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(59, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(59, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(59, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(59, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(50, 2) Source(60, 2) + SourceIndex(0) +--- +>>>for (var _z = 0, _0 = getMultiRobots(); _z < _0.length; _z++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(51, 1) Source(61, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(61, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(61, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(61, 82) + SourceIndex(0) +5 >Emitted(51, 16) Source(61, 98) + SourceIndex(0) +6 >Emitted(51, 18) Source(61, 82) + SourceIndex(0) +7 >Emitted(51, 23) Source(61, 82) + SourceIndex(0) +8 >Emitted(51, 37) Source(61, 96) + SourceIndex(0) +9 >Emitted(51, 39) Source(61, 98) + SourceIndex(0) +10>Emitted(51, 41) Source(61, 82) + SourceIndex(0) +11>Emitted(51, 55) Source(61, 98) + SourceIndex(0) +12>Emitted(51, 57) Source(61, 82) + SourceIndex(0) +13>Emitted(51, 61) Source(61, 98) + SourceIndex(0) +14>Emitted(51, 62) Source(61, 99) + SourceIndex(0) +--- +>>> var _1 = _0[_z], nameA = _1.name, _2 = _1.skills, primaryA = _2.primary, secondaryA = _2.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(52, 5) Source(61, 6) + SourceIndex(0) +2 >Emitted(52, 20) Source(61, 78) + SourceIndex(0) +3 >Emitted(52, 22) Source(61, 11) + SourceIndex(0) +4 >Emitted(52, 37) Source(61, 22) + SourceIndex(0) +5 >Emitted(52, 39) Source(61, 24) + SourceIndex(0) +6 >Emitted(52, 53) Source(61, 76) + SourceIndex(0) +7 >Emitted(52, 55) Source(61, 34) + SourceIndex(0) +8 >Emitted(52, 76) Source(61, 51) + SourceIndex(0) +9 >Emitted(52, 78) Source(61, 53) + SourceIndex(0) +10>Emitted(52, 103) Source(61, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(62, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(62, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(62, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(62, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(62, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(62, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(62, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(54, 2) Source(63, 2) + SourceIndex(0) +--- +>>>for (var _3 = 0, _4 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(55, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(64, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(64, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(64, 82) + SourceIndex(0) +5 >Emitted(55, 16) Source(65, 79) + SourceIndex(0) +6 >Emitted(55, 18) Source(64, 82) + SourceIndex(0) +7 >Emitted(55, 24) Source(64, 83) + SourceIndex(0) +8 >Emitted(55, 26) Source(64, 85) + SourceIndex(0) +9 >Emitted(55, 30) Source(64, 89) + SourceIndex(0) +10>Emitted(55, 32) Source(64, 91) + SourceIndex(0) +11>Emitted(55, 39) Source(64, 98) + SourceIndex(0) +12>Emitted(55, 41) Source(64, 100) + SourceIndex(0) +13>Emitted(55, 47) Source(64, 106) + SourceIndex(0) +14>Emitted(55, 49) Source(64, 108) + SourceIndex(0) +15>Emitted(55, 51) Source(64, 110) + SourceIndex(0) +16>Emitted(55, 58) Source(64, 117) + SourceIndex(0) +17>Emitted(55, 60) Source(64, 119) + SourceIndex(0) +18>Emitted(55, 68) Source(64, 127) + SourceIndex(0) +19>Emitted(55, 70) Source(64, 129) + SourceIndex(0) +20>Emitted(55, 79) Source(64, 138) + SourceIndex(0) +21>Emitted(55, 81) Source(64, 140) + SourceIndex(0) +22>Emitted(55, 87) Source(64, 146) + SourceIndex(0) +23>Emitted(55, 89) Source(64, 148) + SourceIndex(0) +24>Emitted(55, 91) Source(64, 150) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _3 < _4.length; _3++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +25> ^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(56, 5) Source(65, 5) + SourceIndex(0) +2 >Emitted(56, 7) Source(65, 7) + SourceIndex(0) +3 >Emitted(56, 11) Source(65, 11) + SourceIndex(0) +4 >Emitted(56, 13) Source(65, 13) + SourceIndex(0) +5 >Emitted(56, 22) Source(65, 22) + SourceIndex(0) +6 >Emitted(56, 24) Source(65, 24) + SourceIndex(0) +7 >Emitted(56, 30) Source(65, 30) + SourceIndex(0) +8 >Emitted(56, 32) Source(65, 32) + SourceIndex(0) +9 >Emitted(56, 34) Source(65, 34) + SourceIndex(0) +10>Emitted(56, 41) Source(65, 41) + SourceIndex(0) +11>Emitted(56, 43) Source(65, 43) + SourceIndex(0) +12>Emitted(56, 53) Source(65, 53) + SourceIndex(0) +13>Emitted(56, 55) Source(65, 55) + SourceIndex(0) +14>Emitted(56, 64) Source(65, 64) + SourceIndex(0) +15>Emitted(56, 66) Source(65, 66) + SourceIndex(0) +16>Emitted(56, 74) Source(65, 74) + SourceIndex(0) +17>Emitted(56, 76) Source(65, 76) + SourceIndex(0) +18>Emitted(56, 78) Source(65, 78) + SourceIndex(0) +19>Emitted(56, 79) Source(65, 79) + SourceIndex(0) +20>Emitted(56, 81) Source(64, 82) + SourceIndex(0) +21>Emitted(56, 95) Source(65, 79) + SourceIndex(0) +22>Emitted(56, 97) Source(64, 82) + SourceIndex(0) +23>Emitted(56, 101) Source(65, 79) + SourceIndex(0) +24>Emitted(56, 102) Source(65, 80) + SourceIndex(0) +--- +>>> var _5 = _4[_3], nameA = _5.name, _6 = _5.skills, primaryA = _6.primary, secondaryA = _6.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(57, 5) Source(64, 6) + SourceIndex(0) +2 >Emitted(57, 20) Source(64, 78) + SourceIndex(0) +3 >Emitted(57, 22) Source(64, 11) + SourceIndex(0) +4 >Emitted(57, 37) Source(64, 22) + SourceIndex(0) +5 >Emitted(57, 39) Source(64, 24) + SourceIndex(0) +6 >Emitted(57, 53) Source(64, 76) + SourceIndex(0) +7 >Emitted(57, 55) Source(64, 34) + SourceIndex(0) +8 >Emitted(57, 76) Source(64, 51) + SourceIndex(0) +9 >Emitted(57, 78) Source(64, 53) + SourceIndex(0) +10>Emitted(57, 103) Source(64, 74) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(58, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(66, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(66, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(66, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(66, 17) + SourceIndex(0) +6 >Emitted(58, 22) Source(66, 22) + SourceIndex(0) +7 >Emitted(58, 23) Source(66, 23) + SourceIndex(0) +8 >Emitted(58, 24) Source(66, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(59, 2) Source(67, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.symbols new file mode 100644 index 00000000000..8fef1fabd6d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.symbols @@ -0,0 +1,259 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) +} + +for (let {name: nameA } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 28, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 28, 10)) +} +for (let {name: nameA } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 31, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 31, 10)) +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 29)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 10)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 29)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 44)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 65)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 82)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 34, 10)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 37, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 37, 39)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 37, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 40, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 40, 39)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 40, 20)) +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 86)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 96)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 115)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 71)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 86)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 96)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 115)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 44, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 43, 20)) +} + +for (let {name: nameA, skill: skillA } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 48, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 48, 22)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 48, 10)) +} +for (let {name: nameA, skill: skillA } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 51, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 51, 22)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 51, 10)) +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 44)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 10)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 59)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 22)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 44)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 59)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 80)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 97)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 54, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 51)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 57, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 10)) +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 11, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 51)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 60, 10)) +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 83)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 10)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 98)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 108)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 127)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 51)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 83)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 98)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 108)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 127)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 64, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern.ts, 63, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types new file mode 100644 index 00000000000..17c060225dc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types @@ -0,0 +1,329 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +for (let {name: nameA } of robots) { +>name : any +>nameA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } of getRobots()) { +>name : any +>nameA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA, skill: skillA } of robots) { +>name : any +>nameA : string +>skill : any +>skillA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } of getRobots()) { +>name : any +>nameA : string +>skill : any +>skillA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>skill : any +>skillA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : any +>nameA : string +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js new file mode 100644 index 00000000000..aebfd11b9db --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js @@ -0,0 +1,225 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA } of robots) { + console.log(nameA); +} +for ({name: nameA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} +for ({name } of robots) { + console.log(nameA); +} +for ({name } of getRobots()) { + console.log(nameA); +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} +for ({name, skill } of robots) { + console.log(nameA); +} +for ({name, skill } of getRobots()) { + console.log(nameA); +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of multiRobots) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPattern2.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + nameA = robots_1[_i].name; + console.log(nameA); +} +for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { + nameA = _b[_a].name; + console.log(nameA); +} +for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { + nameA = _d[_c].name; + console.log(nameA); +} +for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { + _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; + console.log(primaryA); +} +for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { + _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; + console.log(primaryA); +} +for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { + _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; + console.log(primaryA); +} +for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { + name = robots_2[_o].name; + console.log(nameA); +} +for (var _p = 0, _q = getRobots(); _p < _q.length; _p++) { + name = _q[_p].name; + console.log(nameA); +} +for (var _r = 0, _s = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _r < _s.length; _r++) { + name = _s[_r].name; + console.log(nameA); +} +for (var _t = 0, multiRobots_2 = multiRobots; _t < multiRobots_2.length; _t++) { + _u = multiRobots_2[_t].skills, primary = _u.primary, secondary = _u.secondary; + console.log(primaryA); +} +for (var _v = 0, _w = getMultiRobots(); _v < _w.length; _v++) { + _x = _w[_v].skills, primary = _x.primary, secondary = _x.secondary; + console.log(primaryA); +} +for (var _y = 0, _z = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _y < _z.length; _y++) { + _0 = _z[_y].skills, primary = _0.primary, secondary = _0.secondary; + console.log(primaryA); +} +for (var _1 = 0, robots_3 = robots; _1 < robots_3.length; _1++) { + _2 = robots_3[_1], nameA = _2.name, skillA = _2.skill; + console.log(nameA); +} +for (var _3 = 0, _4 = getRobots(); _3 < _4.length; _3++) { + _5 = _4[_3], nameA = _5.name, skillA = _5.skill; + console.log(nameA); +} +for (var _6 = 0, _7 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _6 < _7.length; _6++) { + _8 = _7[_6], nameA = _8.name, skillA = _8.skill; + console.log(nameA); +} +for (var _9 = 0, multiRobots_3 = multiRobots; _9 < multiRobots_3.length; _9++) { + _10 = multiRobots_3[_9], nameA = _10.name, _11 = _10.skills, primaryA = _11.primary, secondaryA = _11.secondary; + console.log(nameA); +} +for (var _12 = 0, _13 = getMultiRobots(); _12 < _13.length; _12++) { + _14 = _13[_12], nameA = _14.name, _15 = _14.skills, primaryA = _15.primary, secondaryA = _15.secondary; + console.log(nameA); +} +for (var _16 = 0, _17 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _16 < _17.length; _16++) { + _18 = _17[_16], nameA = _18.name, _19 = _18.skills, primaryA = _19.primary, secondaryA = _19.secondary; + console.log(nameA); +} +for (var _20 = 0, robots_4 = robots; _20 < robots_4.length; _20++) { + _21 = robots_4[_20], name = _21.name, skill = _21.skill; + console.log(nameA); +} +for (var _22 = 0, _23 = getRobots(); _22 < _23.length; _22++) { + _24 = _23[_22], name = _24.name, skill = _24.skill; + console.log(nameA); +} +for (var _25 = 0, _26 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _25 < _26.length; _25++) { + _27 = _26[_25], name = _27.name, skill = _27.skill; + console.log(nameA); +} +for (var _28 = 0, multiRobots_4 = multiRobots; _28 < multiRobots_4.length; _28++) { + _29 = multiRobots_4[_28], name = _29.name, _30 = _29.skills, primary = _30.primary, secondary = _30.secondary; + console.log(nameA); +} +for (var _31 = 0, _32 = getMultiRobots(); _31 < _32.length; _31++) { + _33 = _32[_31], name = _33.name, _34 = _33.skills, primary = _34.primary, secondary = _34.secondary; + console.log(nameA); +} +for (var _35 = 0, _36 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _35 < _36.length; _35++) { + _37 = _36[_35], name = _37.name, _38 = _37.skills, primary = _38.primary, secondary = _38.secondary; + console.log(nameA); +} +var _f, _j, _m, _u, _x, _0, _2, _5, _8, _10, _11, _14, _15, _18, _19, _21, _24, _27, _29, _30, _33, _34, _37, _38; +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map new file mode 100644 index 00000000000..c8610cbeef8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAmB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxB,yBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7B,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAA9F,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6D,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAtE,6BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6D,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAA3E,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6D,UACa,EADb,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADb,cACa,EADb,IACa,CAAC;IADxE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAY,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAjB,wBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAtB,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAvF,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAAhD,6BAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAArD,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,UACmC,EADnC,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC3G,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADnC,cACmC,EADnC,IACmC,CAAC;IADxE,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAE/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,GAAG,CAAC,CAAkC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAxC,iBAA6B,EAA5B,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAA7C,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAA9G,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAApF,uBAAoE,EAAnE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAAzF,cAAoE,EAAnE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,WACC,EADD,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC7I,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADD,gBACC,EADD,KACC,CAAC;IAD1E,cAAoE,EAAnE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IAEjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAzB,mBAAc,EAAb,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAA9B,cAAc,EAAb,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E,CAAC;IAA/F,cAAc,EAAb,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IAAvD,wBAAuC,EAAtC,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAA5D,cAAuC,EAAtC,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAC8B,EAD9B,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChH,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9B,gBAC8B,EAD9B,KAC8B,CAAC;IAD1E,cAAuC,EAAtC,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IAEpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..8a603317954 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt @@ -0,0 +1,3387 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPattern2.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(29, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(29, 20) + SourceIndex(0) +5 >Emitted(10, 20) Source(29, 36) + SourceIndex(0) +6 >Emitted(10, 22) Source(29, 38) + SourceIndex(0) +7 >Emitted(10, 32) Source(29, 56) + SourceIndex(0) +8 >Emitted(10, 34) Source(29, 58) + SourceIndex(0) +9 >Emitted(10, 35) Source(29, 67) + SourceIndex(0) +10>Emitted(10, 37) Source(29, 69) + SourceIndex(0) +11>Emitted(10, 43) Source(29, 83) + SourceIndex(0) +12>Emitted(10, 44) Source(29, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(11, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(11, 9) Source(30, 17) + SourceIndex(0) +4 >Emitted(11, 11) Source(30, 19) + SourceIndex(0) +5 >Emitted(11, 18) Source(30, 34) + SourceIndex(0) +6 >Emitted(11, 20) Source(30, 36) + SourceIndex(0) +7 >Emitted(11, 29) Source(30, 53) + SourceIndex(0) +8 >Emitted(11, 31) Source(30, 55) + SourceIndex(0) +9 >Emitted(11, 36) Source(30, 68) + SourceIndex(0) +10>Emitted(11, 37) Source(30, 69) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > +2 >for +3 > +4 > ({name: nameA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(12, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(32, 24) + SourceIndex(0) +5 >Emitted(12, 16) Source(32, 30) + SourceIndex(0) +6 >Emitted(12, 18) Source(32, 24) + SourceIndex(0) +7 >Emitted(12, 35) Source(32, 30) + SourceIndex(0) +8 >Emitted(12, 37) Source(32, 24) + SourceIndex(0) +9 >Emitted(12, 57) Source(32, 30) + SourceIndex(0) +10>Emitted(12, 59) Source(32, 24) + SourceIndex(0) +11>Emitted(12, 63) Source(32, 30) + SourceIndex(0) +12>Emitted(12, 64) Source(32, 31) + SourceIndex(0) +--- +>>> nameA = robots_1[_i].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA +1 >Emitted(13, 5) Source(32, 7) + SourceIndex(0) +2 >Emitted(13, 30) Source(32, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(15, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(16, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(35, 24) + SourceIndex(0) +5 >Emitted(16, 16) Source(35, 35) + SourceIndex(0) +6 >Emitted(16, 18) Source(35, 24) + SourceIndex(0) +7 >Emitted(16, 23) Source(35, 24) + SourceIndex(0) +8 >Emitted(16, 32) Source(35, 33) + SourceIndex(0) +9 >Emitted(16, 34) Source(35, 35) + SourceIndex(0) +10>Emitted(16, 36) Source(35, 24) + SourceIndex(0) +11>Emitted(16, 50) Source(35, 35) + SourceIndex(0) +12>Emitted(16, 52) Source(35, 24) + SourceIndex(0) +13>Emitted(16, 56) Source(35, 35) + SourceIndex(0) +14>Emitted(16, 57) Source(35, 36) + SourceIndex(0) +--- +>>> nameA = _b[_a].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^-> +1 > +2 > name: nameA +1 >Emitted(17, 5) Source(35, 7) + SourceIndex(0) +2 >Emitted(17, 24) Source(35, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 24) + SourceIndex(0) +5 >Emitted(20, 16) Source(38, 100) + SourceIndex(0) +6 >Emitted(20, 18) Source(38, 24) + SourceIndex(0) +7 >Emitted(20, 24) Source(38, 25) + SourceIndex(0) +8 >Emitted(20, 26) Source(38, 27) + SourceIndex(0) +9 >Emitted(20, 30) Source(38, 31) + SourceIndex(0) +10>Emitted(20, 32) Source(38, 33) + SourceIndex(0) +11>Emitted(20, 39) Source(38, 40) + SourceIndex(0) +12>Emitted(20, 41) Source(38, 42) + SourceIndex(0) +13>Emitted(20, 46) Source(38, 47) + SourceIndex(0) +14>Emitted(20, 48) Source(38, 49) + SourceIndex(0) +15>Emitted(20, 56) Source(38, 57) + SourceIndex(0) +16>Emitted(20, 58) Source(38, 59) + SourceIndex(0) +17>Emitted(20, 60) Source(38, 61) + SourceIndex(0) +18>Emitted(20, 62) Source(38, 63) + SourceIndex(0) +19>Emitted(20, 66) Source(38, 67) + SourceIndex(0) +20>Emitted(20, 68) Source(38, 69) + SourceIndex(0) +21>Emitted(20, 77) Source(38, 78) + SourceIndex(0) +22>Emitted(20, 79) Source(38, 80) + SourceIndex(0) +23>Emitted(20, 84) Source(38, 85) + SourceIndex(0) +24>Emitted(20, 86) Source(38, 87) + SourceIndex(0) +25>Emitted(20, 96) Source(38, 97) + SourceIndex(0) +26>Emitted(20, 98) Source(38, 99) + SourceIndex(0) +27>Emitted(20, 99) Source(38, 100) + SourceIndex(0) +28>Emitted(20, 101) Source(38, 24) + SourceIndex(0) +29>Emitted(20, 115) Source(38, 100) + SourceIndex(0) +30>Emitted(20, 117) Source(38, 24) + SourceIndex(0) +31>Emitted(20, 121) Source(38, 100) + SourceIndex(0) +32>Emitted(20, 122) Source(38, 101) + SourceIndex(0) +--- +>>> nameA = _d[_c].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^-> +1 > +2 > name: nameA +1 >Emitted(21, 5) Source(38, 7) + SourceIndex(0) +2 >Emitted(21, 24) Source(38, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(22, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(39, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(39, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(39, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(41, 66) + SourceIndex(0) +5 >Emitted(24, 16) Source(41, 77) + SourceIndex(0) +6 >Emitted(24, 18) Source(41, 66) + SourceIndex(0) +7 >Emitted(24, 45) Source(41, 77) + SourceIndex(0) +8 >Emitted(24, 47) Source(41, 66) + SourceIndex(0) +9 >Emitted(24, 72) Source(41, 77) + SourceIndex(0) +10>Emitted(24, 74) Source(41, 66) + SourceIndex(0) +11>Emitted(24, 78) Source(41, 77) + SourceIndex(0) +12>Emitted(24, 79) Source(41, 78) + SourceIndex(0) +--- +>>> _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(25, 5) Source(41, 8) + SourceIndex(0) +2 >Emitted(25, 34) Source(41, 60) + SourceIndex(0) +3 >Emitted(25, 36) Source(41, 18) + SourceIndex(0) +4 >Emitted(25, 57) Source(41, 35) + SourceIndex(0) +5 >Emitted(25, 59) Source(41, 37) + SourceIndex(0) +6 >Emitted(25, 84) Source(41, 58) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(42, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(42, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(42, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(42, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(42, 17) + SourceIndex(0) +6 >Emitted(26, 25) Source(42, 25) + SourceIndex(0) +7 >Emitted(26, 26) Source(42, 26) + SourceIndex(0) +8 >Emitted(26, 27) Source(42, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(27, 2) Source(43, 2) + SourceIndex(0) +--- +>>>for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(28, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(44, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(44, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(44, 66) + SourceIndex(0) +5 >Emitted(28, 16) Source(44, 82) + SourceIndex(0) +6 >Emitted(28, 18) Source(44, 66) + SourceIndex(0) +7 >Emitted(28, 23) Source(44, 66) + SourceIndex(0) +8 >Emitted(28, 37) Source(44, 80) + SourceIndex(0) +9 >Emitted(28, 39) Source(44, 82) + SourceIndex(0) +10>Emitted(28, 41) Source(44, 66) + SourceIndex(0) +11>Emitted(28, 55) Source(44, 82) + SourceIndex(0) +12>Emitted(28, 57) Source(44, 66) + SourceIndex(0) +13>Emitted(28, 61) Source(44, 82) + SourceIndex(0) +14>Emitted(28, 62) Source(44, 83) + SourceIndex(0) +--- +>>> _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(29, 5) Source(44, 8) + SourceIndex(0) +2 >Emitted(29, 23) Source(44, 60) + SourceIndex(0) +3 >Emitted(29, 25) Source(44, 18) + SourceIndex(0) +4 >Emitted(29, 46) Source(44, 35) + SourceIndex(0) +5 >Emitted(29, 48) Source(44, 37) + SourceIndex(0) +6 >Emitted(29, 73) Source(44, 58) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(30, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(30, 12) Source(45, 12) + SourceIndex(0) +3 >Emitted(30, 13) Source(45, 13) + SourceIndex(0) +4 >Emitted(30, 16) Source(45, 16) + SourceIndex(0) +5 >Emitted(30, 17) Source(45, 17) + SourceIndex(0) +6 >Emitted(30, 25) Source(45, 25) + SourceIndex(0) +7 >Emitted(30, 26) Source(45, 26) + SourceIndex(0) +8 >Emitted(30, 27) Source(45, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(31, 2) Source(46, 2) + SourceIndex(0) +--- +>>>for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(32, 1) Source(47, 1) + SourceIndex(0) +2 >Emitted(32, 4) Source(47, 4) + SourceIndex(0) +3 >Emitted(32, 5) Source(47, 5) + SourceIndex(0) +4 >Emitted(32, 6) Source(47, 66) + SourceIndex(0) +5 >Emitted(32, 16) Source(48, 79) + SourceIndex(0) +6 >Emitted(32, 18) Source(47, 66) + SourceIndex(0) +7 >Emitted(32, 24) Source(47, 67) + SourceIndex(0) +8 >Emitted(32, 26) Source(47, 69) + SourceIndex(0) +9 >Emitted(32, 30) Source(47, 73) + SourceIndex(0) +10>Emitted(32, 32) Source(47, 75) + SourceIndex(0) +11>Emitted(32, 39) Source(47, 82) + SourceIndex(0) +12>Emitted(32, 41) Source(47, 84) + SourceIndex(0) +13>Emitted(32, 47) Source(47, 90) + SourceIndex(0) +14>Emitted(32, 49) Source(47, 92) + SourceIndex(0) +15>Emitted(32, 51) Source(47, 94) + SourceIndex(0) +16>Emitted(32, 58) Source(47, 101) + SourceIndex(0) +17>Emitted(32, 60) Source(47, 103) + SourceIndex(0) +18>Emitted(32, 68) Source(47, 111) + SourceIndex(0) +19>Emitted(32, 70) Source(47, 113) + SourceIndex(0) +20>Emitted(32, 79) Source(47, 122) + SourceIndex(0) +21>Emitted(32, 81) Source(47, 124) + SourceIndex(0) +22>Emitted(32, 87) Source(47, 130) + SourceIndex(0) +23>Emitted(32, 89) Source(47, 132) + SourceIndex(0) +24>Emitted(32, 91) Source(47, 134) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(33, 5) Source(48, 5) + SourceIndex(0) +2 >Emitted(33, 7) Source(48, 7) + SourceIndex(0) +3 >Emitted(33, 11) Source(48, 11) + SourceIndex(0) +4 >Emitted(33, 13) Source(48, 13) + SourceIndex(0) +5 >Emitted(33, 22) Source(48, 22) + SourceIndex(0) +6 >Emitted(33, 24) Source(48, 24) + SourceIndex(0) +7 >Emitted(33, 30) Source(48, 30) + SourceIndex(0) +8 >Emitted(33, 32) Source(48, 32) + SourceIndex(0) +9 >Emitted(33, 34) Source(48, 34) + SourceIndex(0) +10>Emitted(33, 41) Source(48, 41) + SourceIndex(0) +11>Emitted(33, 43) Source(48, 43) + SourceIndex(0) +12>Emitted(33, 53) Source(48, 53) + SourceIndex(0) +13>Emitted(33, 55) Source(48, 55) + SourceIndex(0) +14>Emitted(33, 64) Source(48, 64) + SourceIndex(0) +15>Emitted(33, 66) Source(48, 66) + SourceIndex(0) +16>Emitted(33, 74) Source(48, 74) + SourceIndex(0) +17>Emitted(33, 76) Source(48, 76) + SourceIndex(0) +18>Emitted(33, 78) Source(48, 78) + SourceIndex(0) +19>Emitted(33, 79) Source(48, 79) + SourceIndex(0) +20>Emitted(33, 81) Source(47, 66) + SourceIndex(0) +21>Emitted(33, 95) Source(48, 79) + SourceIndex(0) +22>Emitted(33, 97) Source(47, 66) + SourceIndex(0) +23>Emitted(33, 101) Source(48, 79) + SourceIndex(0) +24>Emitted(33, 102) Source(48, 80) + SourceIndex(0) +--- +>>> _m = _l[_k].skills, primaryA = _m.primary, secondaryA = _m.secondary; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1 >Emitted(34, 5) Source(47, 8) + SourceIndex(0) +2 >Emitted(34, 23) Source(47, 60) + SourceIndex(0) +3 >Emitted(34, 25) Source(47, 18) + SourceIndex(0) +4 >Emitted(34, 46) Source(47, 35) + SourceIndex(0) +5 >Emitted(34, 48) Source(47, 37) + SourceIndex(0) +6 >Emitted(34, 73) Source(47, 58) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(49, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(49, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(49, 17) + SourceIndex(0) +6 >Emitted(35, 25) Source(49, 25) + SourceIndex(0) +7 >Emitted(35, 26) Source(49, 26) + SourceIndex(0) +8 >Emitted(35, 27) Source(49, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(50, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ({name } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(51, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(51, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(51, 17) + SourceIndex(0) +5 >Emitted(37, 16) Source(51, 23) + SourceIndex(0) +6 >Emitted(37, 18) Source(51, 17) + SourceIndex(0) +7 >Emitted(37, 35) Source(51, 23) + SourceIndex(0) +8 >Emitted(37, 37) Source(51, 17) + SourceIndex(0) +9 >Emitted(37, 57) Source(51, 23) + SourceIndex(0) +10>Emitted(37, 59) Source(51, 17) + SourceIndex(0) +11>Emitted(37, 63) Source(51, 23) + SourceIndex(0) +12>Emitted(37, 64) Source(51, 24) + SourceIndex(0) +--- +>>> name = robots_2[_o].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name +1 >Emitted(38, 5) Source(51, 7) + SourceIndex(0) +2 >Emitted(38, 29) Source(51, 11) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(52, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(52, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(52, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(52, 17) + SourceIndex(0) +6 >Emitted(39, 22) Source(52, 22) + SourceIndex(0) +7 >Emitted(39, 23) Source(52, 23) + SourceIndex(0) +8 >Emitted(39, 24) Source(52, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(53, 2) + SourceIndex(0) +--- +>>>for (var _p = 0, _q = getRobots(); _p < _q.length; _p++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(54, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(54, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(54, 17) + SourceIndex(0) +5 >Emitted(41, 16) Source(54, 28) + SourceIndex(0) +6 >Emitted(41, 18) Source(54, 17) + SourceIndex(0) +7 >Emitted(41, 23) Source(54, 17) + SourceIndex(0) +8 >Emitted(41, 32) Source(54, 26) + SourceIndex(0) +9 >Emitted(41, 34) Source(54, 28) + SourceIndex(0) +10>Emitted(41, 36) Source(54, 17) + SourceIndex(0) +11>Emitted(41, 50) Source(54, 28) + SourceIndex(0) +12>Emitted(41, 52) Source(54, 17) + SourceIndex(0) +13>Emitted(41, 56) Source(54, 28) + SourceIndex(0) +14>Emitted(41, 57) Source(54, 29) + SourceIndex(0) +--- +>>> name = _q[_p].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^-> +1 > +2 > name +1 >Emitted(42, 5) Source(54, 7) + SourceIndex(0) +2 >Emitted(42, 23) Source(54, 11) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(43, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(55, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(55, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(55, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(55, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(55, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(55, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(55, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(56, 2) + SourceIndex(0) +--- +>>>for (var _r = 0, _s = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _r < _s.length; _r++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(45, 1) Source(57, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(57, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(57, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(57, 17) + SourceIndex(0) +5 >Emitted(45, 16) Source(57, 93) + SourceIndex(0) +6 >Emitted(45, 18) Source(57, 17) + SourceIndex(0) +7 >Emitted(45, 24) Source(57, 18) + SourceIndex(0) +8 >Emitted(45, 26) Source(57, 20) + SourceIndex(0) +9 >Emitted(45, 30) Source(57, 24) + SourceIndex(0) +10>Emitted(45, 32) Source(57, 26) + SourceIndex(0) +11>Emitted(45, 39) Source(57, 33) + SourceIndex(0) +12>Emitted(45, 41) Source(57, 35) + SourceIndex(0) +13>Emitted(45, 46) Source(57, 40) + SourceIndex(0) +14>Emitted(45, 48) Source(57, 42) + SourceIndex(0) +15>Emitted(45, 56) Source(57, 50) + SourceIndex(0) +16>Emitted(45, 58) Source(57, 52) + SourceIndex(0) +17>Emitted(45, 60) Source(57, 54) + SourceIndex(0) +18>Emitted(45, 62) Source(57, 56) + SourceIndex(0) +19>Emitted(45, 66) Source(57, 60) + SourceIndex(0) +20>Emitted(45, 68) Source(57, 62) + SourceIndex(0) +21>Emitted(45, 77) Source(57, 71) + SourceIndex(0) +22>Emitted(45, 79) Source(57, 73) + SourceIndex(0) +23>Emitted(45, 84) Source(57, 78) + SourceIndex(0) +24>Emitted(45, 86) Source(57, 80) + SourceIndex(0) +25>Emitted(45, 96) Source(57, 90) + SourceIndex(0) +26>Emitted(45, 98) Source(57, 92) + SourceIndex(0) +27>Emitted(45, 99) Source(57, 93) + SourceIndex(0) +28>Emitted(45, 101) Source(57, 17) + SourceIndex(0) +29>Emitted(45, 115) Source(57, 93) + SourceIndex(0) +30>Emitted(45, 117) Source(57, 17) + SourceIndex(0) +31>Emitted(45, 121) Source(57, 93) + SourceIndex(0) +32>Emitted(45, 122) Source(57, 94) + SourceIndex(0) +--- +>>> name = _s[_r].name; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^-> +1 > +2 > name +1 >Emitted(46, 5) Source(57, 7) + SourceIndex(0) +2 >Emitted(46, 23) Source(57, 11) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(47, 5) Source(58, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(58, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(58, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(58, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(58, 17) + SourceIndex(0) +6 >Emitted(47, 22) Source(58, 22) + SourceIndex(0) +7 >Emitted(47, 23) Source(58, 23) + SourceIndex(0) +8 >Emitted(47, 24) Source(58, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(59, 2) + SourceIndex(0) +--- +>>>for (var _t = 0, multiRobots_2 = multiRobots; _t < multiRobots_2.length; _t++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary, secondary } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(60, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(60, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(60, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(60, 44) + SourceIndex(0) +5 >Emitted(49, 16) Source(60, 55) + SourceIndex(0) +6 >Emitted(49, 18) Source(60, 44) + SourceIndex(0) +7 >Emitted(49, 45) Source(60, 55) + SourceIndex(0) +8 >Emitted(49, 47) Source(60, 44) + SourceIndex(0) +9 >Emitted(49, 72) Source(60, 55) + SourceIndex(0) +10>Emitted(49, 74) Source(60, 44) + SourceIndex(0) +11>Emitted(49, 78) Source(60, 55) + SourceIndex(0) +12>Emitted(49, 79) Source(60, 56) + SourceIndex(0) +--- +>>> _u = multiRobots_2[_t].skills, primary = _u.primary, secondary = _u.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary, secondary } +3 > +4 > primary +5 > , +6 > secondary +1->Emitted(50, 5) Source(60, 8) + SourceIndex(0) +2 >Emitted(50, 34) Source(60, 38) + SourceIndex(0) +3 >Emitted(50, 36) Source(60, 18) + SourceIndex(0) +4 >Emitted(50, 56) Source(60, 25) + SourceIndex(0) +5 >Emitted(50, 58) Source(60, 27) + SourceIndex(0) +6 >Emitted(50, 82) Source(60, 36) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(51, 5) Source(61, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(61, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(61, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(61, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(61, 17) + SourceIndex(0) +6 >Emitted(51, 25) Source(61, 25) + SourceIndex(0) +7 >Emitted(51, 26) Source(61, 26) + SourceIndex(0) +8 >Emitted(51, 27) Source(61, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(62, 2) + SourceIndex(0) +--- +>>>for (var _v = 0, _w = getMultiRobots(); _v < _w.length; _v++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary, secondary } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(63, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(63, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(63, 44) + SourceIndex(0) +5 >Emitted(53, 16) Source(63, 60) + SourceIndex(0) +6 >Emitted(53, 18) Source(63, 44) + SourceIndex(0) +7 >Emitted(53, 23) Source(63, 44) + SourceIndex(0) +8 >Emitted(53, 37) Source(63, 58) + SourceIndex(0) +9 >Emitted(53, 39) Source(63, 60) + SourceIndex(0) +10>Emitted(53, 41) Source(63, 44) + SourceIndex(0) +11>Emitted(53, 55) Source(63, 60) + SourceIndex(0) +12>Emitted(53, 57) Source(63, 44) + SourceIndex(0) +13>Emitted(53, 61) Source(63, 60) + SourceIndex(0) +14>Emitted(53, 62) Source(63, 61) + SourceIndex(0) +--- +>>> _x = _w[_v].skills, primary = _x.primary, secondary = _x.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary, secondary } +3 > +4 > primary +5 > , +6 > secondary +1->Emitted(54, 5) Source(63, 8) + SourceIndex(0) +2 >Emitted(54, 23) Source(63, 38) + SourceIndex(0) +3 >Emitted(54, 25) Source(63, 18) + SourceIndex(0) +4 >Emitted(54, 45) Source(63, 25) + SourceIndex(0) +5 >Emitted(54, 47) Source(63, 27) + SourceIndex(0) +6 >Emitted(54, 71) Source(63, 36) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(55, 5) Source(64, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(64, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(64, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(64, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(64, 17) + SourceIndex(0) +6 >Emitted(55, 25) Source(64, 25) + SourceIndex(0) +7 >Emitted(55, 26) Source(64, 26) + SourceIndex(0) +8 >Emitted(55, 27) Source(64, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(65, 2) + SourceIndex(0) +--- +>>>for (var _y = 0, _z = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary, secondary } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(57, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(66, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(66, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(66, 44) + SourceIndex(0) +5 >Emitted(57, 16) Source(67, 79) + SourceIndex(0) +6 >Emitted(57, 18) Source(66, 44) + SourceIndex(0) +7 >Emitted(57, 24) Source(66, 45) + SourceIndex(0) +8 >Emitted(57, 26) Source(66, 47) + SourceIndex(0) +9 >Emitted(57, 30) Source(66, 51) + SourceIndex(0) +10>Emitted(57, 32) Source(66, 53) + SourceIndex(0) +11>Emitted(57, 39) Source(66, 60) + SourceIndex(0) +12>Emitted(57, 41) Source(66, 62) + SourceIndex(0) +13>Emitted(57, 47) Source(66, 68) + SourceIndex(0) +14>Emitted(57, 49) Source(66, 70) + SourceIndex(0) +15>Emitted(57, 51) Source(66, 72) + SourceIndex(0) +16>Emitted(57, 58) Source(66, 79) + SourceIndex(0) +17>Emitted(57, 60) Source(66, 81) + SourceIndex(0) +18>Emitted(57, 68) Source(66, 89) + SourceIndex(0) +19>Emitted(57, 70) Source(66, 91) + SourceIndex(0) +20>Emitted(57, 79) Source(66, 100) + SourceIndex(0) +21>Emitted(57, 81) Source(66, 102) + SourceIndex(0) +22>Emitted(57, 87) Source(66, 108) + SourceIndex(0) +23>Emitted(57, 89) Source(66, 110) + SourceIndex(0) +24>Emitted(57, 91) Source(66, 112) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _y < _z.length; _y++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(58, 5) Source(67, 5) + SourceIndex(0) +2 >Emitted(58, 7) Source(67, 7) + SourceIndex(0) +3 >Emitted(58, 11) Source(67, 11) + SourceIndex(0) +4 >Emitted(58, 13) Source(67, 13) + SourceIndex(0) +5 >Emitted(58, 22) Source(67, 22) + SourceIndex(0) +6 >Emitted(58, 24) Source(67, 24) + SourceIndex(0) +7 >Emitted(58, 30) Source(67, 30) + SourceIndex(0) +8 >Emitted(58, 32) Source(67, 32) + SourceIndex(0) +9 >Emitted(58, 34) Source(67, 34) + SourceIndex(0) +10>Emitted(58, 41) Source(67, 41) + SourceIndex(0) +11>Emitted(58, 43) Source(67, 43) + SourceIndex(0) +12>Emitted(58, 53) Source(67, 53) + SourceIndex(0) +13>Emitted(58, 55) Source(67, 55) + SourceIndex(0) +14>Emitted(58, 64) Source(67, 64) + SourceIndex(0) +15>Emitted(58, 66) Source(67, 66) + SourceIndex(0) +16>Emitted(58, 74) Source(67, 74) + SourceIndex(0) +17>Emitted(58, 76) Source(67, 76) + SourceIndex(0) +18>Emitted(58, 78) Source(67, 78) + SourceIndex(0) +19>Emitted(58, 79) Source(67, 79) + SourceIndex(0) +20>Emitted(58, 81) Source(66, 44) + SourceIndex(0) +21>Emitted(58, 95) Source(67, 79) + SourceIndex(0) +22>Emitted(58, 97) Source(66, 44) + SourceIndex(0) +23>Emitted(58, 101) Source(67, 79) + SourceIndex(0) +24>Emitted(58, 102) Source(67, 80) + SourceIndex(0) +--- +>>> _0 = _z[_y].skills, primary = _0.primary, secondary = _0.secondary; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > skills: { primary, secondary } +3 > +4 > primary +5 > , +6 > secondary +1 >Emitted(59, 5) Source(66, 8) + SourceIndex(0) +2 >Emitted(59, 23) Source(66, 38) + SourceIndex(0) +3 >Emitted(59, 25) Source(66, 18) + SourceIndex(0) +4 >Emitted(59, 45) Source(66, 25) + SourceIndex(0) +5 >Emitted(59, 47) Source(66, 27) + SourceIndex(0) +6 >Emitted(59, 71) Source(66, 36) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(60, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(60, 12) Source(68, 12) + SourceIndex(0) +3 >Emitted(60, 13) Source(68, 13) + SourceIndex(0) +4 >Emitted(60, 16) Source(68, 16) + SourceIndex(0) +5 >Emitted(60, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(60, 25) Source(68, 25) + SourceIndex(0) +7 >Emitted(60, 26) Source(68, 26) + SourceIndex(0) +8 >Emitted(60, 27) Source(68, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(61, 2) Source(69, 2) + SourceIndex(0) +--- +>>>for (var _1 = 0, robots_3 = robots; _1 < robots_3.length; _1++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +1-> + > + > + > +2 >for +3 > +4 > ({name: nameA, skill: skillA } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(62, 1) Source(72, 1) + SourceIndex(0) +2 >Emitted(62, 4) Source(72, 4) + SourceIndex(0) +3 >Emitted(62, 5) Source(72, 5) + SourceIndex(0) +4 >Emitted(62, 6) Source(72, 39) + SourceIndex(0) +5 >Emitted(62, 16) Source(72, 45) + SourceIndex(0) +6 >Emitted(62, 18) Source(72, 39) + SourceIndex(0) +7 >Emitted(62, 35) Source(72, 45) + SourceIndex(0) +8 >Emitted(62, 37) Source(72, 39) + SourceIndex(0) +9 >Emitted(62, 57) Source(72, 45) + SourceIndex(0) +10>Emitted(62, 59) Source(72, 39) + SourceIndex(0) +11>Emitted(62, 63) Source(72, 45) + SourceIndex(0) +12>Emitted(62, 64) Source(72, 46) + SourceIndex(0) +--- +>>> _2 = robots_3[_1], nameA = _2.name, skillA = _2.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(63, 5) Source(72, 6) + SourceIndex(0) +2 >Emitted(63, 22) Source(72, 35) + SourceIndex(0) +3 >Emitted(63, 24) Source(72, 7) + SourceIndex(0) +4 >Emitted(63, 39) Source(72, 18) + SourceIndex(0) +5 >Emitted(63, 41) Source(72, 20) + SourceIndex(0) +6 >Emitted(63, 58) Source(72, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(73, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(73, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(73, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(73, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(73, 17) + SourceIndex(0) +6 >Emitted(64, 22) Source(73, 22) + SourceIndex(0) +7 >Emitted(64, 23) Source(73, 23) + SourceIndex(0) +8 >Emitted(64, 24) Source(73, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(65, 2) Source(74, 2) + SourceIndex(0) +--- +>>>for (var _3 = 0, _4 = getRobots(); _3 < _4.length; _3++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA, skill: skillA } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(66, 1) Source(75, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(75, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(75, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(75, 39) + SourceIndex(0) +5 >Emitted(66, 16) Source(75, 50) + SourceIndex(0) +6 >Emitted(66, 18) Source(75, 39) + SourceIndex(0) +7 >Emitted(66, 23) Source(75, 39) + SourceIndex(0) +8 >Emitted(66, 32) Source(75, 48) + SourceIndex(0) +9 >Emitted(66, 34) Source(75, 50) + SourceIndex(0) +10>Emitted(66, 36) Source(75, 39) + SourceIndex(0) +11>Emitted(66, 50) Source(75, 50) + SourceIndex(0) +12>Emitted(66, 52) Source(75, 39) + SourceIndex(0) +13>Emitted(66, 56) Source(75, 50) + SourceIndex(0) +14>Emitted(66, 57) Source(75, 51) + SourceIndex(0) +--- +>>> _5 = _4[_3], nameA = _5.name, skillA = _5.skill; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(67, 5) Source(75, 6) + SourceIndex(0) +2 >Emitted(67, 16) Source(75, 35) + SourceIndex(0) +3 >Emitted(67, 18) Source(75, 7) + SourceIndex(0) +4 >Emitted(67, 33) Source(75, 18) + SourceIndex(0) +5 >Emitted(67, 35) Source(75, 20) + SourceIndex(0) +6 >Emitted(67, 52) Source(75, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(68, 5) Source(76, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(76, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(76, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(76, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(76, 17) + SourceIndex(0) +6 >Emitted(68, 22) Source(76, 22) + SourceIndex(0) +7 >Emitted(68, 23) Source(76, 23) + SourceIndex(0) +8 >Emitted(68, 24) Source(76, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(69, 2) Source(77, 2) + SourceIndex(0) +--- +>>>for (var _6 = 0, _7 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _6 < _7.length; _6++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA, skill: skillA } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(70, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(78, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(78, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(78, 39) + SourceIndex(0) +5 >Emitted(70, 16) Source(78, 115) + SourceIndex(0) +6 >Emitted(70, 18) Source(78, 39) + SourceIndex(0) +7 >Emitted(70, 24) Source(78, 40) + SourceIndex(0) +8 >Emitted(70, 26) Source(78, 42) + SourceIndex(0) +9 >Emitted(70, 30) Source(78, 46) + SourceIndex(0) +10>Emitted(70, 32) Source(78, 48) + SourceIndex(0) +11>Emitted(70, 39) Source(78, 55) + SourceIndex(0) +12>Emitted(70, 41) Source(78, 57) + SourceIndex(0) +13>Emitted(70, 46) Source(78, 62) + SourceIndex(0) +14>Emitted(70, 48) Source(78, 64) + SourceIndex(0) +15>Emitted(70, 56) Source(78, 72) + SourceIndex(0) +16>Emitted(70, 58) Source(78, 74) + SourceIndex(0) +17>Emitted(70, 60) Source(78, 76) + SourceIndex(0) +18>Emitted(70, 62) Source(78, 78) + SourceIndex(0) +19>Emitted(70, 66) Source(78, 82) + SourceIndex(0) +20>Emitted(70, 68) Source(78, 84) + SourceIndex(0) +21>Emitted(70, 77) Source(78, 93) + SourceIndex(0) +22>Emitted(70, 79) Source(78, 95) + SourceIndex(0) +23>Emitted(70, 84) Source(78, 100) + SourceIndex(0) +24>Emitted(70, 86) Source(78, 102) + SourceIndex(0) +25>Emitted(70, 96) Source(78, 112) + SourceIndex(0) +26>Emitted(70, 98) Source(78, 114) + SourceIndex(0) +27>Emitted(70, 99) Source(78, 115) + SourceIndex(0) +28>Emitted(70, 101) Source(78, 39) + SourceIndex(0) +29>Emitted(70, 115) Source(78, 115) + SourceIndex(0) +30>Emitted(70, 117) Source(78, 39) + SourceIndex(0) +31>Emitted(70, 121) Source(78, 115) + SourceIndex(0) +32>Emitted(70, 122) Source(78, 116) + SourceIndex(0) +--- +>>> _8 = _7[_6], nameA = _8.name, skillA = _8.skill; +1 >^^^^ +2 > ^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name: nameA, skill: skillA } +3 > +4 > name: nameA +5 > , +6 > skill: skillA +1 >Emitted(71, 5) Source(78, 6) + SourceIndex(0) +2 >Emitted(71, 16) Source(78, 35) + SourceIndex(0) +3 >Emitted(71, 18) Source(78, 7) + SourceIndex(0) +4 >Emitted(71, 33) Source(78, 18) + SourceIndex(0) +5 >Emitted(71, 35) Source(78, 20) + SourceIndex(0) +6 >Emitted(71, 52) Source(78, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(79, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(79, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(79, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(73, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, multiRobots_3 = multiRobots; _9 < multiRobots_3.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(74, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(81, 78) + SourceIndex(0) +5 >Emitted(74, 16) Source(81, 89) + SourceIndex(0) +6 >Emitted(74, 18) Source(81, 78) + SourceIndex(0) +7 >Emitted(74, 45) Source(81, 89) + SourceIndex(0) +8 >Emitted(74, 47) Source(81, 78) + SourceIndex(0) +9 >Emitted(74, 72) Source(81, 89) + SourceIndex(0) +10>Emitted(74, 74) Source(81, 78) + SourceIndex(0) +11>Emitted(74, 78) Source(81, 89) + SourceIndex(0) +12>Emitted(74, 79) Source(81, 90) + SourceIndex(0) +--- +>>> _10 = multiRobots_3[_9], nameA = _10.name, _11 = _10.skills, primaryA = _11.primary, secondaryA = _11.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(75, 5) Source(81, 6) + SourceIndex(0) +2 >Emitted(75, 28) Source(81, 74) + SourceIndex(0) +3 >Emitted(75, 30) Source(81, 7) + SourceIndex(0) +4 >Emitted(75, 46) Source(81, 18) + SourceIndex(0) +5 >Emitted(75, 48) Source(81, 20) + SourceIndex(0) +6 >Emitted(75, 64) Source(81, 72) + SourceIndex(0) +7 >Emitted(75, 66) Source(81, 30) + SourceIndex(0) +8 >Emitted(75, 88) Source(81, 47) + SourceIndex(0) +9 >Emitted(75, 90) Source(81, 49) + SourceIndex(0) +10>Emitted(75, 116) Source(81, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(76, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(82, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(82, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(82, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(82, 17) + SourceIndex(0) +6 >Emitted(76, 22) Source(82, 22) + SourceIndex(0) +7 >Emitted(76, 23) Source(82, 23) + SourceIndex(0) +8 >Emitted(76, 24) Source(82, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(77, 2) Source(83, 2) + SourceIndex(0) +--- +>>>for (var _12 = 0, _13 = getMultiRobots(); _12 < _13.length; _12++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(78, 1) Source(84, 1) + SourceIndex(0) +2 >Emitted(78, 4) Source(84, 4) + SourceIndex(0) +3 >Emitted(78, 5) Source(84, 5) + SourceIndex(0) +4 >Emitted(78, 6) Source(84, 78) + SourceIndex(0) +5 >Emitted(78, 17) Source(84, 94) + SourceIndex(0) +6 >Emitted(78, 19) Source(84, 78) + SourceIndex(0) +7 >Emitted(78, 25) Source(84, 78) + SourceIndex(0) +8 >Emitted(78, 39) Source(84, 92) + SourceIndex(0) +9 >Emitted(78, 41) Source(84, 94) + SourceIndex(0) +10>Emitted(78, 43) Source(84, 78) + SourceIndex(0) +11>Emitted(78, 59) Source(84, 94) + SourceIndex(0) +12>Emitted(78, 61) Source(84, 78) + SourceIndex(0) +13>Emitted(78, 66) Source(84, 94) + SourceIndex(0) +14>Emitted(78, 67) Source(84, 95) + SourceIndex(0) +--- +>>> _14 = _13[_12], nameA = _14.name, _15 = _14.skills, primaryA = _15.primary, secondaryA = _15.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(79, 5) Source(84, 6) + SourceIndex(0) +2 >Emitted(79, 19) Source(84, 74) + SourceIndex(0) +3 >Emitted(79, 21) Source(84, 7) + SourceIndex(0) +4 >Emitted(79, 37) Source(84, 18) + SourceIndex(0) +5 >Emitted(79, 39) Source(84, 20) + SourceIndex(0) +6 >Emitted(79, 55) Source(84, 72) + SourceIndex(0) +7 >Emitted(79, 57) Source(84, 30) + SourceIndex(0) +8 >Emitted(79, 79) Source(84, 47) + SourceIndex(0) +9 >Emitted(79, 81) Source(84, 49) + SourceIndex(0) +10>Emitted(79, 107) Source(84, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(80, 5) Source(85, 5) + SourceIndex(0) +2 >Emitted(80, 12) Source(85, 12) + SourceIndex(0) +3 >Emitted(80, 13) Source(85, 13) + SourceIndex(0) +4 >Emitted(80, 16) Source(85, 16) + SourceIndex(0) +5 >Emitted(80, 17) Source(85, 17) + SourceIndex(0) +6 >Emitted(80, 22) Source(85, 22) + SourceIndex(0) +7 >Emitted(80, 23) Source(85, 23) + SourceIndex(0) +8 >Emitted(80, 24) Source(85, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(81, 2) Source(86, 2) + SourceIndex(0) +--- +>>>for (var _16 = 0, _17 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(82, 1) Source(87, 1) + SourceIndex(0) +2 >Emitted(82, 4) Source(87, 4) + SourceIndex(0) +3 >Emitted(82, 5) Source(87, 5) + SourceIndex(0) +4 >Emitted(82, 6) Source(87, 78) + SourceIndex(0) +5 >Emitted(82, 17) Source(88, 79) + SourceIndex(0) +6 >Emitted(82, 19) Source(87, 78) + SourceIndex(0) +7 >Emitted(82, 26) Source(87, 79) + SourceIndex(0) +8 >Emitted(82, 28) Source(87, 81) + SourceIndex(0) +9 >Emitted(82, 32) Source(87, 85) + SourceIndex(0) +10>Emitted(82, 34) Source(87, 87) + SourceIndex(0) +11>Emitted(82, 41) Source(87, 94) + SourceIndex(0) +12>Emitted(82, 43) Source(87, 96) + SourceIndex(0) +13>Emitted(82, 49) Source(87, 102) + SourceIndex(0) +14>Emitted(82, 51) Source(87, 104) + SourceIndex(0) +15>Emitted(82, 53) Source(87, 106) + SourceIndex(0) +16>Emitted(82, 60) Source(87, 113) + SourceIndex(0) +17>Emitted(82, 62) Source(87, 115) + SourceIndex(0) +18>Emitted(82, 70) Source(87, 123) + SourceIndex(0) +19>Emitted(82, 72) Source(87, 125) + SourceIndex(0) +20>Emitted(82, 81) Source(87, 134) + SourceIndex(0) +21>Emitted(82, 83) Source(87, 136) + SourceIndex(0) +22>Emitted(82, 89) Source(87, 142) + SourceIndex(0) +23>Emitted(82, 91) Source(87, 144) + SourceIndex(0) +24>Emitted(82, 93) Source(87, 146) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _16 < _17.length; _16++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(83, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(83, 7) Source(88, 7) + SourceIndex(0) +3 >Emitted(83, 11) Source(88, 11) + SourceIndex(0) +4 >Emitted(83, 13) Source(88, 13) + SourceIndex(0) +5 >Emitted(83, 22) Source(88, 22) + SourceIndex(0) +6 >Emitted(83, 24) Source(88, 24) + SourceIndex(0) +7 >Emitted(83, 30) Source(88, 30) + SourceIndex(0) +8 >Emitted(83, 32) Source(88, 32) + SourceIndex(0) +9 >Emitted(83, 34) Source(88, 34) + SourceIndex(0) +10>Emitted(83, 41) Source(88, 41) + SourceIndex(0) +11>Emitted(83, 43) Source(88, 43) + SourceIndex(0) +12>Emitted(83, 53) Source(88, 53) + SourceIndex(0) +13>Emitted(83, 55) Source(88, 55) + SourceIndex(0) +14>Emitted(83, 64) Source(88, 64) + SourceIndex(0) +15>Emitted(83, 66) Source(88, 66) + SourceIndex(0) +16>Emitted(83, 74) Source(88, 74) + SourceIndex(0) +17>Emitted(83, 76) Source(88, 76) + SourceIndex(0) +18>Emitted(83, 78) Source(88, 78) + SourceIndex(0) +19>Emitted(83, 79) Source(88, 79) + SourceIndex(0) +20>Emitted(83, 81) Source(87, 78) + SourceIndex(0) +21>Emitted(83, 97) Source(88, 79) + SourceIndex(0) +22>Emitted(83, 99) Source(87, 78) + SourceIndex(0) +23>Emitted(83, 104) Source(88, 79) + SourceIndex(0) +24>Emitted(83, 105) Source(88, 80) + SourceIndex(0) +--- +>>> _18 = _17[_16], nameA = _18.name, _19 = _18.skills, primaryA = _19.primary, secondaryA = _19.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +1->Emitted(84, 5) Source(87, 6) + SourceIndex(0) +2 >Emitted(84, 19) Source(87, 74) + SourceIndex(0) +3 >Emitted(84, 21) Source(87, 7) + SourceIndex(0) +4 >Emitted(84, 37) Source(87, 18) + SourceIndex(0) +5 >Emitted(84, 39) Source(87, 20) + SourceIndex(0) +6 >Emitted(84, 55) Source(87, 72) + SourceIndex(0) +7 >Emitted(84, 57) Source(87, 30) + SourceIndex(0) +8 >Emitted(84, 79) Source(87, 47) + SourceIndex(0) +9 >Emitted(84, 81) Source(87, 49) + SourceIndex(0) +10>Emitted(84, 107) Source(87, 70) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(85, 5) Source(89, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(89, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(89, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(89, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(89, 17) + SourceIndex(0) +6 >Emitted(85, 22) Source(89, 22) + SourceIndex(0) +7 >Emitted(85, 23) Source(89, 23) + SourceIndex(0) +8 >Emitted(85, 24) Source(89, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(86, 2) Source(90, 2) + SourceIndex(0) +--- +>>>for (var _20 = 0, robots_4 = robots; _20 < robots_4.length; _20++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +1-> + > +2 >for +3 > +4 > ({name, skill } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(87, 1) Source(91, 1) + SourceIndex(0) +2 >Emitted(87, 4) Source(91, 4) + SourceIndex(0) +3 >Emitted(87, 5) Source(91, 5) + SourceIndex(0) +4 >Emitted(87, 6) Source(91, 24) + SourceIndex(0) +5 >Emitted(87, 17) Source(91, 30) + SourceIndex(0) +6 >Emitted(87, 19) Source(91, 24) + SourceIndex(0) +7 >Emitted(87, 36) Source(91, 30) + SourceIndex(0) +8 >Emitted(87, 38) Source(91, 24) + SourceIndex(0) +9 >Emitted(87, 59) Source(91, 30) + SourceIndex(0) +10>Emitted(87, 61) Source(91, 24) + SourceIndex(0) +11>Emitted(87, 66) Source(91, 30) + SourceIndex(0) +12>Emitted(87, 67) Source(91, 31) + SourceIndex(0) +--- +>>> _21 = robots_4[_20], name = _21.name, skill = _21.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name, skill } +3 > +4 > name +5 > , +6 > skill +1 >Emitted(88, 5) Source(91, 6) + SourceIndex(0) +2 >Emitted(88, 24) Source(91, 20) + SourceIndex(0) +3 >Emitted(88, 26) Source(91, 7) + SourceIndex(0) +4 >Emitted(88, 41) Source(91, 11) + SourceIndex(0) +5 >Emitted(88, 43) Source(91, 13) + SourceIndex(0) +6 >Emitted(88, 60) Source(91, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(89, 5) Source(92, 5) + SourceIndex(0) +2 >Emitted(89, 12) Source(92, 12) + SourceIndex(0) +3 >Emitted(89, 13) Source(92, 13) + SourceIndex(0) +4 >Emitted(89, 16) Source(92, 16) + SourceIndex(0) +5 >Emitted(89, 17) Source(92, 17) + SourceIndex(0) +6 >Emitted(89, 22) Source(92, 22) + SourceIndex(0) +7 >Emitted(89, 23) Source(92, 23) + SourceIndex(0) +8 >Emitted(89, 24) Source(92, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(90, 2) Source(93, 2) + SourceIndex(0) +--- +>>>for (var _22 = 0, _23 = getRobots(); _22 < _23.length; _22++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +1-> + > +2 >for +3 > +4 > ({name, skill } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(91, 1) Source(94, 1) + SourceIndex(0) +2 >Emitted(91, 4) Source(94, 4) + SourceIndex(0) +3 >Emitted(91, 5) Source(94, 5) + SourceIndex(0) +4 >Emitted(91, 6) Source(94, 24) + SourceIndex(0) +5 >Emitted(91, 17) Source(94, 35) + SourceIndex(0) +6 >Emitted(91, 19) Source(94, 24) + SourceIndex(0) +7 >Emitted(91, 25) Source(94, 24) + SourceIndex(0) +8 >Emitted(91, 34) Source(94, 33) + SourceIndex(0) +9 >Emitted(91, 36) Source(94, 35) + SourceIndex(0) +10>Emitted(91, 38) Source(94, 24) + SourceIndex(0) +11>Emitted(91, 54) Source(94, 35) + SourceIndex(0) +12>Emitted(91, 56) Source(94, 24) + SourceIndex(0) +13>Emitted(91, 61) Source(94, 35) + SourceIndex(0) +14>Emitted(91, 62) Source(94, 36) + SourceIndex(0) +--- +>>> _24 = _23[_22], name = _24.name, skill = _24.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name, skill } +3 > +4 > name +5 > , +6 > skill +1 >Emitted(92, 5) Source(94, 6) + SourceIndex(0) +2 >Emitted(92, 19) Source(94, 20) + SourceIndex(0) +3 >Emitted(92, 21) Source(94, 7) + SourceIndex(0) +4 >Emitted(92, 36) Source(94, 11) + SourceIndex(0) +5 >Emitted(92, 38) Source(94, 13) + SourceIndex(0) +6 >Emitted(92, 55) Source(94, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(93, 5) Source(95, 5) + SourceIndex(0) +2 >Emitted(93, 12) Source(95, 12) + SourceIndex(0) +3 >Emitted(93, 13) Source(95, 13) + SourceIndex(0) +4 >Emitted(93, 16) Source(95, 16) + SourceIndex(0) +5 >Emitted(93, 17) Source(95, 17) + SourceIndex(0) +6 >Emitted(93, 22) Source(95, 22) + SourceIndex(0) +7 >Emitted(93, 23) Source(95, 23) + SourceIndex(0) +8 >Emitted(93, 24) Source(95, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(94, 2) Source(96, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, _26 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _25 < _26.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name, skill } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(95, 1) Source(97, 1) + SourceIndex(0) +2 >Emitted(95, 4) Source(97, 4) + SourceIndex(0) +3 >Emitted(95, 5) Source(97, 5) + SourceIndex(0) +4 >Emitted(95, 6) Source(97, 24) + SourceIndex(0) +5 >Emitted(95, 17) Source(97, 100) + SourceIndex(0) +6 >Emitted(95, 19) Source(97, 24) + SourceIndex(0) +7 >Emitted(95, 26) Source(97, 25) + SourceIndex(0) +8 >Emitted(95, 28) Source(97, 27) + SourceIndex(0) +9 >Emitted(95, 32) Source(97, 31) + SourceIndex(0) +10>Emitted(95, 34) Source(97, 33) + SourceIndex(0) +11>Emitted(95, 41) Source(97, 40) + SourceIndex(0) +12>Emitted(95, 43) Source(97, 42) + SourceIndex(0) +13>Emitted(95, 48) Source(97, 47) + SourceIndex(0) +14>Emitted(95, 50) Source(97, 49) + SourceIndex(0) +15>Emitted(95, 58) Source(97, 57) + SourceIndex(0) +16>Emitted(95, 60) Source(97, 59) + SourceIndex(0) +17>Emitted(95, 62) Source(97, 61) + SourceIndex(0) +18>Emitted(95, 64) Source(97, 63) + SourceIndex(0) +19>Emitted(95, 68) Source(97, 67) + SourceIndex(0) +20>Emitted(95, 70) Source(97, 69) + SourceIndex(0) +21>Emitted(95, 79) Source(97, 78) + SourceIndex(0) +22>Emitted(95, 81) Source(97, 80) + SourceIndex(0) +23>Emitted(95, 86) Source(97, 85) + SourceIndex(0) +24>Emitted(95, 88) Source(97, 87) + SourceIndex(0) +25>Emitted(95, 98) Source(97, 97) + SourceIndex(0) +26>Emitted(95, 100) Source(97, 99) + SourceIndex(0) +27>Emitted(95, 101) Source(97, 100) + SourceIndex(0) +28>Emitted(95, 103) Source(97, 24) + SourceIndex(0) +29>Emitted(95, 119) Source(97, 100) + SourceIndex(0) +30>Emitted(95, 121) Source(97, 24) + SourceIndex(0) +31>Emitted(95, 126) Source(97, 100) + SourceIndex(0) +32>Emitted(95, 127) Source(97, 101) + SourceIndex(0) +--- +>>> _27 = _26[_25], name = _27.name, skill = _27.skill; +1 >^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +1 > +2 > {name, skill } +3 > +4 > name +5 > , +6 > skill +1 >Emitted(96, 5) Source(97, 6) + SourceIndex(0) +2 >Emitted(96, 19) Source(97, 20) + SourceIndex(0) +3 >Emitted(96, 21) Source(97, 7) + SourceIndex(0) +4 >Emitted(96, 36) Source(97, 11) + SourceIndex(0) +5 >Emitted(96, 38) Source(97, 13) + SourceIndex(0) +6 >Emitted(96, 55) Source(97, 18) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(97, 5) Source(98, 5) + SourceIndex(0) +2 >Emitted(97, 12) Source(98, 12) + SourceIndex(0) +3 >Emitted(97, 13) Source(98, 13) + SourceIndex(0) +4 >Emitted(97, 16) Source(98, 16) + SourceIndex(0) +5 >Emitted(97, 17) Source(98, 17) + SourceIndex(0) +6 >Emitted(97, 22) Source(98, 22) + SourceIndex(0) +7 >Emitted(97, 23) Source(98, 23) + SourceIndex(0) +8 >Emitted(97, 24) Source(98, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(98, 2) Source(99, 2) + SourceIndex(0) +--- +>>>for (var _28 = 0, multiRobots_4 = multiRobots; _28 < multiRobots_4.length; _28++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name, skills: { primary, secondary } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(99, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(99, 4) Source(100, 4) + SourceIndex(0) +3 >Emitted(99, 5) Source(100, 5) + SourceIndex(0) +4 >Emitted(99, 6) Source(100, 49) + SourceIndex(0) +5 >Emitted(99, 17) Source(100, 60) + SourceIndex(0) +6 >Emitted(99, 19) Source(100, 49) + SourceIndex(0) +7 >Emitted(99, 46) Source(100, 60) + SourceIndex(0) +8 >Emitted(99, 48) Source(100, 49) + SourceIndex(0) +9 >Emitted(99, 74) Source(100, 60) + SourceIndex(0) +10>Emitted(99, 76) Source(100, 49) + SourceIndex(0) +11>Emitted(99, 81) Source(100, 60) + SourceIndex(0) +12>Emitted(99, 82) Source(100, 61) + SourceIndex(0) +--- +>>> _29 = multiRobots_4[_28], name = _29.name, _30 = _29.skills, primary = _30.primary, secondary = _30.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name, skills: { primary, secondary } } +3 > +4 > name +5 > , +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +1->Emitted(100, 5) Source(100, 6) + SourceIndex(0) +2 >Emitted(100, 29) Source(100, 45) + SourceIndex(0) +3 >Emitted(100, 31) Source(100, 7) + SourceIndex(0) +4 >Emitted(100, 46) Source(100, 11) + SourceIndex(0) +5 >Emitted(100, 48) Source(100, 13) + SourceIndex(0) +6 >Emitted(100, 64) Source(100, 43) + SourceIndex(0) +7 >Emitted(100, 66) Source(100, 23) + SourceIndex(0) +8 >Emitted(100, 87) Source(100, 30) + SourceIndex(0) +9 >Emitted(100, 89) Source(100, 32) + SourceIndex(0) +10>Emitted(100, 114) Source(100, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(101, 5) Source(101, 5) + SourceIndex(0) +2 >Emitted(101, 12) Source(101, 12) + SourceIndex(0) +3 >Emitted(101, 13) Source(101, 13) + SourceIndex(0) +4 >Emitted(101, 16) Source(101, 16) + SourceIndex(0) +5 >Emitted(101, 17) Source(101, 17) + SourceIndex(0) +6 >Emitted(101, 22) Source(101, 22) + SourceIndex(0) +7 >Emitted(101, 23) Source(101, 23) + SourceIndex(0) +8 >Emitted(101, 24) Source(101, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(102, 2) Source(102, 2) + SourceIndex(0) +--- +>>>for (var _31 = 0, _32 = getMultiRobots(); _31 < _32.length; _31++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name, skills: { primary, secondary } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(103, 1) Source(103, 1) + SourceIndex(0) +2 >Emitted(103, 4) Source(103, 4) + SourceIndex(0) +3 >Emitted(103, 5) Source(103, 5) + SourceIndex(0) +4 >Emitted(103, 6) Source(103, 49) + SourceIndex(0) +5 >Emitted(103, 17) Source(103, 65) + SourceIndex(0) +6 >Emitted(103, 19) Source(103, 49) + SourceIndex(0) +7 >Emitted(103, 25) Source(103, 49) + SourceIndex(0) +8 >Emitted(103, 39) Source(103, 63) + SourceIndex(0) +9 >Emitted(103, 41) Source(103, 65) + SourceIndex(0) +10>Emitted(103, 43) Source(103, 49) + SourceIndex(0) +11>Emitted(103, 59) Source(103, 65) + SourceIndex(0) +12>Emitted(103, 61) Source(103, 49) + SourceIndex(0) +13>Emitted(103, 66) Source(103, 65) + SourceIndex(0) +14>Emitted(103, 67) Source(103, 66) + SourceIndex(0) +--- +>>> _33 = _32[_31], name = _33.name, _34 = _33.skills, primary = _34.primary, secondary = _34.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name, skills: { primary, secondary } } +3 > +4 > name +5 > , +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +1->Emitted(104, 5) Source(103, 6) + SourceIndex(0) +2 >Emitted(104, 19) Source(103, 45) + SourceIndex(0) +3 >Emitted(104, 21) Source(103, 7) + SourceIndex(0) +4 >Emitted(104, 36) Source(103, 11) + SourceIndex(0) +5 >Emitted(104, 38) Source(103, 13) + SourceIndex(0) +6 >Emitted(104, 54) Source(103, 43) + SourceIndex(0) +7 >Emitted(104, 56) Source(103, 23) + SourceIndex(0) +8 >Emitted(104, 77) Source(103, 30) + SourceIndex(0) +9 >Emitted(104, 79) Source(103, 32) + SourceIndex(0) +10>Emitted(104, 104) Source(103, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(105, 5) Source(104, 5) + SourceIndex(0) +2 >Emitted(105, 12) Source(104, 12) + SourceIndex(0) +3 >Emitted(105, 13) Source(104, 13) + SourceIndex(0) +4 >Emitted(105, 16) Source(104, 16) + SourceIndex(0) +5 >Emitted(105, 17) Source(104, 17) + SourceIndex(0) +6 >Emitted(105, 22) Source(104, 22) + SourceIndex(0) +7 >Emitted(105, 23) Source(104, 23) + SourceIndex(0) +8 >Emitted(105, 24) Source(104, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(106, 2) Source(105, 2) + SourceIndex(0) +--- +>>>for (var _35 = 0, _36 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name, skills: { primary, secondary } } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(107, 1) Source(106, 1) + SourceIndex(0) +2 >Emitted(107, 4) Source(106, 4) + SourceIndex(0) +3 >Emitted(107, 5) Source(106, 5) + SourceIndex(0) +4 >Emitted(107, 6) Source(106, 49) + SourceIndex(0) +5 >Emitted(107, 17) Source(107, 79) + SourceIndex(0) +6 >Emitted(107, 19) Source(106, 49) + SourceIndex(0) +7 >Emitted(107, 26) Source(106, 50) + SourceIndex(0) +8 >Emitted(107, 28) Source(106, 52) + SourceIndex(0) +9 >Emitted(107, 32) Source(106, 56) + SourceIndex(0) +10>Emitted(107, 34) Source(106, 58) + SourceIndex(0) +11>Emitted(107, 41) Source(106, 65) + SourceIndex(0) +12>Emitted(107, 43) Source(106, 67) + SourceIndex(0) +13>Emitted(107, 49) Source(106, 73) + SourceIndex(0) +14>Emitted(107, 51) Source(106, 75) + SourceIndex(0) +15>Emitted(107, 53) Source(106, 77) + SourceIndex(0) +16>Emitted(107, 60) Source(106, 84) + SourceIndex(0) +17>Emitted(107, 62) Source(106, 86) + SourceIndex(0) +18>Emitted(107, 70) Source(106, 94) + SourceIndex(0) +19>Emitted(107, 72) Source(106, 96) + SourceIndex(0) +20>Emitted(107, 81) Source(106, 105) + SourceIndex(0) +21>Emitted(107, 83) Source(106, 107) + SourceIndex(0) +22>Emitted(107, 89) Source(106, 113) + SourceIndex(0) +23>Emitted(107, 91) Source(106, 115) + SourceIndex(0) +24>Emitted(107, 93) Source(106, 117) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _35 < _36.length; _35++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(108, 5) Source(107, 5) + SourceIndex(0) +2 >Emitted(108, 7) Source(107, 7) + SourceIndex(0) +3 >Emitted(108, 11) Source(107, 11) + SourceIndex(0) +4 >Emitted(108, 13) Source(107, 13) + SourceIndex(0) +5 >Emitted(108, 22) Source(107, 22) + SourceIndex(0) +6 >Emitted(108, 24) Source(107, 24) + SourceIndex(0) +7 >Emitted(108, 30) Source(107, 30) + SourceIndex(0) +8 >Emitted(108, 32) Source(107, 32) + SourceIndex(0) +9 >Emitted(108, 34) Source(107, 34) + SourceIndex(0) +10>Emitted(108, 41) Source(107, 41) + SourceIndex(0) +11>Emitted(108, 43) Source(107, 43) + SourceIndex(0) +12>Emitted(108, 53) Source(107, 53) + SourceIndex(0) +13>Emitted(108, 55) Source(107, 55) + SourceIndex(0) +14>Emitted(108, 64) Source(107, 64) + SourceIndex(0) +15>Emitted(108, 66) Source(107, 66) + SourceIndex(0) +16>Emitted(108, 74) Source(107, 74) + SourceIndex(0) +17>Emitted(108, 76) Source(107, 76) + SourceIndex(0) +18>Emitted(108, 78) Source(107, 78) + SourceIndex(0) +19>Emitted(108, 79) Source(107, 79) + SourceIndex(0) +20>Emitted(108, 81) Source(106, 49) + SourceIndex(0) +21>Emitted(108, 97) Source(107, 79) + SourceIndex(0) +22>Emitted(108, 99) Source(106, 49) + SourceIndex(0) +23>Emitted(108, 104) Source(107, 79) + SourceIndex(0) +24>Emitted(108, 105) Source(107, 80) + SourceIndex(0) +--- +>>> _37 = _36[_35], name = _37.name, _38 = _37.skills, primary = _38.primary, secondary = _38.secondary; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name, skills: { primary, secondary } } +3 > +4 > name +5 > , +6 > skills: { primary, secondary } +7 > +8 > primary +9 > , +10> secondary +1->Emitted(109, 5) Source(106, 6) + SourceIndex(0) +2 >Emitted(109, 19) Source(106, 45) + SourceIndex(0) +3 >Emitted(109, 21) Source(106, 7) + SourceIndex(0) +4 >Emitted(109, 36) Source(106, 11) + SourceIndex(0) +5 >Emitted(109, 38) Source(106, 13) + SourceIndex(0) +6 >Emitted(109, 54) Source(106, 43) + SourceIndex(0) +7 >Emitted(109, 56) Source(106, 23) + SourceIndex(0) +8 >Emitted(109, 77) Source(106, 30) + SourceIndex(0) +9 >Emitted(109, 79) Source(106, 32) + SourceIndex(0) +10>Emitted(109, 104) Source(106, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(110, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(110, 12) Source(108, 12) + SourceIndex(0) +3 >Emitted(110, 13) Source(108, 13) + SourceIndex(0) +4 >Emitted(110, 16) Source(108, 16) + SourceIndex(0) +5 >Emitted(110, 17) Source(108, 17) + SourceIndex(0) +6 >Emitted(110, 22) Source(108, 22) + SourceIndex(0) +7 >Emitted(110, 23) Source(108, 23) + SourceIndex(0) +8 >Emitted(110, 24) Source(108, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(111, 2) Source(109, 2) + SourceIndex(0) +--- +>>>var _f, _j, _m, _u, _x, _0, _2, _5, _8, _10, _11, _14, _15, _18, _19, _21, _24, _27, _29, _30, _33, _34, _37, _38; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.symbols new file mode 100644 index 00000000000..ed2a6c3449d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.symbols @@ -0,0 +1,435 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 11, 24)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 29, 53)) + +for ({name: nameA } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 25)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 40)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 61)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 37, 78)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 40, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 40, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 40, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 43, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 43, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 43, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 35)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 67)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 82)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 92)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 46, 111)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 47, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({name } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 50, 6)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 53, 6)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 6)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 18)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 33)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 54)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 56, 71)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({ skills: { primary, secondary } } of multiRobots) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 59, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 59, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 59, 25)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 62, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 62, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 62, 25)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 16)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 25)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 45)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 60)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 70)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 65, 89)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 66, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +} + + +for ({name: nameA, skill: skillA } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 71, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 71, 18)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skill: skillA } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 74, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 74, 18)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 18)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 67)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 40)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 76)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 77, 93)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 18)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 28)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 80, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 18)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 28)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 83, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 18)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 28)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 36)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 79)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 94)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 104)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 86, 123)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 87, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skill } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 90, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 90, 11)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skill } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 93, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 93, 11)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 11)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 25)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 40)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 61)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 96, 78)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skills: { primary, secondary } } of multiRobots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 11)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 21)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 99, 30)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 11)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 21)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 102, 30)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 11)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 21)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 30)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 50)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 65)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 75)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 105, 94)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 106, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPattern2.ts, 28, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types new file mode 100644 index 00000000000..1f292542545 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types @@ -0,0 +1,593 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({name: nameA } of robots) { +>{name: nameA } : { name: string; } +>name : Robot +>nameA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA } of getRobots()) { +>{name: nameA } : { name: string; } +>name : Robot +>nameA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA } : { name: string; } +>name : { name: string; skill: string; } +>nameA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({name } of robots) { +>{name } : { name: string; } +>name : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name } of getRobots()) { +>{name } : { name: string; } +>name : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name } : { name: string; } +>name : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary, secondary } } of multiRobots) { +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({name: nameA, skill: skillA } of robots) { +>{name: nameA, skill: skillA } : { name: string; skill: string; } +>name : Robot +>nameA : string +>skill : Robot +>skillA : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skill: skillA } of getRobots()) { +>{name: nameA, skill: skillA } : { name: string; skill: string; } +>name : Robot +>nameA : string +>skill : Robot +>skillA : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA, skill: skillA } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>nameA : string +>skill : { name: string; skill: string; } +>skillA : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +>{name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>nameA : string +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +>{name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>nameA : string +>skills : MultiRobot +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : { name: string; skills: { primary: string; secondary: string; }; } +>nameA : string +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary: primaryA, secondary: secondaryA } : { primary: string; secondary: string; } +>primary : string +>primaryA : string +>secondary : string +>secondaryA : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skill } of robots) { +>{name, skill } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skill } of getRobots()) { +>{name, skill } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name, skill } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>skill : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skills: { primary, secondary } } of multiRobots) { +>{name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { +>{name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : MultiRobot +>skills : MultiRobot +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>{name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : { name: string; skills: { primary: string; secondary: string; }; } +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary, secondary } : { primary: string; secondary: string; } +>primary : string +>secondary : string +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..08cf3cf5466 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js @@ -0,0 +1,152 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA = "noName" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + var _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + var _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; + console.log(nameA); +} +for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { + var _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + var _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; + console.log(primaryA); +} +for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { + var _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; + console.log(primaryA); +} +for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { + var _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; + console.log(primaryA); +} +for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { + var _1 = robots_2[_0], _2 = _1.name, nameA = _2 === void 0 ? "noName" : _2, _3 = _1.skill, skillA = _3 === void 0 ? "noSkill" : _3; + console.log(nameA); +} +for (var _4 = 0, _5 = getRobots(); _4 < _5.length; _4++) { + var _6 = _5[_4], _7 = _6.name, nameA = _7 === void 0 ? "noName" : _7, _8 = _6.skill, skillA = _8 === void 0 ? "noSkill" : _8; + console.log(nameA); +} +for (var _9 = 0, _10 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _9 < _10.length; _9++) { + var _11 = _10[_9], _12 = _11.name, nameA = _12 === void 0 ? "noName" : _12, _13 = _11.skill, skillA = _13 === void 0 ? "noSkill" : _13; + console.log(nameA); +} +for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { + var _15 = multiRobots_2[_14], _16 = _15.name, nameA = _16 === void 0 ? "noName" : _16, _17 = _15.skills, _18 = _17 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _17, _19 = _18.primary, primaryA = _19 === void 0 ? "primary" : _19, _20 = _18.secondary, secondaryA = _20 === void 0 ? "secondary" : _20; + console.log(nameA); +} +for (var _21 = 0, _22 = getMultiRobots(); _21 < _22.length; _21++) { + var _23 = _22[_21], _24 = _23.name, nameA = _24 === void 0 ? "noName" : _24, _25 = _23.skills, _26 = _25 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _25, _27 = _26.primary, primaryA = _27 === void 0 ? "primary" : _27, _28 = _26.secondary, secondaryA = _28 === void 0 ? "secondary" : _28; + console.log(nameA); +} +for (var _29 = 0, _30 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _29 < _30.length; _29++) { + var _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skills, _34 = _33 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _33, _35 = _34.primary, primaryA = _35 === void 0 ? "primary" : _35, _36 = _34.secondary, secondaryA = _36 === void 0 ? "secondary" : _36; + console.log(nameA); +} +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..89313ae9027 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAkC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnC,0BAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxC,oBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAzG,oBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CACkD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IADvD,iCACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CACkD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IAD5D,sBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAEA,UAC0E,EAD1E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAClF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD1E,cAC0E,EAD1E,IAC0E,CAAC;IAHpE,sBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAInF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAA6D,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnE,qBAAwD,EAAnD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8D,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAzE,eAAyD,EAApD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8D,UAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,eAA4E,EAA5E,IAA4E,CAAC;IAA1I,iBAAyD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IANZ,4BAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IANjB,kBAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAP1E,kBAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..e63344455ae --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,2082 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let {name: nameA = "noName" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 4) Source(29, 4) + SourceIndex(0) +3 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +4 >Emitted(10, 6) Source(29, 39) + SourceIndex(0) +5 >Emitted(10, 16) Source(29, 45) + SourceIndex(0) +6 >Emitted(10, 18) Source(29, 39) + SourceIndex(0) +7 >Emitted(10, 35) Source(29, 45) + SourceIndex(0) +8 >Emitted(10, 37) Source(29, 39) + SourceIndex(0) +9 >Emitted(10, 57) Source(29, 45) + SourceIndex(0) +10>Emitted(10, 59) Source(29, 39) + SourceIndex(0) +11>Emitted(10, 63) Source(29, 45) + SourceIndex(0) +12>Emitted(10, 64) Source(29, 46) + SourceIndex(0) +--- +>>> var _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(11, 5) Source(29, 11) + SourceIndex(0) +2 >Emitted(11, 31) Source(29, 33) + SourceIndex(0) +3 >Emitted(11, 33) Source(29, 11) + SourceIndex(0) +4 >Emitted(11, 70) Source(29, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(12, 22) Source(30, 22) + SourceIndex(0) +7 >Emitted(12, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(14, 6) Source(32, 39) + SourceIndex(0) +5 >Emitted(14, 16) Source(32, 50) + SourceIndex(0) +6 >Emitted(14, 18) Source(32, 39) + SourceIndex(0) +7 >Emitted(14, 23) Source(32, 39) + SourceIndex(0) +8 >Emitted(14, 32) Source(32, 48) + SourceIndex(0) +9 >Emitted(14, 34) Source(32, 50) + SourceIndex(0) +10>Emitted(14, 36) Source(32, 39) + SourceIndex(0) +11>Emitted(14, 50) Source(32, 50) + SourceIndex(0) +12>Emitted(14, 52) Source(32, 39) + SourceIndex(0) +13>Emitted(14, 56) Source(32, 50) + SourceIndex(0) +14>Emitted(14, 57) Source(32, 51) + SourceIndex(0) +--- +>>> var _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(15, 5) Source(32, 11) + SourceIndex(0) +2 >Emitted(15, 25) Source(32, 33) + SourceIndex(0) +3 >Emitted(15, 27) Source(32, 11) + SourceIndex(0) +4 >Emitted(15, 64) Source(32, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(16, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(16, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(16, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(18, 6) Source(35, 39) + SourceIndex(0) +5 >Emitted(18, 16) Source(35, 115) + SourceIndex(0) +6 >Emitted(18, 18) Source(35, 39) + SourceIndex(0) +7 >Emitted(18, 24) Source(35, 40) + SourceIndex(0) +8 >Emitted(18, 26) Source(35, 42) + SourceIndex(0) +9 >Emitted(18, 30) Source(35, 46) + SourceIndex(0) +10>Emitted(18, 32) Source(35, 48) + SourceIndex(0) +11>Emitted(18, 39) Source(35, 55) + SourceIndex(0) +12>Emitted(18, 41) Source(35, 57) + SourceIndex(0) +13>Emitted(18, 46) Source(35, 62) + SourceIndex(0) +14>Emitted(18, 48) Source(35, 64) + SourceIndex(0) +15>Emitted(18, 56) Source(35, 72) + SourceIndex(0) +16>Emitted(18, 58) Source(35, 74) + SourceIndex(0) +17>Emitted(18, 60) Source(35, 76) + SourceIndex(0) +18>Emitted(18, 62) Source(35, 78) + SourceIndex(0) +19>Emitted(18, 66) Source(35, 82) + SourceIndex(0) +20>Emitted(18, 68) Source(35, 84) + SourceIndex(0) +21>Emitted(18, 77) Source(35, 93) + SourceIndex(0) +22>Emitted(18, 79) Source(35, 95) + SourceIndex(0) +23>Emitted(18, 84) Source(35, 100) + SourceIndex(0) +24>Emitted(18, 86) Source(35, 102) + SourceIndex(0) +25>Emitted(18, 96) Source(35, 112) + SourceIndex(0) +26>Emitted(18, 98) Source(35, 114) + SourceIndex(0) +27>Emitted(18, 99) Source(35, 115) + SourceIndex(0) +28>Emitted(18, 101) Source(35, 39) + SourceIndex(0) +29>Emitted(18, 115) Source(35, 115) + SourceIndex(0) +30>Emitted(18, 117) Source(35, 39) + SourceIndex(0) +31>Emitted(18, 121) Source(35, 115) + SourceIndex(0) +32>Emitted(18, 122) Source(35, 116) + SourceIndex(0) +--- +>>> var _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1 >Emitted(19, 5) Source(35, 11) + SourceIndex(0) +2 >Emitted(19, 25) Source(35, 33) + SourceIndex(0) +3 >Emitted(19, 27) Source(35, 11) + SourceIndex(0) +4 >Emitted(19, 64) Source(35, 33) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(20, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(20, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(20, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(20, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(20, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(20, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(20, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(20, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(21, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(22, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(22, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(22, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(22, 6) Source(39, 55) + SourceIndex(0) +5 >Emitted(22, 16) Source(39, 66) + SourceIndex(0) +6 >Emitted(22, 18) Source(39, 55) + SourceIndex(0) +7 >Emitted(22, 45) Source(39, 66) + SourceIndex(0) +8 >Emitted(22, 47) Source(39, 55) + SourceIndex(0) +9 >Emitted(22, 72) Source(39, 66) + SourceIndex(0) +10>Emitted(22, 74) Source(39, 55) + SourceIndex(0) +11>Emitted(22, 78) Source(39, 66) + SourceIndex(0) +12>Emitted(22, 79) Source(39, 67) + SourceIndex(0) +--- +>>> var _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(23, 5) Source(38, 12) + SourceIndex(0) +2 >Emitted(23, 38) Source(39, 49) + SourceIndex(0) +3 >Emitted(23, 40) Source(38, 12) + SourceIndex(0) +4 >Emitted(23, 110) Source(39, 49) + SourceIndex(0) +5 >Emitted(23, 112) Source(38, 22) + SourceIndex(0) +6 >Emitted(23, 127) Source(38, 51) + SourceIndex(0) +7 >Emitted(23, 129) Source(38, 22) + SourceIndex(0) +8 >Emitted(23, 170) Source(38, 51) + SourceIndex(0) +9 >Emitted(23, 172) Source(38, 53) + SourceIndex(0) +10>Emitted(23, 189) Source(38, 88) + SourceIndex(0) +11>Emitted(23, 191) Source(38, 53) + SourceIndex(0) +12>Emitted(23, 236) Source(38, 88) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(24, 5) Source(40, 5) + SourceIndex(0) +2 >Emitted(24, 12) Source(40, 12) + SourceIndex(0) +3 >Emitted(24, 13) Source(40, 13) + SourceIndex(0) +4 >Emitted(24, 16) Source(40, 16) + SourceIndex(0) +5 >Emitted(24, 17) Source(40, 17) + SourceIndex(0) +6 >Emitted(24, 25) Source(40, 25) + SourceIndex(0) +7 >Emitted(24, 26) Source(40, 26) + SourceIndex(0) +8 >Emitted(24, 27) Source(40, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(25, 2) Source(41, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(26, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(26, 4) Source(42, 4) + SourceIndex(0) +3 >Emitted(26, 5) Source(42, 5) + SourceIndex(0) +4 >Emitted(26, 6) Source(43, 55) + SourceIndex(0) +5 >Emitted(26, 16) Source(43, 71) + SourceIndex(0) +6 >Emitted(26, 18) Source(43, 55) + SourceIndex(0) +7 >Emitted(26, 23) Source(43, 55) + SourceIndex(0) +8 >Emitted(26, 37) Source(43, 69) + SourceIndex(0) +9 >Emitted(26, 39) Source(43, 71) + SourceIndex(0) +10>Emitted(26, 41) Source(43, 55) + SourceIndex(0) +11>Emitted(26, 55) Source(43, 71) + SourceIndex(0) +12>Emitted(26, 57) Source(43, 55) + SourceIndex(0) +13>Emitted(26, 61) Source(43, 71) + SourceIndex(0) +14>Emitted(26, 62) Source(43, 72) + SourceIndex(0) +--- +>>> var _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(27, 5) Source(42, 12) + SourceIndex(0) +2 >Emitted(27, 27) Source(43, 49) + SourceIndex(0) +3 >Emitted(27, 29) Source(42, 12) + SourceIndex(0) +4 >Emitted(27, 99) Source(43, 49) + SourceIndex(0) +5 >Emitted(27, 101) Source(42, 22) + SourceIndex(0) +6 >Emitted(27, 116) Source(42, 51) + SourceIndex(0) +7 >Emitted(27, 118) Source(42, 22) + SourceIndex(0) +8 >Emitted(27, 159) Source(42, 51) + SourceIndex(0) +9 >Emitted(27, 161) Source(42, 53) + SourceIndex(0) +10>Emitted(27, 178) Source(42, 88) + SourceIndex(0) +11>Emitted(27, 180) Source(42, 53) + SourceIndex(0) +12>Emitted(27, 225) Source(42, 88) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(28, 5) Source(44, 5) + SourceIndex(0) +2 >Emitted(28, 12) Source(44, 12) + SourceIndex(0) +3 >Emitted(28, 13) Source(44, 13) + SourceIndex(0) +4 >Emitted(28, 16) Source(44, 16) + SourceIndex(0) +5 >Emitted(28, 17) Source(44, 17) + SourceIndex(0) +6 >Emitted(28, 25) Source(44, 25) + SourceIndex(0) +7 >Emitted(28, 26) Source(44, 26) + SourceIndex(0) +8 >Emitted(28, 27) Source(44, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(29, 2) Source(45, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of + > +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(30, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(30, 4) Source(46, 4) + SourceIndex(0) +3 >Emitted(30, 5) Source(46, 5) + SourceIndex(0) +4 >Emitted(30, 6) Source(48, 5) + SourceIndex(0) +5 >Emitted(30, 16) Source(49, 79) + SourceIndex(0) +6 >Emitted(30, 18) Source(48, 5) + SourceIndex(0) +7 >Emitted(30, 23) Source(48, 19) + SourceIndex(0) +8 >Emitted(30, 24) Source(48, 20) + SourceIndex(0) +9 >Emitted(30, 26) Source(48, 22) + SourceIndex(0) +10>Emitted(30, 30) Source(48, 26) + SourceIndex(0) +11>Emitted(30, 32) Source(48, 28) + SourceIndex(0) +12>Emitted(30, 39) Source(48, 35) + SourceIndex(0) +13>Emitted(30, 41) Source(48, 37) + SourceIndex(0) +14>Emitted(30, 47) Source(48, 43) + SourceIndex(0) +15>Emitted(30, 49) Source(48, 45) + SourceIndex(0) +16>Emitted(30, 51) Source(48, 47) + SourceIndex(0) +17>Emitted(30, 58) Source(48, 54) + SourceIndex(0) +18>Emitted(30, 60) Source(48, 56) + SourceIndex(0) +19>Emitted(30, 68) Source(48, 64) + SourceIndex(0) +20>Emitted(30, 70) Source(48, 66) + SourceIndex(0) +21>Emitted(30, 79) Source(48, 75) + SourceIndex(0) +22>Emitted(30, 81) Source(48, 77) + SourceIndex(0) +23>Emitted(30, 87) Source(48, 83) + SourceIndex(0) +24>Emitted(30, 89) Source(48, 85) + SourceIndex(0) +25>Emitted(30, 91) Source(48, 87) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(31, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(31, 7) Source(49, 7) + SourceIndex(0) +3 >Emitted(31, 11) Source(49, 11) + SourceIndex(0) +4 >Emitted(31, 13) Source(49, 13) + SourceIndex(0) +5 >Emitted(31, 22) Source(49, 22) + SourceIndex(0) +6 >Emitted(31, 24) Source(49, 24) + SourceIndex(0) +7 >Emitted(31, 30) Source(49, 30) + SourceIndex(0) +8 >Emitted(31, 32) Source(49, 32) + SourceIndex(0) +9 >Emitted(31, 34) Source(49, 34) + SourceIndex(0) +10>Emitted(31, 41) Source(49, 41) + SourceIndex(0) +11>Emitted(31, 43) Source(49, 43) + SourceIndex(0) +12>Emitted(31, 53) Source(49, 53) + SourceIndex(0) +13>Emitted(31, 55) Source(49, 55) + SourceIndex(0) +14>Emitted(31, 64) Source(49, 64) + SourceIndex(0) +15>Emitted(31, 66) Source(49, 66) + SourceIndex(0) +16>Emitted(31, 74) Source(49, 74) + SourceIndex(0) +17>Emitted(31, 76) Source(49, 76) + SourceIndex(0) +18>Emitted(31, 78) Source(49, 78) + SourceIndex(0) +19>Emitted(31, 79) Source(49, 79) + SourceIndex(0) +20>Emitted(31, 81) Source(48, 5) + SourceIndex(0) +21>Emitted(31, 95) Source(49, 79) + SourceIndex(0) +22>Emitted(31, 97) Source(48, 5) + SourceIndex(0) +23>Emitted(31, 101) Source(49, 79) + SourceIndex(0) +24>Emitted(31, 102) Source(49, 80) + SourceIndex(0) +--- +>>> var _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(32, 5) Source(46, 12) + SourceIndex(0) +2 >Emitted(32, 27) Source(47, 49) + SourceIndex(0) +3 >Emitted(32, 29) Source(46, 12) + SourceIndex(0) +4 >Emitted(32, 99) Source(47, 49) + SourceIndex(0) +5 >Emitted(32, 101) Source(46, 22) + SourceIndex(0) +6 >Emitted(32, 116) Source(46, 51) + SourceIndex(0) +7 >Emitted(32, 118) Source(46, 22) + SourceIndex(0) +8 >Emitted(32, 159) Source(46, 51) + SourceIndex(0) +9 >Emitted(32, 161) Source(46, 53) + SourceIndex(0) +10>Emitted(32, 178) Source(46, 88) + SourceIndex(0) +11>Emitted(32, 180) Source(46, 53) + SourceIndex(0) +12>Emitted(32, 225) Source(46, 88) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of + > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(33, 5) Source(50, 5) + SourceIndex(0) +2 >Emitted(33, 12) Source(50, 12) + SourceIndex(0) +3 >Emitted(33, 13) Source(50, 13) + SourceIndex(0) +4 >Emitted(33, 16) Source(50, 16) + SourceIndex(0) +5 >Emitted(33, 17) Source(50, 17) + SourceIndex(0) +6 >Emitted(33, 25) Source(50, 25) + SourceIndex(0) +7 >Emitted(33, 26) Source(50, 26) + SourceIndex(0) +8 >Emitted(33, 27) Source(50, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(34, 2) Source(51, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(35, 1) Source(53, 1) + SourceIndex(0) +2 >Emitted(35, 4) Source(53, 4) + SourceIndex(0) +3 >Emitted(35, 5) Source(53, 5) + SourceIndex(0) +4 >Emitted(35, 6) Source(53, 66) + SourceIndex(0) +5 >Emitted(35, 16) Source(53, 72) + SourceIndex(0) +6 >Emitted(35, 18) Source(53, 66) + SourceIndex(0) +7 >Emitted(35, 35) Source(53, 72) + SourceIndex(0) +8 >Emitted(35, 37) Source(53, 66) + SourceIndex(0) +9 >Emitted(35, 57) Source(53, 72) + SourceIndex(0) +10>Emitted(35, 59) Source(53, 66) + SourceIndex(0) +11>Emitted(35, 63) Source(53, 72) + SourceIndex(0) +12>Emitted(35, 64) Source(53, 73) + SourceIndex(0) +--- +>>> var _1 = robots_2[_0], _2 = _1.name, nameA = _2 === void 0 ? "noName" : _2, _3 = _1.skill, skillA = _3 === void 0 ? "noSkill" : _3; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(36, 5) Source(53, 6) + SourceIndex(0) +2 >Emitted(36, 26) Source(53, 62) + SourceIndex(0) +3 >Emitted(36, 28) Source(53, 11) + SourceIndex(0) +4 >Emitted(36, 40) Source(53, 33) + SourceIndex(0) +5 >Emitted(36, 42) Source(53, 11) + SourceIndex(0) +6 >Emitted(36, 79) Source(53, 33) + SourceIndex(0) +7 >Emitted(36, 81) Source(53, 35) + SourceIndex(0) +8 >Emitted(36, 94) Source(53, 60) + SourceIndex(0) +9 >Emitted(36, 96) Source(53, 35) + SourceIndex(0) +10>Emitted(36, 135) Source(53, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(37, 5) Source(54, 5) + SourceIndex(0) +2 >Emitted(37, 12) Source(54, 12) + SourceIndex(0) +3 >Emitted(37, 13) Source(54, 13) + SourceIndex(0) +4 >Emitted(37, 16) Source(54, 16) + SourceIndex(0) +5 >Emitted(37, 17) Source(54, 17) + SourceIndex(0) +6 >Emitted(37, 22) Source(54, 22) + SourceIndex(0) +7 >Emitted(37, 23) Source(54, 23) + SourceIndex(0) +8 >Emitted(37, 24) Source(54, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(38, 2) Source(55, 2) + SourceIndex(0) +--- +>>>for (var _4 = 0, _5 = getRobots(); _4 < _5.length; _4++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(39, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(39, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(39, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(39, 6) Source(56, 67) + SourceIndex(0) +5 >Emitted(39, 16) Source(56, 78) + SourceIndex(0) +6 >Emitted(39, 18) Source(56, 67) + SourceIndex(0) +7 >Emitted(39, 23) Source(56, 67) + SourceIndex(0) +8 >Emitted(39, 32) Source(56, 76) + SourceIndex(0) +9 >Emitted(39, 34) Source(56, 78) + SourceIndex(0) +10>Emitted(39, 36) Source(56, 67) + SourceIndex(0) +11>Emitted(39, 50) Source(56, 78) + SourceIndex(0) +12>Emitted(39, 52) Source(56, 67) + SourceIndex(0) +13>Emitted(39, 56) Source(56, 78) + SourceIndex(0) +14>Emitted(39, 57) Source(56, 79) + SourceIndex(0) +--- +>>> var _6 = _5[_4], _7 = _6.name, nameA = _7 === void 0 ? "noName" : _7, _8 = _6.skill, skillA = _8 === void 0 ? "noSkill" : _8; +1->^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(40, 5) Source(56, 6) + SourceIndex(0) +2 >Emitted(40, 20) Source(56, 63) + SourceIndex(0) +3 >Emitted(40, 22) Source(56, 11) + SourceIndex(0) +4 >Emitted(40, 34) Source(56, 33) + SourceIndex(0) +5 >Emitted(40, 36) Source(56, 11) + SourceIndex(0) +6 >Emitted(40, 73) Source(56, 33) + SourceIndex(0) +7 >Emitted(40, 75) Source(56, 35) + SourceIndex(0) +8 >Emitted(40, 88) Source(56, 60) + SourceIndex(0) +9 >Emitted(40, 90) Source(56, 35) + SourceIndex(0) +10>Emitted(40, 129) Source(56, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(41, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(41, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(41, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(41, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(41, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(41, 22) Source(57, 22) + SourceIndex(0) +7 >Emitted(41, 23) Source(57, 23) + SourceIndex(0) +8 >Emitted(41, 24) Source(57, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(42, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _9 = 0, _10 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _9 < _10.length; _9++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +33> ^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(43, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(43, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(43, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(43, 6) Source(59, 67) + SourceIndex(0) +5 >Emitted(43, 16) Source(59, 143) + SourceIndex(0) +6 >Emitted(43, 18) Source(59, 67) + SourceIndex(0) +7 >Emitted(43, 25) Source(59, 68) + SourceIndex(0) +8 >Emitted(43, 27) Source(59, 70) + SourceIndex(0) +9 >Emitted(43, 31) Source(59, 74) + SourceIndex(0) +10>Emitted(43, 33) Source(59, 76) + SourceIndex(0) +11>Emitted(43, 40) Source(59, 83) + SourceIndex(0) +12>Emitted(43, 42) Source(59, 85) + SourceIndex(0) +13>Emitted(43, 47) Source(59, 90) + SourceIndex(0) +14>Emitted(43, 49) Source(59, 92) + SourceIndex(0) +15>Emitted(43, 57) Source(59, 100) + SourceIndex(0) +16>Emitted(43, 59) Source(59, 102) + SourceIndex(0) +17>Emitted(43, 61) Source(59, 104) + SourceIndex(0) +18>Emitted(43, 63) Source(59, 106) + SourceIndex(0) +19>Emitted(43, 67) Source(59, 110) + SourceIndex(0) +20>Emitted(43, 69) Source(59, 112) + SourceIndex(0) +21>Emitted(43, 78) Source(59, 121) + SourceIndex(0) +22>Emitted(43, 80) Source(59, 123) + SourceIndex(0) +23>Emitted(43, 85) Source(59, 128) + SourceIndex(0) +24>Emitted(43, 87) Source(59, 130) + SourceIndex(0) +25>Emitted(43, 97) Source(59, 140) + SourceIndex(0) +26>Emitted(43, 99) Source(59, 142) + SourceIndex(0) +27>Emitted(43, 100) Source(59, 143) + SourceIndex(0) +28>Emitted(43, 102) Source(59, 67) + SourceIndex(0) +29>Emitted(43, 117) Source(59, 143) + SourceIndex(0) +30>Emitted(43, 119) Source(59, 67) + SourceIndex(0) +31>Emitted(43, 123) Source(59, 143) + SourceIndex(0) +32>Emitted(43, 124) Source(59, 144) + SourceIndex(0) +--- +>>> var _11 = _10[_9], _12 = _11.name, nameA = _12 === void 0 ? "noName" : _12, _13 = _11.skill, skillA = _13 === void 0 ? "noSkill" : _13; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(44, 5) Source(59, 6) + SourceIndex(0) +2 >Emitted(44, 22) Source(59, 63) + SourceIndex(0) +3 >Emitted(44, 24) Source(59, 11) + SourceIndex(0) +4 >Emitted(44, 38) Source(59, 33) + SourceIndex(0) +5 >Emitted(44, 40) Source(59, 11) + SourceIndex(0) +6 >Emitted(44, 79) Source(59, 33) + SourceIndex(0) +7 >Emitted(44, 81) Source(59, 35) + SourceIndex(0) +8 >Emitted(44, 96) Source(59, 60) + SourceIndex(0) +9 >Emitted(44, 98) Source(59, 35) + SourceIndex(0) +10>Emitted(44, 139) Source(59, 60) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(45, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(45, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(45, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(45, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(45, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(45, 22) Source(60, 22) + SourceIndex(0) +7 >Emitted(45, 23) Source(60, 23) + SourceIndex(0) +8 >Emitted(45, 24) Source(60, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(46, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(47, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(47, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(47, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(47, 6) Source(68, 6) + SourceIndex(0) +5 >Emitted(47, 17) Source(68, 17) + SourceIndex(0) +6 >Emitted(47, 19) Source(68, 6) + SourceIndex(0) +7 >Emitted(47, 46) Source(68, 17) + SourceIndex(0) +8 >Emitted(47, 48) Source(68, 6) + SourceIndex(0) +9 >Emitted(47, 74) Source(68, 17) + SourceIndex(0) +10>Emitted(47, 76) Source(68, 6) + SourceIndex(0) +11>Emitted(47, 81) Source(68, 17) + SourceIndex(0) +12>Emitted(47, 82) Source(68, 18) + SourceIndex(0) +--- +>>> var _15 = multiRobots_2[_14], _16 = _15.name, nameA = _16 === void 0 ? "noName" : _16, _17 = _15.skills, _18 = _17 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _17, _19 = _18.primary, primaryA = _19 === void 0 ? "primary" : _19, _20 = _18.secondary, secondaryA = _20 === void 0 ? "secondary" : _20; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(48, 5) Source(62, 6) + SourceIndex(0) +2 >Emitted(48, 33) Source(68, 2) + SourceIndex(0) +3 >Emitted(48, 35) Source(63, 5) + SourceIndex(0) +4 >Emitted(48, 49) Source(63, 27) + SourceIndex(0) +5 >Emitted(48, 51) Source(63, 5) + SourceIndex(0) +6 >Emitted(48, 90) Source(63, 27) + SourceIndex(0) +7 >Emitted(48, 92) Source(64, 5) + SourceIndex(0) +8 >Emitted(48, 108) Source(67, 53) + SourceIndex(0) +9 >Emitted(48, 110) Source(64, 5) + SourceIndex(0) +10>Emitted(48, 183) Source(67, 53) + SourceIndex(0) +11>Emitted(48, 185) Source(65, 9) + SourceIndex(0) +12>Emitted(48, 202) Source(65, 38) + SourceIndex(0) +13>Emitted(48, 204) Source(65, 9) + SourceIndex(0) +14>Emitted(48, 247) Source(65, 38) + SourceIndex(0) +15>Emitted(48, 249) Source(66, 9) + SourceIndex(0) +16>Emitted(48, 268) Source(66, 44) + SourceIndex(0) +17>Emitted(48, 270) Source(66, 9) + SourceIndex(0) +18>Emitted(48, 317) Source(66, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(49, 5) Source(69, 5) + SourceIndex(0) +2 >Emitted(49, 12) Source(69, 12) + SourceIndex(0) +3 >Emitted(49, 13) Source(69, 13) + SourceIndex(0) +4 >Emitted(49, 16) Source(69, 16) + SourceIndex(0) +5 >Emitted(49, 17) Source(69, 17) + SourceIndex(0) +6 >Emitted(49, 22) Source(69, 22) + SourceIndex(0) +7 >Emitted(49, 23) Source(69, 23) + SourceIndex(0) +8 >Emitted(49, 24) Source(69, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(50, 2) Source(70, 2) + SourceIndex(0) +--- +>>>for (var _21 = 0, _22 = getMultiRobots(); _21 < _22.length; _21++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(51, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(51, 4) Source(71, 4) + SourceIndex(0) +3 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) +4 >Emitted(51, 6) Source(77, 6) + SourceIndex(0) +5 >Emitted(51, 17) Source(77, 22) + SourceIndex(0) +6 >Emitted(51, 19) Source(77, 6) + SourceIndex(0) +7 >Emitted(51, 25) Source(77, 6) + SourceIndex(0) +8 >Emitted(51, 39) Source(77, 20) + SourceIndex(0) +9 >Emitted(51, 41) Source(77, 22) + SourceIndex(0) +10>Emitted(51, 43) Source(77, 6) + SourceIndex(0) +11>Emitted(51, 59) Source(77, 22) + SourceIndex(0) +12>Emitted(51, 61) Source(77, 6) + SourceIndex(0) +13>Emitted(51, 66) Source(77, 22) + SourceIndex(0) +14>Emitted(51, 67) Source(77, 23) + SourceIndex(0) +--- +>>> var _23 = _22[_21], _24 = _23.name, nameA = _24 === void 0 ? "noName" : _24, _25 = _23.skills, _26 = _25 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _25, _27 = _26.primary, primaryA = _27 === void 0 ? "primary" : _27, _28 = _26.secondary, secondaryA = _28 === void 0 ? "secondary" : _28; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(52, 5) Source(71, 6) + SourceIndex(0) +2 >Emitted(52, 23) Source(77, 2) + SourceIndex(0) +3 >Emitted(52, 25) Source(72, 5) + SourceIndex(0) +4 >Emitted(52, 39) Source(72, 27) + SourceIndex(0) +5 >Emitted(52, 41) Source(72, 5) + SourceIndex(0) +6 >Emitted(52, 80) Source(72, 27) + SourceIndex(0) +7 >Emitted(52, 82) Source(73, 5) + SourceIndex(0) +8 >Emitted(52, 98) Source(76, 53) + SourceIndex(0) +9 >Emitted(52, 100) Source(73, 5) + SourceIndex(0) +10>Emitted(52, 173) Source(76, 53) + SourceIndex(0) +11>Emitted(52, 175) Source(74, 9) + SourceIndex(0) +12>Emitted(52, 192) Source(74, 38) + SourceIndex(0) +13>Emitted(52, 194) Source(74, 9) + SourceIndex(0) +14>Emitted(52, 237) Source(74, 38) + SourceIndex(0) +15>Emitted(52, 239) Source(75, 9) + SourceIndex(0) +16>Emitted(52, 258) Source(75, 44) + SourceIndex(0) +17>Emitted(52, 260) Source(75, 9) + SourceIndex(0) +18>Emitted(52, 307) Source(75, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(53, 5) Source(78, 5) + SourceIndex(0) +2 >Emitted(53, 12) Source(78, 12) + SourceIndex(0) +3 >Emitted(53, 13) Source(78, 13) + SourceIndex(0) +4 >Emitted(53, 16) Source(78, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(78, 17) + SourceIndex(0) +6 >Emitted(53, 22) Source(78, 22) + SourceIndex(0) +7 >Emitted(53, 23) Source(78, 23) + SourceIndex(0) +8 >Emitted(53, 24) Source(78, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(54, 2) Source(79, 2) + SourceIndex(0) +--- +>>>for (var _29 = 0, _30 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(55, 1) Source(80, 1) + SourceIndex(0) +2 >Emitted(55, 4) Source(80, 4) + SourceIndex(0) +3 >Emitted(55, 5) Source(80, 5) + SourceIndex(0) +4 >Emitted(55, 6) Source(86, 6) + SourceIndex(0) +5 >Emitted(55, 17) Source(87, 79) + SourceIndex(0) +6 >Emitted(55, 19) Source(86, 6) + SourceIndex(0) +7 >Emitted(55, 25) Source(86, 20) + SourceIndex(0) +8 >Emitted(55, 26) Source(86, 21) + SourceIndex(0) +9 >Emitted(55, 28) Source(86, 23) + SourceIndex(0) +10>Emitted(55, 32) Source(86, 27) + SourceIndex(0) +11>Emitted(55, 34) Source(86, 29) + SourceIndex(0) +12>Emitted(55, 41) Source(86, 36) + SourceIndex(0) +13>Emitted(55, 43) Source(86, 38) + SourceIndex(0) +14>Emitted(55, 49) Source(86, 44) + SourceIndex(0) +15>Emitted(55, 51) Source(86, 46) + SourceIndex(0) +16>Emitted(55, 53) Source(86, 48) + SourceIndex(0) +17>Emitted(55, 60) Source(86, 55) + SourceIndex(0) +18>Emitted(55, 62) Source(86, 57) + SourceIndex(0) +19>Emitted(55, 70) Source(86, 65) + SourceIndex(0) +20>Emitted(55, 72) Source(86, 67) + SourceIndex(0) +21>Emitted(55, 81) Source(86, 76) + SourceIndex(0) +22>Emitted(55, 83) Source(86, 78) + SourceIndex(0) +23>Emitted(55, 89) Source(86, 84) + SourceIndex(0) +24>Emitted(55, 91) Source(86, 86) + SourceIndex(0) +25>Emitted(55, 93) Source(86, 88) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _29 < _30.length; _29++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(56, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(56, 7) Source(87, 7) + SourceIndex(0) +3 >Emitted(56, 11) Source(87, 11) + SourceIndex(0) +4 >Emitted(56, 13) Source(87, 13) + SourceIndex(0) +5 >Emitted(56, 22) Source(87, 22) + SourceIndex(0) +6 >Emitted(56, 24) Source(87, 24) + SourceIndex(0) +7 >Emitted(56, 30) Source(87, 30) + SourceIndex(0) +8 >Emitted(56, 32) Source(87, 32) + SourceIndex(0) +9 >Emitted(56, 34) Source(87, 34) + SourceIndex(0) +10>Emitted(56, 41) Source(87, 41) + SourceIndex(0) +11>Emitted(56, 43) Source(87, 43) + SourceIndex(0) +12>Emitted(56, 53) Source(87, 53) + SourceIndex(0) +13>Emitted(56, 55) Source(87, 55) + SourceIndex(0) +14>Emitted(56, 64) Source(87, 64) + SourceIndex(0) +15>Emitted(56, 66) Source(87, 66) + SourceIndex(0) +16>Emitted(56, 74) Source(87, 74) + SourceIndex(0) +17>Emitted(56, 76) Source(87, 76) + SourceIndex(0) +18>Emitted(56, 78) Source(87, 78) + SourceIndex(0) +19>Emitted(56, 79) Source(87, 79) + SourceIndex(0) +20>Emitted(56, 81) Source(86, 6) + SourceIndex(0) +21>Emitted(56, 97) Source(87, 79) + SourceIndex(0) +22>Emitted(56, 99) Source(86, 6) + SourceIndex(0) +23>Emitted(56, 104) Source(87, 79) + SourceIndex(0) +24>Emitted(56, 105) Source(87, 80) + SourceIndex(0) +--- +>>> var _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skills, _34 = _33 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _33, _35 = _34.primary, primaryA = _35 === void 0 ? "primary" : _35, _36 = _34.secondary, secondaryA = _36 === void 0 ? "secondary" : _36; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(57, 5) Source(80, 6) + SourceIndex(0) +2 >Emitted(57, 23) Source(86, 2) + SourceIndex(0) +3 >Emitted(57, 25) Source(81, 5) + SourceIndex(0) +4 >Emitted(57, 39) Source(81, 27) + SourceIndex(0) +5 >Emitted(57, 41) Source(81, 5) + SourceIndex(0) +6 >Emitted(57, 80) Source(81, 27) + SourceIndex(0) +7 >Emitted(57, 82) Source(82, 5) + SourceIndex(0) +8 >Emitted(57, 98) Source(85, 53) + SourceIndex(0) +9 >Emitted(57, 100) Source(82, 5) + SourceIndex(0) +10>Emitted(57, 173) Source(85, 53) + SourceIndex(0) +11>Emitted(57, 175) Source(83, 9) + SourceIndex(0) +12>Emitted(57, 192) Source(83, 38) + SourceIndex(0) +13>Emitted(57, 194) Source(83, 9) + SourceIndex(0) +14>Emitted(57, 237) Source(83, 38) + SourceIndex(0) +15>Emitted(57, 239) Source(84, 9) + SourceIndex(0) +16>Emitted(57, 258) Source(84, 44) + SourceIndex(0) +17>Emitted(57, 260) Source(84, 9) + SourceIndex(0) +18>Emitted(57, 307) Source(84, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(58, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(58, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(58, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(58, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(58, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(58, 22) Source(88, 22) + SourceIndex(0) +7 >Emitted(58, 23) Source(88, 23) + SourceIndex(0) +8 >Emitted(58, 24) Source(88, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(59, 2) Source(89, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..f73adeb7761 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,314 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) +} + +for (let {name: nameA = "noName" } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 28, 10)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 28, 10)) +} +for (let {name: nameA = "noName" } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 31, 10)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 31, 10)) +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 40)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 10)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 40)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 76)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 93)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 34, 10)) +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 37, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 37, 51)) + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 38, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 38, 25)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 37, 20)) +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 41, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 41, 51)) + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 42, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 42, 25)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 41, 20)) +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 45, 20)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 45, 51)) + + { primary: "nosKill", secondary: "noSkill" } } of +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 46, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 46, 25)) + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 20)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 35)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 45)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 47, 64)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 48, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 45, 20)) +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 52, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 52, 33)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 52, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 55, 10)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 4, 17)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 55, 33)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 55, 10)) +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 68)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 10)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 83)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 33)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 68)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 83)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 104)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 121)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 58, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 61, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 63, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 64, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 66, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 66, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 61, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 70, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 72, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 73, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 75, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 75, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 70, 10)) +} +for (let { + name: nameA = "noName", +>name : Symbol(MultiRobot.name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 8, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 79, 10)) + + skills: { +>skills : Symbol(MultiRobot.skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 9, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 10, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 81, 13)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 11, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 82, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 84, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 84, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 85, 65)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 86, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts, 79, 10)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..36f67f946f0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types @@ -0,0 +1,428 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +for (let {name: nameA = "noName" } of robots) { +>name : any +>nameA : string +>"noName" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } of getRobots()) { +>name : any +>nameA : string +>"noName" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>"noName" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : any +>primary : any +>primaryA : string +>"primary" : string +>secondary : any +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : any +>primary : any +>primaryA : string +>"primary" : string +>secondary : any +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : any +>primary : any +>primaryA : string +>"primary" : string +>secondary : any +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"noSkill" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"noSkill" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : any +>nameA : string +>"noName" : string +>skill : any +>skillA : string +>"noSkill" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for (let { + name: nameA = "noName", +>name : any +>nameA : string +>"noName" : string + + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..1e18159d3d4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js @@ -0,0 +1,282 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for ({ name = "noName" } of robots) { + console.log(nameA); +} +for ({ name = "noName" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +for ({ name = "noName", skill = "noSkill" } of robots) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js] +var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +function getRobots() { + return robots; +} +function getMultiRobots() { + return multiRobots; +} +var nameA, primaryA, secondaryA, i, skillA; +var name, primary, secondary, skill; +for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { + _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; + console.log(nameA); +} +for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { + _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; + console.log(nameA); +} +for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { + _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; + console.log(nameA); +} +for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { + _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; + console.log(primaryA); +} +for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { + _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; + console.log(primaryA); +} +for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { + _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; + console.log(primaryA); +} +for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { + _1 = robots_2[_0].name, name = _1 === void 0 ? "noName" : _1; + console.log(nameA); +} +for (var _2 = 0, _3 = getRobots(); _2 < _3.length; _2++) { + _4 = _3[_2].name, name = _4 === void 0 ? "noName" : _4; + console.log(nameA); +} +for (var _5 = 0, _6 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _5 < _6.length; _5++) { + _7 = _6[_5].name, name = _7 === void 0 ? "noName" : _7; + console.log(nameA); +} +for (var _8 = 0, multiRobots_2 = multiRobots; _8 < multiRobots_2.length; _8++) { + _9 = multiRobots_2[_8].skills, _10 = _9 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _9, _11 = _10.primary, primary = _11 === void 0 ? "primary" : _11, _12 = _10.secondary, secondary = _12 === void 0 ? "secondary" : _12; + console.log(primaryA); +} +for (var _13 = 0, _14 = getMultiRobots(); _13 < _14.length; _13++) { + _15 = _14[_13].skills, _16 = _15 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _15, _17 = _16.primary, primary = _17 === void 0 ? "primary" : _17, _18 = _16.secondary, secondary = _18 === void 0 ? "secondary" : _18; + console.log(primaryA); +} +for (var _19 = 0, _20 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _19 < _20.length; _19++) { + _21 = _20[_19].skills, _22 = _21 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _21, _23 = _22.primary, primary = _23 === void 0 ? "primary" : _23, _24 = _22.secondary, secondary = _24 === void 0 ? "secondary" : _24; + console.log(primaryA); +} +for (var _25 = 0, robots_3 = robots; _25 < robots_3.length; _25++) { + _26 = robots_3[_25], _27 = _26.name, nameA = _27 === void 0 ? "noName" : _27, _28 = _26.skill, skillA = _28 === void 0 ? "noSkill" : _28; + console.log(nameA); +} +for (var _29 = 0, _30 = getRobots(); _29 < _30.length; _29++) { + _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skill, skillA = _33 === void 0 ? "noSkill" : _33; + console.log(nameA); +} +for (var _34 = 0, _35 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _34 < _35.length; _34++) { + _36 = _35[_34], _37 = _36.name, nameA = _37 === void 0 ? "noName" : _37, _38 = _36.skill, skillA = _38 === void 0 ? "noSkill" : _38; + console.log(nameA); +} +for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { + _40 = multiRobots_3[_39], _41 = _40.name, nameA = _41 === void 0 ? "noName" : _41, _42 = _40.skills, _43 = _42 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _42, _44 = _43.primary, primaryA = _44 === void 0 ? "primary" : _44, _45 = _43.secondary, secondaryA = _45 === void 0 ? "secondary" : _45; + console.log(nameA); +} +for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { + _48 = _47[_46], _49 = _48.name, nameA = _49 === void 0 ? "noName" : _49, _50 = _48.skills, _51 = _50 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _50, _52 = _51.primary, primaryA = _52 === void 0 ? "primary" : _52, _53 = _51.secondary, secondaryA = _53 === void 0 ? "secondary" : _53; + console.log(nameA); +} +for (var _54 = 0, _55 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _54 < _55.length; _54++) { + _56 = _55[_54], _57 = _56.name, nameA = _57 === void 0 ? "noName" : _57, _58 = _56.skills, _59 = _58 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _58, _60 = _59.primary, primaryA = _60 === void 0 ? "primary" : _60, _61 = _59.secondary, secondaryA = _61 === void 0 ? "secondary" : _61; + console.log(nameA); +} +for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { + _63 = robots_4[_62], _64 = _63.name, name = _64 === void 0 ? "noName" : _64, _65 = _63.skill, skill = _65 === void 0 ? "noSkill" : _65; + console.log(nameA); +} +for (var _66 = 0, _67 = getRobots(); _66 < _67.length; _66++) { + _68 = _67[_66], _69 = _68.name, name = _69 === void 0 ? "noName" : _69, _70 = _68.skill, skill = _70 === void 0 ? "noSkill" : _70; + console.log(nameA); +} +for (var _71 = 0, _72 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _71 < _72.length; _71++) { + _73 = _72[_71], _74 = _73.name, name = _74 === void 0 ? "noName" : _74, _75 = _73.skill, skill = _75 === void 0 ? "noSkill" : _75; + console.log(nameA); +} +for (var _76 = 0, multiRobots_4 = multiRobots; _76 < multiRobots_4.length; _76++) { + _77 = multiRobots_4[_76], _78 = _77.name, name = _78 === void 0 ? "noName" : _78, _79 = _77.skills, _80 = _79 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _79, _81 = _80.primary, primary = _81 === void 0 ? "primary" : _81, _82 = _80.secondary, secondary = _82 === void 0 ? "secondary" : _82; + console.log(nameA); +} +for (var _83 = 0, _84 = getMultiRobots(); _83 < _84.length; _83++) { + _85 = _84[_83], _86 = _85.name, name = _86 === void 0 ? "noName" : _86, _87 = _85.skills, _88 = _87 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _87, _89 = _88.primary, primary = _89 === void 0 ? "primary" : _89, _90 = _88.secondary, secondary = _90 === void 0 ? "secondary" : _90; + console.log(nameA); +} +for (var _91 = 0, _92 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _91 < _92.length; _91++) { + _93 = _92[_91], _94 = _93.name, name = _94 === void 0 ? "noName" : _94, _95 = _93.skills, _96 = _95 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _95, _97 = _96.primary, primary = _97 === void 0 ? "primary" : _97, _98 = _96.secondary, secondary = _98 === void 0 ? "secondary" : _98; + console.log(nameA); +} +var _a, _d, _g, _j, _k, _l, _m, _q, _r, _s, _t, _w, _x, _y, _z, _1, _4, _7, _9, _10, _11, _12, _15, _16, _17, _18, _21, _22, _23, _24, _26, _27, _28, _31, _32, _33, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _65, _68, _69, _70, _73, _74, _75, _77, _78, _79, _80, _81, _82, _85, _86, _87, _88, _89, _90, _93, _94, _95, _96, _97, _98; +//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..0529919c803 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAA8B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAAnC,sBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAxC,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8B,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAzG,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CACkD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAD3D,6BACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CACkD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB,CAAC;IADhE,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAEA,UAC8E,EAD9E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC9E,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9E,cAC8E,EAD9E,IAC8E,CAAC;IAH5E,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAI/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAAwB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,CAAC;IAA5B,sBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAwB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW,CAAC;IAAjC,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAwB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E,CAAC;IAAlG,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAKC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,CAAC;IAJb,6BAGgD,EAHhD,uEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAKC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IAJlB,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAKC,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAL3E,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,GAAG,CAAC,CAAyD,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAA/D,mBAAoD,EAAnD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA0D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAArE,cAAqD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA0D,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E,CAAC;IAAtI,cAAqD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IANZ,wBAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IANjB,cAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAP1E,cAMJ,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA4C,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM,CAAC;IAAlD,mBAAuC,EAArC,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW,CAAC;IAAvD,cAAuC,EAArC,cAAe,EAAf,sCAAe,EAAE,eAAiB,EAAjB,wCAAiB;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E,CAAC;IAAxH,cAAuC,EAArC,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW,CAAC;IANZ,wBAMJ,EALG,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB,CAAC;IANjB,cAMJ,EALG,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE,CAAC;IAP1E,cAMJ,EALG,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..f80a065e9ce --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,3951 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robots = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >interface Robot { + > name: string; + > skill: string; + >} + > + >interface MultiRobot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > + > +2 >let +3 > robots +4 > : Robot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> ; +1 >Emitted(1, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(17, 23) + SourceIndex(0) +5 >Emitted(1, 15) Source(17, 24) + SourceIndex(0) +6 >Emitted(1, 17) Source(17, 26) + SourceIndex(0) +7 >Emitted(1, 21) Source(17, 30) + SourceIndex(0) +8 >Emitted(1, 23) Source(17, 32) + SourceIndex(0) +9 >Emitted(1, 30) Source(17, 39) + SourceIndex(0) +10>Emitted(1, 32) Source(17, 41) + SourceIndex(0) +11>Emitted(1, 37) Source(17, 46) + SourceIndex(0) +12>Emitted(1, 39) Source(17, 48) + SourceIndex(0) +13>Emitted(1, 47) Source(17, 56) + SourceIndex(0) +14>Emitted(1, 49) Source(17, 58) + SourceIndex(0) +15>Emitted(1, 51) Source(17, 60) + SourceIndex(0) +16>Emitted(1, 53) Source(17, 62) + SourceIndex(0) +17>Emitted(1, 57) Source(17, 66) + SourceIndex(0) +18>Emitted(1, 59) Source(17, 68) + SourceIndex(0) +19>Emitted(1, 68) Source(17, 77) + SourceIndex(0) +20>Emitted(1, 70) Source(17, 79) + SourceIndex(0) +21>Emitted(1, 75) Source(17, 84) + SourceIndex(0) +22>Emitted(1, 77) Source(17, 86) + SourceIndex(0) +23>Emitted(1, 87) Source(17, 96) + SourceIndex(0) +24>Emitted(1, 89) Source(17, 98) + SourceIndex(0) +25>Emitted(1, 90) Source(17, 99) + SourceIndex(0) +26>Emitted(1, 91) Source(17, 100) + SourceIndex(0) +--- +>>>var multiRobots = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +1 > + > +2 >let +3 > multiRobots +4 > : MultiRobot[] = +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } +1 >Emitted(2, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(18, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(18, 33) + SourceIndex(0) +5 >Emitted(2, 20) Source(18, 34) + SourceIndex(0) +6 >Emitted(2, 22) Source(18, 36) + SourceIndex(0) +7 >Emitted(2, 26) Source(18, 40) + SourceIndex(0) +8 >Emitted(2, 28) Source(18, 42) + SourceIndex(0) +9 >Emitted(2, 35) Source(18, 49) + SourceIndex(0) +10>Emitted(2, 37) Source(18, 51) + SourceIndex(0) +11>Emitted(2, 43) Source(18, 57) + SourceIndex(0) +12>Emitted(2, 45) Source(18, 59) + SourceIndex(0) +13>Emitted(2, 47) Source(18, 61) + SourceIndex(0) +14>Emitted(2, 54) Source(18, 68) + SourceIndex(0) +15>Emitted(2, 56) Source(18, 70) + SourceIndex(0) +16>Emitted(2, 64) Source(18, 78) + SourceIndex(0) +17>Emitted(2, 66) Source(18, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(18, 89) + SourceIndex(0) +19>Emitted(2, 77) Source(18, 91) + SourceIndex(0) +20>Emitted(2, 83) Source(18, 97) + SourceIndex(0) +21>Emitted(2, 85) Source(18, 99) + SourceIndex(0) +22>Emitted(2, 87) Source(18, 101) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +1 >^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^ +1 >, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> ; +1 >Emitted(3, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(3, 7) Source(19, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(19, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(19, 13) + SourceIndex(0) +5 >Emitted(3, 22) Source(19, 22) + SourceIndex(0) +6 >Emitted(3, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(3, 30) Source(19, 30) + SourceIndex(0) +8 >Emitted(3, 32) Source(19, 32) + SourceIndex(0) +9 >Emitted(3, 34) Source(19, 34) + SourceIndex(0) +10>Emitted(3, 41) Source(19, 41) + SourceIndex(0) +11>Emitted(3, 43) Source(19, 43) + SourceIndex(0) +12>Emitted(3, 53) Source(19, 53) + SourceIndex(0) +13>Emitted(3, 55) Source(19, 55) + SourceIndex(0) +14>Emitted(3, 64) Source(19, 64) + SourceIndex(0) +15>Emitted(3, 66) Source(19, 66) + SourceIndex(0) +16>Emitted(3, 74) Source(19, 74) + SourceIndex(0) +17>Emitted(3, 76) Source(19, 76) + SourceIndex(0) +18>Emitted(3, 78) Source(19, 78) + SourceIndex(0) +19>Emitted(3, 79) Source(19, 79) + SourceIndex(0) +20>Emitted(3, 80) Source(19, 80) + SourceIndex(0) +--- +>>>function getRobots() { +1 > +2 >^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +1 >Emitted(4, 1) Source(21, 1) + SourceIndex(0) +--- +>>> return robots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobots() { + > +2 > return +3 > +4 > robots +5 > ; +1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) +3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(23, 2) + SourceIndex(0) +--- +>>>function getMultiRobots() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(7, 1) Source(25, 1) + SourceIndex(0) +--- +>>> return multiRobots; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobots() { + > +2 > return +3 > +4 > multiRobots +5 > ; +1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) +3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(27, 2) + SourceIndex(0) +--- +>>>var nameA, primaryA, secondaryA, i, skillA; +1-> +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^ +1-> + > + > +2 >let +3 > nameA: string +4 > , +5 > primaryA: string +6 > , +7 > secondaryA: string +8 > , +9 > i: number +10> , +11> skillA: string +12> ; +1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(10, 10) Source(29, 18) + SourceIndex(0) +4 >Emitted(10, 12) Source(29, 20) + SourceIndex(0) +5 >Emitted(10, 20) Source(29, 36) + SourceIndex(0) +6 >Emitted(10, 22) Source(29, 38) + SourceIndex(0) +7 >Emitted(10, 32) Source(29, 56) + SourceIndex(0) +8 >Emitted(10, 34) Source(29, 58) + SourceIndex(0) +9 >Emitted(10, 35) Source(29, 67) + SourceIndex(0) +10>Emitted(10, 37) Source(29, 69) + SourceIndex(0) +11>Emitted(10, 43) Source(29, 83) + SourceIndex(0) +12>Emitted(10, 44) Source(29, 84) + SourceIndex(0) +--- +>>>var name, primary, secondary, skill; +1 > +2 >^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > name: string +4 > , +5 > primary: string +6 > , +7 > secondary: string +8 > , +9 > skill: string +10> ; +1 >Emitted(11, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(11, 9) Source(30, 17) + SourceIndex(0) +4 >Emitted(11, 11) Source(30, 19) + SourceIndex(0) +5 >Emitted(11, 18) Source(30, 34) + SourceIndex(0) +6 >Emitted(11, 20) Source(30, 36) + SourceIndex(0) +7 >Emitted(11, 29) Source(30, 53) + SourceIndex(0) +8 >Emitted(11, 31) Source(30, 55) + SourceIndex(0) +9 >Emitted(11, 36) Source(30, 68) + SourceIndex(0) +10>Emitted(11, 37) Source(30, 69) + SourceIndex(0) +--- +>>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^-> +1-> + > + > +2 >for +3 > +4 > ({name: nameA = "noName" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(12, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(12, 4) Source(32, 4) + SourceIndex(0) +3 >Emitted(12, 5) Source(32, 5) + SourceIndex(0) +4 >Emitted(12, 6) Source(32, 35) + SourceIndex(0) +5 >Emitted(12, 16) Source(32, 41) + SourceIndex(0) +6 >Emitted(12, 18) Source(32, 35) + SourceIndex(0) +7 >Emitted(12, 35) Source(32, 41) + SourceIndex(0) +8 >Emitted(12, 37) Source(32, 35) + SourceIndex(0) +9 >Emitted(12, 57) Source(32, 41) + SourceIndex(0) +10>Emitted(12, 59) Source(32, 35) + SourceIndex(0) +11>Emitted(12, 63) Source(32, 41) + SourceIndex(0) +12>Emitted(12, 64) Source(32, 42) + SourceIndex(0) +--- +>>> _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(13, 5) Source(32, 7) + SourceIndex(0) +2 >Emitted(13, 27) Source(32, 29) + SourceIndex(0) +3 >Emitted(13, 29) Source(32, 7) + SourceIndex(0) +4 >Emitted(13, 66) Source(32, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(14, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(14, 22) Source(33, 22) + SourceIndex(0) +7 >Emitted(14, 23) Source(33, 23) + SourceIndex(0) +8 >Emitted(14, 24) Source(33, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(15, 2) Source(34, 2) + SourceIndex(0) +--- +>>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(16, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(16, 4) Source(35, 4) + SourceIndex(0) +3 >Emitted(16, 5) Source(35, 5) + SourceIndex(0) +4 >Emitted(16, 6) Source(35, 35) + SourceIndex(0) +5 >Emitted(16, 16) Source(35, 46) + SourceIndex(0) +6 >Emitted(16, 18) Source(35, 35) + SourceIndex(0) +7 >Emitted(16, 23) Source(35, 35) + SourceIndex(0) +8 >Emitted(16, 32) Source(35, 44) + SourceIndex(0) +9 >Emitted(16, 34) Source(35, 46) + SourceIndex(0) +10>Emitted(16, 36) Source(35, 35) + SourceIndex(0) +11>Emitted(16, 50) Source(35, 46) + SourceIndex(0) +12>Emitted(16, 52) Source(35, 35) + SourceIndex(0) +13>Emitted(16, 56) Source(35, 46) + SourceIndex(0) +14>Emitted(16, 57) Source(35, 47) + SourceIndex(0) +--- +>>> _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1->Emitted(17, 5) Source(35, 7) + SourceIndex(0) +2 >Emitted(17, 21) Source(35, 29) + SourceIndex(0) +3 >Emitted(17, 23) Source(35, 7) + SourceIndex(0) +4 >Emitted(17, 60) Source(35, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(18, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(18, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(18, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(18, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(18, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(18, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(18, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) +--- +>>>for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) +3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) +4 >Emitted(20, 6) Source(38, 35) + SourceIndex(0) +5 >Emitted(20, 16) Source(38, 111) + SourceIndex(0) +6 >Emitted(20, 18) Source(38, 35) + SourceIndex(0) +7 >Emitted(20, 24) Source(38, 36) + SourceIndex(0) +8 >Emitted(20, 26) Source(38, 38) + SourceIndex(0) +9 >Emitted(20, 30) Source(38, 42) + SourceIndex(0) +10>Emitted(20, 32) Source(38, 44) + SourceIndex(0) +11>Emitted(20, 39) Source(38, 51) + SourceIndex(0) +12>Emitted(20, 41) Source(38, 53) + SourceIndex(0) +13>Emitted(20, 46) Source(38, 58) + SourceIndex(0) +14>Emitted(20, 48) Source(38, 60) + SourceIndex(0) +15>Emitted(20, 56) Source(38, 68) + SourceIndex(0) +16>Emitted(20, 58) Source(38, 70) + SourceIndex(0) +17>Emitted(20, 60) Source(38, 72) + SourceIndex(0) +18>Emitted(20, 62) Source(38, 74) + SourceIndex(0) +19>Emitted(20, 66) Source(38, 78) + SourceIndex(0) +20>Emitted(20, 68) Source(38, 80) + SourceIndex(0) +21>Emitted(20, 77) Source(38, 89) + SourceIndex(0) +22>Emitted(20, 79) Source(38, 91) + SourceIndex(0) +23>Emitted(20, 84) Source(38, 96) + SourceIndex(0) +24>Emitted(20, 86) Source(38, 98) + SourceIndex(0) +25>Emitted(20, 96) Source(38, 108) + SourceIndex(0) +26>Emitted(20, 98) Source(38, 110) + SourceIndex(0) +27>Emitted(20, 99) Source(38, 111) + SourceIndex(0) +28>Emitted(20, 101) Source(38, 35) + SourceIndex(0) +29>Emitted(20, 115) Source(38, 111) + SourceIndex(0) +30>Emitted(20, 117) Source(38, 35) + SourceIndex(0) +31>Emitted(20, 121) Source(38, 111) + SourceIndex(0) +32>Emitted(20, 122) Source(38, 112) + SourceIndex(0) +--- +>>> _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name: nameA = "noName" +3 > +4 > name: nameA = "noName" +1 >Emitted(21, 5) Source(38, 7) + SourceIndex(0) +2 >Emitted(21, 21) Source(38, 29) + SourceIndex(0) +3 >Emitted(21, 23) Source(38, 7) + SourceIndex(0) +4 >Emitted(21, 60) Source(38, 29) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(22, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(22, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(22, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(22, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(22, 22) Source(39, 22) + SourceIndex(0) +7 >Emitted(22, 23) Source(39, 23) + SourceIndex(0) +8 >Emitted(22, 24) Source(39, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) +--- +>>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) +3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) +4 >Emitted(24, 6) Source(42, 55) + SourceIndex(0) +5 >Emitted(24, 16) Source(42, 66) + SourceIndex(0) +6 >Emitted(24, 18) Source(42, 55) + SourceIndex(0) +7 >Emitted(24, 45) Source(42, 66) + SourceIndex(0) +8 >Emitted(24, 47) Source(42, 55) + SourceIndex(0) +9 >Emitted(24, 72) Source(42, 66) + SourceIndex(0) +10>Emitted(24, 74) Source(42, 55) + SourceIndex(0) +11>Emitted(24, 78) Source(42, 66) + SourceIndex(0) +12>Emitted(24, 79) Source(42, 67) + SourceIndex(0) +--- +>>> _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(25, 5) Source(41, 8) + SourceIndex(0) +2 >Emitted(25, 34) Source(42, 49) + SourceIndex(0) +3 >Emitted(25, 36) Source(41, 8) + SourceIndex(0) +4 >Emitted(25, 106) Source(42, 49) + SourceIndex(0) +5 >Emitted(25, 108) Source(41, 18) + SourceIndex(0) +6 >Emitted(25, 123) Source(41, 47) + SourceIndex(0) +7 >Emitted(25, 125) Source(41, 18) + SourceIndex(0) +8 >Emitted(25, 166) Source(41, 47) + SourceIndex(0) +9 >Emitted(25, 168) Source(41, 49) + SourceIndex(0) +10>Emitted(25, 185) Source(41, 84) + SourceIndex(0) +11>Emitted(25, 187) Source(41, 49) + SourceIndex(0) +12>Emitted(25, 232) Source(41, 84) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(26, 5) Source(43, 5) + SourceIndex(0) +2 >Emitted(26, 12) Source(43, 12) + SourceIndex(0) +3 >Emitted(26, 13) Source(43, 13) + SourceIndex(0) +4 >Emitted(26, 16) Source(43, 16) + SourceIndex(0) +5 >Emitted(26, 17) Source(43, 17) + SourceIndex(0) +6 >Emitted(26, 25) Source(43, 25) + SourceIndex(0) +7 >Emitted(26, 26) Source(43, 26) + SourceIndex(0) +8 >Emitted(26, 27) Source(43, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(27, 2) Source(44, 2) + SourceIndex(0) +--- +>>>for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(28, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(28, 4) Source(45, 4) + SourceIndex(0) +3 >Emitted(28, 5) Source(45, 5) + SourceIndex(0) +4 >Emitted(28, 6) Source(46, 55) + SourceIndex(0) +5 >Emitted(28, 16) Source(46, 71) + SourceIndex(0) +6 >Emitted(28, 18) Source(46, 55) + SourceIndex(0) +7 >Emitted(28, 23) Source(46, 55) + SourceIndex(0) +8 >Emitted(28, 37) Source(46, 69) + SourceIndex(0) +9 >Emitted(28, 39) Source(46, 71) + SourceIndex(0) +10>Emitted(28, 41) Source(46, 55) + SourceIndex(0) +11>Emitted(28, 55) Source(46, 71) + SourceIndex(0) +12>Emitted(28, 57) Source(46, 55) + SourceIndex(0) +13>Emitted(28, 61) Source(46, 71) + SourceIndex(0) +14>Emitted(28, 62) Source(46, 72) + SourceIndex(0) +--- +>>> _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(29, 5) Source(45, 8) + SourceIndex(0) +2 >Emitted(29, 23) Source(46, 49) + SourceIndex(0) +3 >Emitted(29, 25) Source(45, 8) + SourceIndex(0) +4 >Emitted(29, 95) Source(46, 49) + SourceIndex(0) +5 >Emitted(29, 97) Source(45, 18) + SourceIndex(0) +6 >Emitted(29, 112) Source(45, 47) + SourceIndex(0) +7 >Emitted(29, 114) Source(45, 18) + SourceIndex(0) +8 >Emitted(29, 155) Source(45, 47) + SourceIndex(0) +9 >Emitted(29, 157) Source(45, 49) + SourceIndex(0) +10>Emitted(29, 174) Source(45, 84) + SourceIndex(0) +11>Emitted(29, 176) Source(45, 49) + SourceIndex(0) +12>Emitted(29, 221) Source(45, 84) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(30, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(30, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(30, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(30, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(30, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(30, 25) Source(47, 25) + SourceIndex(0) +7 >Emitted(30, 26) Source(47, 26) + SourceIndex(0) +8 >Emitted(30, 27) Source(47, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(31, 2) Source(48, 2) + SourceIndex(0) +--- +>>>for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of + > +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(32, 1) Source(49, 1) + SourceIndex(0) +2 >Emitted(32, 4) Source(49, 4) + SourceIndex(0) +3 >Emitted(32, 5) Source(49, 5) + SourceIndex(0) +4 >Emitted(32, 6) Source(51, 5) + SourceIndex(0) +5 >Emitted(32, 16) Source(52, 83) + SourceIndex(0) +6 >Emitted(32, 18) Source(51, 5) + SourceIndex(0) +7 >Emitted(32, 23) Source(51, 19) + SourceIndex(0) +8 >Emitted(32, 24) Source(51, 20) + SourceIndex(0) +9 >Emitted(32, 26) Source(51, 22) + SourceIndex(0) +10>Emitted(32, 30) Source(51, 26) + SourceIndex(0) +11>Emitted(32, 32) Source(51, 28) + SourceIndex(0) +12>Emitted(32, 39) Source(51, 35) + SourceIndex(0) +13>Emitted(32, 41) Source(51, 37) + SourceIndex(0) +14>Emitted(32, 47) Source(51, 43) + SourceIndex(0) +15>Emitted(32, 49) Source(51, 45) + SourceIndex(0) +16>Emitted(32, 51) Source(51, 47) + SourceIndex(0) +17>Emitted(32, 58) Source(51, 54) + SourceIndex(0) +18>Emitted(32, 60) Source(51, 56) + SourceIndex(0) +19>Emitted(32, 68) Source(51, 64) + SourceIndex(0) +20>Emitted(32, 70) Source(51, 66) + SourceIndex(0) +21>Emitted(32, 79) Source(51, 75) + SourceIndex(0) +22>Emitted(32, 81) Source(51, 77) + SourceIndex(0) +23>Emitted(32, 87) Source(51, 83) + SourceIndex(0) +24>Emitted(32, 89) Source(51, 85) + SourceIndex(0) +25>Emitted(32, 91) Source(51, 87) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(33, 5) Source(52, 9) + SourceIndex(0) +2 >Emitted(33, 7) Source(52, 11) + SourceIndex(0) +3 >Emitted(33, 11) Source(52, 15) + SourceIndex(0) +4 >Emitted(33, 13) Source(52, 17) + SourceIndex(0) +5 >Emitted(33, 22) Source(52, 26) + SourceIndex(0) +6 >Emitted(33, 24) Source(52, 28) + SourceIndex(0) +7 >Emitted(33, 30) Source(52, 34) + SourceIndex(0) +8 >Emitted(33, 32) Source(52, 36) + SourceIndex(0) +9 >Emitted(33, 34) Source(52, 38) + SourceIndex(0) +10>Emitted(33, 41) Source(52, 45) + SourceIndex(0) +11>Emitted(33, 43) Source(52, 47) + SourceIndex(0) +12>Emitted(33, 53) Source(52, 57) + SourceIndex(0) +13>Emitted(33, 55) Source(52, 59) + SourceIndex(0) +14>Emitted(33, 64) Source(52, 68) + SourceIndex(0) +15>Emitted(33, 66) Source(52, 70) + SourceIndex(0) +16>Emitted(33, 74) Source(52, 78) + SourceIndex(0) +17>Emitted(33, 76) Source(52, 80) + SourceIndex(0) +18>Emitted(33, 78) Source(52, 82) + SourceIndex(0) +19>Emitted(33, 79) Source(52, 83) + SourceIndex(0) +20>Emitted(33, 81) Source(51, 5) + SourceIndex(0) +21>Emitted(33, 95) Source(52, 83) + SourceIndex(0) +22>Emitted(33, 97) Source(51, 5) + SourceIndex(0) +23>Emitted(33, 101) Source(52, 83) + SourceIndex(0) +24>Emitted(33, 102) Source(52, 84) + SourceIndex(0) +--- +>>> _w = _v[_u].skills, _x = _w === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _w, _y = _x.primary, primaryA = _y === void 0 ? "primary" : _y, _z = _x.secondary, secondaryA = _z === void 0 ? "secondary" : _z; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +3 > +4 > skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(34, 5) Source(49, 8) + SourceIndex(0) +2 >Emitted(34, 23) Source(50, 49) + SourceIndex(0) +3 >Emitted(34, 25) Source(49, 8) + SourceIndex(0) +4 >Emitted(34, 95) Source(50, 49) + SourceIndex(0) +5 >Emitted(34, 97) Source(49, 18) + SourceIndex(0) +6 >Emitted(34, 112) Source(49, 47) + SourceIndex(0) +7 >Emitted(34, 114) Source(49, 18) + SourceIndex(0) +8 >Emitted(34, 155) Source(49, 47) + SourceIndex(0) +9 >Emitted(34, 157) Source(49, 49) + SourceIndex(0) +10>Emitted(34, 174) Source(49, 84) + SourceIndex(0) +11>Emitted(34, 176) Source(49, 49) + SourceIndex(0) +12>Emitted(34, 221) Source(49, 84) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } = + > { primary: "nosKill", secondary: "noSkill" } } of + > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(35, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(35, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(35, 13) Source(53, 13) + SourceIndex(0) +4 >Emitted(35, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(35, 17) Source(53, 17) + SourceIndex(0) +6 >Emitted(35, 25) Source(53, 25) + SourceIndex(0) +7 >Emitted(35, 26) Source(53, 26) + SourceIndex(0) +8 >Emitted(35, 27) Source(53, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(36, 2) Source(54, 2) + SourceIndex(0) +--- +>>>for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^-> +1-> + > + > +2 >for +3 > +4 > ({ name = "noName" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(37, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(37, 4) Source(56, 4) + SourceIndex(0) +3 >Emitted(37, 5) Source(56, 5) + SourceIndex(0) +4 >Emitted(37, 6) Source(56, 29) + SourceIndex(0) +5 >Emitted(37, 16) Source(56, 35) + SourceIndex(0) +6 >Emitted(37, 18) Source(56, 29) + SourceIndex(0) +7 >Emitted(37, 35) Source(56, 35) + SourceIndex(0) +8 >Emitted(37, 37) Source(56, 29) + SourceIndex(0) +9 >Emitted(37, 57) Source(56, 35) + SourceIndex(0) +10>Emitted(37, 59) Source(56, 29) + SourceIndex(0) +11>Emitted(37, 63) Source(56, 35) + SourceIndex(0) +12>Emitted(37, 64) Source(56, 36) + SourceIndex(0) +--- +>>> _1 = robots_2[_0].name, name = _1 === void 0 ? "noName" : _1; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name = "noName" +3 > +4 > name = "noName" +1->Emitted(38, 5) Source(56, 8) + SourceIndex(0) +2 >Emitted(38, 27) Source(56, 23) + SourceIndex(0) +3 >Emitted(38, 29) Source(56, 8) + SourceIndex(0) +4 >Emitted(38, 65) Source(56, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(39, 5) Source(57, 5) + SourceIndex(0) +2 >Emitted(39, 12) Source(57, 12) + SourceIndex(0) +3 >Emitted(39, 13) Source(57, 13) + SourceIndex(0) +4 >Emitted(39, 16) Source(57, 16) + SourceIndex(0) +5 >Emitted(39, 17) Source(57, 17) + SourceIndex(0) +6 >Emitted(39, 22) Source(57, 22) + SourceIndex(0) +7 >Emitted(39, 23) Source(57, 23) + SourceIndex(0) +8 >Emitted(39, 24) Source(57, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(40, 2) Source(58, 2) + SourceIndex(0) +--- +>>>for (var _2 = 0, _3 = getRobots(); _2 < _3.length; _2++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^ +15> ^^^^-> +1-> + > +2 >for +3 > +4 > ({ name = "noName" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(41, 1) Source(59, 1) + SourceIndex(0) +2 >Emitted(41, 4) Source(59, 4) + SourceIndex(0) +3 >Emitted(41, 5) Source(59, 5) + SourceIndex(0) +4 >Emitted(41, 6) Source(59, 29) + SourceIndex(0) +5 >Emitted(41, 16) Source(59, 40) + SourceIndex(0) +6 >Emitted(41, 18) Source(59, 29) + SourceIndex(0) +7 >Emitted(41, 23) Source(59, 29) + SourceIndex(0) +8 >Emitted(41, 32) Source(59, 38) + SourceIndex(0) +9 >Emitted(41, 34) Source(59, 40) + SourceIndex(0) +10>Emitted(41, 36) Source(59, 29) + SourceIndex(0) +11>Emitted(41, 50) Source(59, 40) + SourceIndex(0) +12>Emitted(41, 52) Source(59, 29) + SourceIndex(0) +13>Emitted(41, 56) Source(59, 40) + SourceIndex(0) +14>Emitted(41, 57) Source(59, 41) + SourceIndex(0) +--- +>>> _4 = _3[_2].name, name = _4 === void 0 ? "noName" : _4; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name = "noName" +3 > +4 > name = "noName" +1->Emitted(42, 5) Source(59, 8) + SourceIndex(0) +2 >Emitted(42, 21) Source(59, 23) + SourceIndex(0) +3 >Emitted(42, 23) Source(59, 8) + SourceIndex(0) +4 >Emitted(42, 59) Source(59, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(43, 5) Source(60, 5) + SourceIndex(0) +2 >Emitted(43, 12) Source(60, 12) + SourceIndex(0) +3 >Emitted(43, 13) Source(60, 13) + SourceIndex(0) +4 >Emitted(43, 16) Source(60, 16) + SourceIndex(0) +5 >Emitted(43, 17) Source(60, 17) + SourceIndex(0) +6 >Emitted(43, 22) Source(60, 22) + SourceIndex(0) +7 >Emitted(43, 23) Source(60, 23) + SourceIndex(0) +8 >Emitted(43, 24) Source(60, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(44, 2) Source(61, 2) + SourceIndex(0) +--- +>>>for (var _5 = 0, _6 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _5 < _6.length; _5++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^ +32> ^ +1-> + > +2 >for +3 > +4 > ({ name = "noName" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(45, 1) Source(62, 1) + SourceIndex(0) +2 >Emitted(45, 4) Source(62, 4) + SourceIndex(0) +3 >Emitted(45, 5) Source(62, 5) + SourceIndex(0) +4 >Emitted(45, 6) Source(62, 29) + SourceIndex(0) +5 >Emitted(45, 16) Source(62, 105) + SourceIndex(0) +6 >Emitted(45, 18) Source(62, 29) + SourceIndex(0) +7 >Emitted(45, 24) Source(62, 30) + SourceIndex(0) +8 >Emitted(45, 26) Source(62, 32) + SourceIndex(0) +9 >Emitted(45, 30) Source(62, 36) + SourceIndex(0) +10>Emitted(45, 32) Source(62, 38) + SourceIndex(0) +11>Emitted(45, 39) Source(62, 45) + SourceIndex(0) +12>Emitted(45, 41) Source(62, 47) + SourceIndex(0) +13>Emitted(45, 46) Source(62, 52) + SourceIndex(0) +14>Emitted(45, 48) Source(62, 54) + SourceIndex(0) +15>Emitted(45, 56) Source(62, 62) + SourceIndex(0) +16>Emitted(45, 58) Source(62, 64) + SourceIndex(0) +17>Emitted(45, 60) Source(62, 66) + SourceIndex(0) +18>Emitted(45, 62) Source(62, 68) + SourceIndex(0) +19>Emitted(45, 66) Source(62, 72) + SourceIndex(0) +20>Emitted(45, 68) Source(62, 74) + SourceIndex(0) +21>Emitted(45, 77) Source(62, 83) + SourceIndex(0) +22>Emitted(45, 79) Source(62, 85) + SourceIndex(0) +23>Emitted(45, 84) Source(62, 90) + SourceIndex(0) +24>Emitted(45, 86) Source(62, 92) + SourceIndex(0) +25>Emitted(45, 96) Source(62, 102) + SourceIndex(0) +26>Emitted(45, 98) Source(62, 104) + SourceIndex(0) +27>Emitted(45, 99) Source(62, 105) + SourceIndex(0) +28>Emitted(45, 101) Source(62, 29) + SourceIndex(0) +29>Emitted(45, 115) Source(62, 105) + SourceIndex(0) +30>Emitted(45, 117) Source(62, 29) + SourceIndex(0) +31>Emitted(45, 121) Source(62, 105) + SourceIndex(0) +32>Emitted(45, 122) Source(62, 106) + SourceIndex(0) +--- +>>> _7 = _6[_5].name, name = _7 === void 0 ? "noName" : _7; +1 >^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > name = "noName" +3 > +4 > name = "noName" +1 >Emitted(46, 5) Source(62, 8) + SourceIndex(0) +2 >Emitted(46, 21) Source(62, 23) + SourceIndex(0) +3 >Emitted(46, 23) Source(62, 8) + SourceIndex(0) +4 >Emitted(46, 59) Source(62, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(47, 5) Source(63, 5) + SourceIndex(0) +2 >Emitted(47, 12) Source(63, 12) + SourceIndex(0) +3 >Emitted(47, 13) Source(63, 13) + SourceIndex(0) +4 >Emitted(47, 16) Source(63, 16) + SourceIndex(0) +5 >Emitted(47, 17) Source(63, 17) + SourceIndex(0) +6 >Emitted(47, 22) Source(63, 22) + SourceIndex(0) +7 >Emitted(47, 23) Source(63, 23) + SourceIndex(0) +8 >Emitted(47, 24) Source(63, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(48, 2) Source(64, 2) + SourceIndex(0) +--- +>>>for (var _8 = 0, multiRobots_2 = multiRobots; _8 < multiRobots_2.length; _8++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(49, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(49, 4) Source(65, 4) + SourceIndex(0) +3 >Emitted(49, 5) Source(65, 5) + SourceIndex(0) +4 >Emitted(49, 6) Source(70, 6) + SourceIndex(0) +5 >Emitted(49, 16) Source(70, 17) + SourceIndex(0) +6 >Emitted(49, 18) Source(70, 6) + SourceIndex(0) +7 >Emitted(49, 45) Source(70, 17) + SourceIndex(0) +8 >Emitted(49, 47) Source(70, 6) + SourceIndex(0) +9 >Emitted(49, 72) Source(70, 17) + SourceIndex(0) +10>Emitted(49, 74) Source(70, 6) + SourceIndex(0) +11>Emitted(49, 78) Source(70, 17) + SourceIndex(0) +12>Emitted(49, 79) Source(70, 18) + SourceIndex(0) +--- +>>> _9 = multiRobots_2[_8].skills, _10 = _9 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _9, _11 = _10.primary, primary = _11 === void 0 ? "primary" : _11, _12 = _10.secondary, secondary = _12 === void 0 ? "secondary" : _12; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary = "primary" +7 > +8 > primary = "primary" +9 > , + > +10> secondary = "secondary" +11> +12> secondary = "secondary" +1->Emitted(50, 5) Source(66, 5) + SourceIndex(0) +2 >Emitted(50, 34) Source(69, 53) + SourceIndex(0) +3 >Emitted(50, 36) Source(66, 5) + SourceIndex(0) +4 >Emitted(50, 107) Source(69, 53) + SourceIndex(0) +5 >Emitted(50, 109) Source(67, 9) + SourceIndex(0) +6 >Emitted(50, 126) Source(67, 28) + SourceIndex(0) +7 >Emitted(50, 128) Source(67, 9) + SourceIndex(0) +8 >Emitted(50, 170) Source(67, 28) + SourceIndex(0) +9 >Emitted(50, 172) Source(68, 9) + SourceIndex(0) +10>Emitted(50, 191) Source(68, 32) + SourceIndex(0) +11>Emitted(50, 193) Source(68, 9) + SourceIndex(0) +12>Emitted(50, 239) Source(68, 32) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) +2 >Emitted(51, 12) Source(71, 12) + SourceIndex(0) +3 >Emitted(51, 13) Source(71, 13) + SourceIndex(0) +4 >Emitted(51, 16) Source(71, 16) + SourceIndex(0) +5 >Emitted(51, 17) Source(71, 17) + SourceIndex(0) +6 >Emitted(51, 25) Source(71, 25) + SourceIndex(0) +7 >Emitted(51, 26) Source(71, 26) + SourceIndex(0) +8 >Emitted(51, 27) Source(71, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(52, 2) Source(72, 2) + SourceIndex(0) +--- +>>>for (var _13 = 0, _14 = getMultiRobots(); _13 < _14.length; _13++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(53, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(53, 4) Source(73, 4) + SourceIndex(0) +3 >Emitted(53, 5) Source(73, 5) + SourceIndex(0) +4 >Emitted(53, 6) Source(78, 6) + SourceIndex(0) +5 >Emitted(53, 17) Source(78, 22) + SourceIndex(0) +6 >Emitted(53, 19) Source(78, 6) + SourceIndex(0) +7 >Emitted(53, 25) Source(78, 6) + SourceIndex(0) +8 >Emitted(53, 39) Source(78, 20) + SourceIndex(0) +9 >Emitted(53, 41) Source(78, 22) + SourceIndex(0) +10>Emitted(53, 43) Source(78, 6) + SourceIndex(0) +11>Emitted(53, 59) Source(78, 22) + SourceIndex(0) +12>Emitted(53, 61) Source(78, 6) + SourceIndex(0) +13>Emitted(53, 66) Source(78, 22) + SourceIndex(0) +14>Emitted(53, 67) Source(78, 23) + SourceIndex(0) +--- +>>> _15 = _14[_13].skills, _16 = _15 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _15, _17 = _16.primary, primary = _17 === void 0 ? "primary" : _17, _18 = _16.secondary, secondary = _18 === void 0 ? "secondary" : _18; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary = "primary" +7 > +8 > primary = "primary" +9 > , + > +10> secondary = "secondary" +11> +12> secondary = "secondary" +1->Emitted(54, 5) Source(74, 5) + SourceIndex(0) +2 >Emitted(54, 26) Source(77, 53) + SourceIndex(0) +3 >Emitted(54, 28) Source(74, 5) + SourceIndex(0) +4 >Emitted(54, 101) Source(77, 53) + SourceIndex(0) +5 >Emitted(54, 103) Source(75, 9) + SourceIndex(0) +6 >Emitted(54, 120) Source(75, 28) + SourceIndex(0) +7 >Emitted(54, 122) Source(75, 9) + SourceIndex(0) +8 >Emitted(54, 164) Source(75, 28) + SourceIndex(0) +9 >Emitted(54, 166) Source(76, 9) + SourceIndex(0) +10>Emitted(54, 185) Source(76, 32) + SourceIndex(0) +11>Emitted(54, 187) Source(76, 9) + SourceIndex(0) +12>Emitted(54, 233) Source(76, 32) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(55, 5) Source(79, 5) + SourceIndex(0) +2 >Emitted(55, 12) Source(79, 12) + SourceIndex(0) +3 >Emitted(55, 13) Source(79, 13) + SourceIndex(0) +4 >Emitted(55, 16) Source(79, 16) + SourceIndex(0) +5 >Emitted(55, 17) Source(79, 17) + SourceIndex(0) +6 >Emitted(55, 25) Source(79, 25) + SourceIndex(0) +7 >Emitted(55, 26) Source(79, 26) + SourceIndex(0) +8 >Emitted(55, 27) Source(79, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(56, 2) Source(80, 2) + SourceIndex(0) +--- +>>>for (var _19 = 0, _20 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(57, 1) Source(81, 1) + SourceIndex(0) +2 >Emitted(57, 4) Source(81, 4) + SourceIndex(0) +3 >Emitted(57, 5) Source(81, 5) + SourceIndex(0) +4 >Emitted(57, 6) Source(86, 6) + SourceIndex(0) +5 >Emitted(57, 17) Source(87, 79) + SourceIndex(0) +6 >Emitted(57, 19) Source(86, 6) + SourceIndex(0) +7 >Emitted(57, 26) Source(86, 7) + SourceIndex(0) +8 >Emitted(57, 28) Source(86, 9) + SourceIndex(0) +9 >Emitted(57, 32) Source(86, 13) + SourceIndex(0) +10>Emitted(57, 34) Source(86, 15) + SourceIndex(0) +11>Emitted(57, 41) Source(86, 22) + SourceIndex(0) +12>Emitted(57, 43) Source(86, 24) + SourceIndex(0) +13>Emitted(57, 49) Source(86, 30) + SourceIndex(0) +14>Emitted(57, 51) Source(86, 32) + SourceIndex(0) +15>Emitted(57, 53) Source(86, 34) + SourceIndex(0) +16>Emitted(57, 60) Source(86, 41) + SourceIndex(0) +17>Emitted(57, 62) Source(86, 43) + SourceIndex(0) +18>Emitted(57, 70) Source(86, 51) + SourceIndex(0) +19>Emitted(57, 72) Source(86, 53) + SourceIndex(0) +20>Emitted(57, 81) Source(86, 62) + SourceIndex(0) +21>Emitted(57, 83) Source(86, 64) + SourceIndex(0) +22>Emitted(57, 89) Source(86, 70) + SourceIndex(0) +23>Emitted(57, 91) Source(86, 72) + SourceIndex(0) +24>Emitted(57, 93) Source(86, 74) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _19 < _20.length; _19++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(58, 5) Source(87, 5) + SourceIndex(0) +2 >Emitted(58, 7) Source(87, 7) + SourceIndex(0) +3 >Emitted(58, 11) Source(87, 11) + SourceIndex(0) +4 >Emitted(58, 13) Source(87, 13) + SourceIndex(0) +5 >Emitted(58, 22) Source(87, 22) + SourceIndex(0) +6 >Emitted(58, 24) Source(87, 24) + SourceIndex(0) +7 >Emitted(58, 30) Source(87, 30) + SourceIndex(0) +8 >Emitted(58, 32) Source(87, 32) + SourceIndex(0) +9 >Emitted(58, 34) Source(87, 34) + SourceIndex(0) +10>Emitted(58, 41) Source(87, 41) + SourceIndex(0) +11>Emitted(58, 43) Source(87, 43) + SourceIndex(0) +12>Emitted(58, 53) Source(87, 53) + SourceIndex(0) +13>Emitted(58, 55) Source(87, 55) + SourceIndex(0) +14>Emitted(58, 64) Source(87, 64) + SourceIndex(0) +15>Emitted(58, 66) Source(87, 66) + SourceIndex(0) +16>Emitted(58, 74) Source(87, 74) + SourceIndex(0) +17>Emitted(58, 76) Source(87, 76) + SourceIndex(0) +18>Emitted(58, 78) Source(87, 78) + SourceIndex(0) +19>Emitted(58, 79) Source(87, 79) + SourceIndex(0) +20>Emitted(58, 81) Source(86, 6) + SourceIndex(0) +21>Emitted(58, 97) Source(87, 79) + SourceIndex(0) +22>Emitted(58, 99) Source(86, 6) + SourceIndex(0) +23>Emitted(58, 104) Source(87, 79) + SourceIndex(0) +24>Emitted(58, 105) Source(87, 80) + SourceIndex(0) +--- +>>> _21 = _20[_19].skills, _22 = _21 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _21, _23 = _22.primary, primary = _23 === void 0 ? "primary" : _23, _24 = _22.secondary, secondary = _24 === void 0 ? "secondary" : _24; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary = "primary" +7 > +8 > primary = "primary" +9 > , + > +10> secondary = "secondary" +11> +12> secondary = "secondary" +1->Emitted(59, 5) Source(82, 5) + SourceIndex(0) +2 >Emitted(59, 26) Source(85, 53) + SourceIndex(0) +3 >Emitted(59, 28) Source(82, 5) + SourceIndex(0) +4 >Emitted(59, 101) Source(85, 53) + SourceIndex(0) +5 >Emitted(59, 103) Source(83, 9) + SourceIndex(0) +6 >Emitted(59, 120) Source(83, 28) + SourceIndex(0) +7 >Emitted(59, 122) Source(83, 9) + SourceIndex(0) +8 >Emitted(59, 164) Source(83, 28) + SourceIndex(0) +9 >Emitted(59, 166) Source(84, 9) + SourceIndex(0) +10>Emitted(59, 185) Source(84, 32) + SourceIndex(0) +11>Emitted(59, 187) Source(84, 9) + SourceIndex(0) +12>Emitted(59, 233) Source(84, 32) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(60, 5) Source(88, 5) + SourceIndex(0) +2 >Emitted(60, 12) Source(88, 12) + SourceIndex(0) +3 >Emitted(60, 13) Source(88, 13) + SourceIndex(0) +4 >Emitted(60, 16) Source(88, 16) + SourceIndex(0) +5 >Emitted(60, 17) Source(88, 17) + SourceIndex(0) +6 >Emitted(60, 25) Source(88, 25) + SourceIndex(0) +7 >Emitted(60, 26) Source(88, 26) + SourceIndex(0) +8 >Emitted(60, 27) Source(88, 27) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(61, 2) Source(89, 2) + SourceIndex(0) +--- +>>>for (var _25 = 0, robots_3 = robots; _25 < robots_3.length; _25++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > + > +2 >for +3 > +4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(62, 1) Source(92, 1) + SourceIndex(0) +2 >Emitted(62, 4) Source(92, 4) + SourceIndex(0) +3 >Emitted(62, 5) Source(92, 5) + SourceIndex(0) +4 >Emitted(62, 6) Source(92, 62) + SourceIndex(0) +5 >Emitted(62, 17) Source(92, 68) + SourceIndex(0) +6 >Emitted(62, 19) Source(92, 62) + SourceIndex(0) +7 >Emitted(62, 36) Source(92, 68) + SourceIndex(0) +8 >Emitted(62, 38) Source(92, 62) + SourceIndex(0) +9 >Emitted(62, 59) Source(92, 68) + SourceIndex(0) +10>Emitted(62, 61) Source(92, 62) + SourceIndex(0) +11>Emitted(62, 66) Source(92, 68) + SourceIndex(0) +12>Emitted(62, 67) Source(92, 69) + SourceIndex(0) +--- +>>> _26 = robots_3[_25], _27 = _26.name, nameA = _27 === void 0 ? "noName" : _27, _28 = _26.skill, skillA = _28 === void 0 ? "noSkill" : _28; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(63, 5) Source(92, 6) + SourceIndex(0) +2 >Emitted(63, 24) Source(92, 58) + SourceIndex(0) +3 >Emitted(63, 26) Source(92, 7) + SourceIndex(0) +4 >Emitted(63, 40) Source(92, 29) + SourceIndex(0) +5 >Emitted(63, 42) Source(92, 7) + SourceIndex(0) +6 >Emitted(63, 81) Source(92, 29) + SourceIndex(0) +7 >Emitted(63, 83) Source(92, 31) + SourceIndex(0) +8 >Emitted(63, 98) Source(92, 56) + SourceIndex(0) +9 >Emitted(63, 100) Source(92, 31) + SourceIndex(0) +10>Emitted(63, 141) Source(92, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(64, 5) Source(93, 5) + SourceIndex(0) +2 >Emitted(64, 12) Source(93, 12) + SourceIndex(0) +3 >Emitted(64, 13) Source(93, 13) + SourceIndex(0) +4 >Emitted(64, 16) Source(93, 16) + SourceIndex(0) +5 >Emitted(64, 17) Source(93, 17) + SourceIndex(0) +6 >Emitted(64, 22) Source(93, 22) + SourceIndex(0) +7 >Emitted(64, 23) Source(93, 23) + SourceIndex(0) +8 >Emitted(64, 24) Source(93, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(65, 2) Source(94, 2) + SourceIndex(0) +--- +>>>for (var _29 = 0, _30 = getRobots(); _29 < _30.length; _29++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(66, 1) Source(95, 1) + SourceIndex(0) +2 >Emitted(66, 4) Source(95, 4) + SourceIndex(0) +3 >Emitted(66, 5) Source(95, 5) + SourceIndex(0) +4 >Emitted(66, 6) Source(95, 63) + SourceIndex(0) +5 >Emitted(66, 17) Source(95, 74) + SourceIndex(0) +6 >Emitted(66, 19) Source(95, 63) + SourceIndex(0) +7 >Emitted(66, 25) Source(95, 63) + SourceIndex(0) +8 >Emitted(66, 34) Source(95, 72) + SourceIndex(0) +9 >Emitted(66, 36) Source(95, 74) + SourceIndex(0) +10>Emitted(66, 38) Source(95, 63) + SourceIndex(0) +11>Emitted(66, 54) Source(95, 74) + SourceIndex(0) +12>Emitted(66, 56) Source(95, 63) + SourceIndex(0) +13>Emitted(66, 61) Source(95, 74) + SourceIndex(0) +14>Emitted(66, 62) Source(95, 75) + SourceIndex(0) +--- +>>> _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skill, skillA = _33 === void 0 ? "noSkill" : _33; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(67, 5) Source(95, 6) + SourceIndex(0) +2 >Emitted(67, 19) Source(95, 59) + SourceIndex(0) +3 >Emitted(67, 21) Source(95, 7) + SourceIndex(0) +4 >Emitted(67, 35) Source(95, 29) + SourceIndex(0) +5 >Emitted(67, 37) Source(95, 7) + SourceIndex(0) +6 >Emitted(67, 76) Source(95, 29) + SourceIndex(0) +7 >Emitted(67, 78) Source(95, 31) + SourceIndex(0) +8 >Emitted(67, 93) Source(95, 56) + SourceIndex(0) +9 >Emitted(67, 95) Source(95, 31) + SourceIndex(0) +10>Emitted(67, 136) Source(95, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(68, 5) Source(96, 5) + SourceIndex(0) +2 >Emitted(68, 12) Source(96, 12) + SourceIndex(0) +3 >Emitted(68, 13) Source(96, 13) + SourceIndex(0) +4 >Emitted(68, 16) Source(96, 16) + SourceIndex(0) +5 >Emitted(68, 17) Source(96, 17) + SourceIndex(0) +6 >Emitted(68, 22) Source(96, 22) + SourceIndex(0) +7 >Emitted(68, 23) Source(96, 23) + SourceIndex(0) +8 >Emitted(68, 24) Source(96, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(69, 2) Source(97, 2) + SourceIndex(0) +--- +>>>for (var _34 = 0, _35 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _34 < _35.length; _34++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^^ +32> ^ +33> ^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(70, 1) Source(98, 1) + SourceIndex(0) +2 >Emitted(70, 4) Source(98, 4) + SourceIndex(0) +3 >Emitted(70, 5) Source(98, 5) + SourceIndex(0) +4 >Emitted(70, 6) Source(98, 63) + SourceIndex(0) +5 >Emitted(70, 17) Source(98, 139) + SourceIndex(0) +6 >Emitted(70, 19) Source(98, 63) + SourceIndex(0) +7 >Emitted(70, 26) Source(98, 64) + SourceIndex(0) +8 >Emitted(70, 28) Source(98, 66) + SourceIndex(0) +9 >Emitted(70, 32) Source(98, 70) + SourceIndex(0) +10>Emitted(70, 34) Source(98, 72) + SourceIndex(0) +11>Emitted(70, 41) Source(98, 79) + SourceIndex(0) +12>Emitted(70, 43) Source(98, 81) + SourceIndex(0) +13>Emitted(70, 48) Source(98, 86) + SourceIndex(0) +14>Emitted(70, 50) Source(98, 88) + SourceIndex(0) +15>Emitted(70, 58) Source(98, 96) + SourceIndex(0) +16>Emitted(70, 60) Source(98, 98) + SourceIndex(0) +17>Emitted(70, 62) Source(98, 100) + SourceIndex(0) +18>Emitted(70, 64) Source(98, 102) + SourceIndex(0) +19>Emitted(70, 68) Source(98, 106) + SourceIndex(0) +20>Emitted(70, 70) Source(98, 108) + SourceIndex(0) +21>Emitted(70, 79) Source(98, 117) + SourceIndex(0) +22>Emitted(70, 81) Source(98, 119) + SourceIndex(0) +23>Emitted(70, 86) Source(98, 124) + SourceIndex(0) +24>Emitted(70, 88) Source(98, 126) + SourceIndex(0) +25>Emitted(70, 98) Source(98, 136) + SourceIndex(0) +26>Emitted(70, 100) Source(98, 138) + SourceIndex(0) +27>Emitted(70, 101) Source(98, 139) + SourceIndex(0) +28>Emitted(70, 103) Source(98, 63) + SourceIndex(0) +29>Emitted(70, 119) Source(98, 139) + SourceIndex(0) +30>Emitted(70, 121) Source(98, 63) + SourceIndex(0) +31>Emitted(70, 126) Source(98, 139) + SourceIndex(0) +32>Emitted(70, 127) Source(98, 140) + SourceIndex(0) +--- +>>> _36 = _35[_34], _37 = _36.name, nameA = _37 === void 0 ? "noName" : _37, _38 = _36.skill, skillA = _38 === void 0 ? "noSkill" : _38; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > {name: nameA = "noName", skill: skillA = "noSkill" } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "noSkill" +9 > +10> skill: skillA = "noSkill" +1->Emitted(71, 5) Source(98, 6) + SourceIndex(0) +2 >Emitted(71, 19) Source(98, 59) + SourceIndex(0) +3 >Emitted(71, 21) Source(98, 7) + SourceIndex(0) +4 >Emitted(71, 35) Source(98, 29) + SourceIndex(0) +5 >Emitted(71, 37) Source(98, 7) + SourceIndex(0) +6 >Emitted(71, 76) Source(98, 29) + SourceIndex(0) +7 >Emitted(71, 78) Source(98, 31) + SourceIndex(0) +8 >Emitted(71, 93) Source(98, 56) + SourceIndex(0) +9 >Emitted(71, 95) Source(98, 31) + SourceIndex(0) +10>Emitted(71, 136) Source(98, 56) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(72, 5) Source(99, 5) + SourceIndex(0) +2 >Emitted(72, 12) Source(99, 12) + SourceIndex(0) +3 >Emitted(72, 13) Source(99, 13) + SourceIndex(0) +4 >Emitted(72, 16) Source(99, 16) + SourceIndex(0) +5 >Emitted(72, 17) Source(99, 17) + SourceIndex(0) +6 >Emitted(72, 22) Source(99, 22) + SourceIndex(0) +7 >Emitted(72, 23) Source(99, 23) + SourceIndex(0) +8 >Emitted(72, 24) Source(99, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(73, 2) Source(100, 2) + SourceIndex(0) +--- +>>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(74, 1) Source(101, 1) + SourceIndex(0) +2 >Emitted(74, 4) Source(101, 4) + SourceIndex(0) +3 >Emitted(74, 5) Source(101, 5) + SourceIndex(0) +4 >Emitted(74, 6) Source(107, 6) + SourceIndex(0) +5 >Emitted(74, 17) Source(107, 17) + SourceIndex(0) +6 >Emitted(74, 19) Source(107, 6) + SourceIndex(0) +7 >Emitted(74, 46) Source(107, 17) + SourceIndex(0) +8 >Emitted(74, 48) Source(107, 6) + SourceIndex(0) +9 >Emitted(74, 74) Source(107, 17) + SourceIndex(0) +10>Emitted(74, 76) Source(107, 6) + SourceIndex(0) +11>Emitted(74, 81) Source(107, 17) + SourceIndex(0) +12>Emitted(74, 82) Source(107, 18) + SourceIndex(0) +--- +>>> _40 = multiRobots_3[_39], _41 = _40.name, nameA = _41 === void 0 ? "noName" : _41, _42 = _40.skills, _43 = _42 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _42, _44 = _43.primary, primaryA = _44 === void 0 ? "primary" : _44, _45 = _43.secondary, secondaryA = _45 === void 0 ? "secondary" : _45; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(75, 5) Source(101, 6) + SourceIndex(0) +2 >Emitted(75, 29) Source(107, 2) + SourceIndex(0) +3 >Emitted(75, 31) Source(102, 5) + SourceIndex(0) +4 >Emitted(75, 45) Source(102, 27) + SourceIndex(0) +5 >Emitted(75, 47) Source(102, 5) + SourceIndex(0) +6 >Emitted(75, 86) Source(102, 27) + SourceIndex(0) +7 >Emitted(75, 88) Source(103, 5) + SourceIndex(0) +8 >Emitted(75, 104) Source(106, 53) + SourceIndex(0) +9 >Emitted(75, 106) Source(103, 5) + SourceIndex(0) +10>Emitted(75, 179) Source(106, 53) + SourceIndex(0) +11>Emitted(75, 181) Source(104, 9) + SourceIndex(0) +12>Emitted(75, 198) Source(104, 38) + SourceIndex(0) +13>Emitted(75, 200) Source(104, 9) + SourceIndex(0) +14>Emitted(75, 243) Source(104, 38) + SourceIndex(0) +15>Emitted(75, 245) Source(105, 9) + SourceIndex(0) +16>Emitted(75, 264) Source(105, 44) + SourceIndex(0) +17>Emitted(75, 266) Source(105, 9) + SourceIndex(0) +18>Emitted(75, 313) Source(105, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(76, 5) Source(108, 5) + SourceIndex(0) +2 >Emitted(76, 12) Source(108, 12) + SourceIndex(0) +3 >Emitted(76, 13) Source(108, 13) + SourceIndex(0) +4 >Emitted(76, 16) Source(108, 16) + SourceIndex(0) +5 >Emitted(76, 17) Source(108, 17) + SourceIndex(0) +6 >Emitted(76, 22) Source(108, 22) + SourceIndex(0) +7 >Emitted(76, 23) Source(108, 23) + SourceIndex(0) +8 >Emitted(76, 24) Source(108, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(77, 2) Source(109, 2) + SourceIndex(0) +--- +>>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(78, 1) Source(110, 1) + SourceIndex(0) +2 >Emitted(78, 4) Source(110, 4) + SourceIndex(0) +3 >Emitted(78, 5) Source(110, 5) + SourceIndex(0) +4 >Emitted(78, 6) Source(116, 6) + SourceIndex(0) +5 >Emitted(78, 17) Source(116, 22) + SourceIndex(0) +6 >Emitted(78, 19) Source(116, 6) + SourceIndex(0) +7 >Emitted(78, 25) Source(116, 6) + SourceIndex(0) +8 >Emitted(78, 39) Source(116, 20) + SourceIndex(0) +9 >Emitted(78, 41) Source(116, 22) + SourceIndex(0) +10>Emitted(78, 43) Source(116, 6) + SourceIndex(0) +11>Emitted(78, 59) Source(116, 22) + SourceIndex(0) +12>Emitted(78, 61) Source(116, 6) + SourceIndex(0) +13>Emitted(78, 66) Source(116, 22) + SourceIndex(0) +14>Emitted(78, 67) Source(116, 23) + SourceIndex(0) +--- +>>> _48 = _47[_46], _49 = _48.name, nameA = _49 === void 0 ? "noName" : _49, _50 = _48.skills, _51 = _50 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _50, _52 = _51.primary, primaryA = _52 === void 0 ? "primary" : _52, _53 = _51.secondary, secondaryA = _53 === void 0 ? "secondary" : _53; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(79, 5) Source(110, 6) + SourceIndex(0) +2 >Emitted(79, 19) Source(116, 2) + SourceIndex(0) +3 >Emitted(79, 21) Source(111, 5) + SourceIndex(0) +4 >Emitted(79, 35) Source(111, 27) + SourceIndex(0) +5 >Emitted(79, 37) Source(111, 5) + SourceIndex(0) +6 >Emitted(79, 76) Source(111, 27) + SourceIndex(0) +7 >Emitted(79, 78) Source(112, 5) + SourceIndex(0) +8 >Emitted(79, 94) Source(115, 53) + SourceIndex(0) +9 >Emitted(79, 96) Source(112, 5) + SourceIndex(0) +10>Emitted(79, 169) Source(115, 53) + SourceIndex(0) +11>Emitted(79, 171) Source(113, 9) + SourceIndex(0) +12>Emitted(79, 188) Source(113, 38) + SourceIndex(0) +13>Emitted(79, 190) Source(113, 9) + SourceIndex(0) +14>Emitted(79, 233) Source(113, 38) + SourceIndex(0) +15>Emitted(79, 235) Source(114, 9) + SourceIndex(0) +16>Emitted(79, 254) Source(114, 44) + SourceIndex(0) +17>Emitted(79, 256) Source(114, 9) + SourceIndex(0) +18>Emitted(79, 303) Source(114, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(80, 5) Source(117, 5) + SourceIndex(0) +2 >Emitted(80, 12) Source(117, 12) + SourceIndex(0) +3 >Emitted(80, 13) Source(117, 13) + SourceIndex(0) +4 >Emitted(80, 16) Source(117, 16) + SourceIndex(0) +5 >Emitted(80, 17) Source(117, 17) + SourceIndex(0) +6 >Emitted(80, 22) Source(117, 22) + SourceIndex(0) +7 >Emitted(80, 23) Source(117, 23) + SourceIndex(0) +8 >Emitted(80, 24) Source(117, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(81, 2) Source(118, 2) + SourceIndex(0) +--- +>>>for (var _54 = 0, _55 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^ +9 > ^^ +10> ^^^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^ +15> ^^ +16> ^^ +17> ^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^^ +24> ^^ +25> ^^ +26> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > +8 > [ +9 > { +10> name +11> : +12> "mower" +13> , +14> skills +15> : +16> { +17> primary +18> : +19> "mowing" +20> , +21> secondary +22> : +23> "none" +24> } +25> } +1->Emitted(82, 1) Source(119, 1) + SourceIndex(0) +2 >Emitted(82, 4) Source(119, 4) + SourceIndex(0) +3 >Emitted(82, 5) Source(119, 5) + SourceIndex(0) +4 >Emitted(82, 6) Source(125, 6) + SourceIndex(0) +5 >Emitted(82, 17) Source(126, 79) + SourceIndex(0) +6 >Emitted(82, 19) Source(125, 6) + SourceIndex(0) +7 >Emitted(82, 25) Source(125, 20) + SourceIndex(0) +8 >Emitted(82, 26) Source(125, 21) + SourceIndex(0) +9 >Emitted(82, 28) Source(125, 23) + SourceIndex(0) +10>Emitted(82, 32) Source(125, 27) + SourceIndex(0) +11>Emitted(82, 34) Source(125, 29) + SourceIndex(0) +12>Emitted(82, 41) Source(125, 36) + SourceIndex(0) +13>Emitted(82, 43) Source(125, 38) + SourceIndex(0) +14>Emitted(82, 49) Source(125, 44) + SourceIndex(0) +15>Emitted(82, 51) Source(125, 46) + SourceIndex(0) +16>Emitted(82, 53) Source(125, 48) + SourceIndex(0) +17>Emitted(82, 60) Source(125, 55) + SourceIndex(0) +18>Emitted(82, 62) Source(125, 57) + SourceIndex(0) +19>Emitted(82, 70) Source(125, 65) + SourceIndex(0) +20>Emitted(82, 72) Source(125, 67) + SourceIndex(0) +21>Emitted(82, 81) Source(125, 76) + SourceIndex(0) +22>Emitted(82, 83) Source(125, 78) + SourceIndex(0) +23>Emitted(82, 89) Source(125, 84) + SourceIndex(0) +24>Emitted(82, 91) Source(125, 86) + SourceIndex(0) +25>Emitted(82, 93) Source(125, 88) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _54 < _55.length; _54++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(83, 5) Source(126, 5) + SourceIndex(0) +2 >Emitted(83, 7) Source(126, 7) + SourceIndex(0) +3 >Emitted(83, 11) Source(126, 11) + SourceIndex(0) +4 >Emitted(83, 13) Source(126, 13) + SourceIndex(0) +5 >Emitted(83, 22) Source(126, 22) + SourceIndex(0) +6 >Emitted(83, 24) Source(126, 24) + SourceIndex(0) +7 >Emitted(83, 30) Source(126, 30) + SourceIndex(0) +8 >Emitted(83, 32) Source(126, 32) + SourceIndex(0) +9 >Emitted(83, 34) Source(126, 34) + SourceIndex(0) +10>Emitted(83, 41) Source(126, 41) + SourceIndex(0) +11>Emitted(83, 43) Source(126, 43) + SourceIndex(0) +12>Emitted(83, 53) Source(126, 53) + SourceIndex(0) +13>Emitted(83, 55) Source(126, 55) + SourceIndex(0) +14>Emitted(83, 64) Source(126, 64) + SourceIndex(0) +15>Emitted(83, 66) Source(126, 66) + SourceIndex(0) +16>Emitted(83, 74) Source(126, 74) + SourceIndex(0) +17>Emitted(83, 76) Source(126, 76) + SourceIndex(0) +18>Emitted(83, 78) Source(126, 78) + SourceIndex(0) +19>Emitted(83, 79) Source(126, 79) + SourceIndex(0) +20>Emitted(83, 81) Source(125, 6) + SourceIndex(0) +21>Emitted(83, 97) Source(126, 79) + SourceIndex(0) +22>Emitted(83, 99) Source(125, 6) + SourceIndex(0) +23>Emitted(83, 104) Source(126, 79) + SourceIndex(0) +24>Emitted(83, 105) Source(126, 80) + SourceIndex(0) +--- +>>> _56 = _55[_54], _57 = _56.name, nameA = _57 === void 0 ? "noName" : _57, _58 = _56.skills, _59 = _58 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _58, _60 = _59.primary, primaryA = _60 === void 0 ? "primary" : _60, _61 = _59.secondary, secondaryA = _61 === void 0 ? "secondary" : _61; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , + > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , + > +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +1->Emitted(84, 5) Source(119, 6) + SourceIndex(0) +2 >Emitted(84, 19) Source(125, 2) + SourceIndex(0) +3 >Emitted(84, 21) Source(120, 5) + SourceIndex(0) +4 >Emitted(84, 35) Source(120, 27) + SourceIndex(0) +5 >Emitted(84, 37) Source(120, 5) + SourceIndex(0) +6 >Emitted(84, 76) Source(120, 27) + SourceIndex(0) +7 >Emitted(84, 78) Source(121, 5) + SourceIndex(0) +8 >Emitted(84, 94) Source(124, 53) + SourceIndex(0) +9 >Emitted(84, 96) Source(121, 5) + SourceIndex(0) +10>Emitted(84, 169) Source(124, 53) + SourceIndex(0) +11>Emitted(84, 171) Source(122, 9) + SourceIndex(0) +12>Emitted(84, 188) Source(122, 38) + SourceIndex(0) +13>Emitted(84, 190) Source(122, 9) + SourceIndex(0) +14>Emitted(84, 233) Source(122, 38) + SourceIndex(0) +15>Emitted(84, 235) Source(123, 9) + SourceIndex(0) +16>Emitted(84, 254) Source(123, 44) + SourceIndex(0) +17>Emitted(84, 256) Source(123, 9) + SourceIndex(0) +18>Emitted(84, 303) Source(123, 44) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(85, 5) Source(127, 5) + SourceIndex(0) +2 >Emitted(85, 12) Source(127, 12) + SourceIndex(0) +3 >Emitted(85, 13) Source(127, 13) + SourceIndex(0) +4 >Emitted(85, 16) Source(127, 16) + SourceIndex(0) +5 >Emitted(85, 17) Source(127, 17) + SourceIndex(0) +6 >Emitted(85, 22) Source(127, 22) + SourceIndex(0) +7 >Emitted(85, 23) Source(127, 23) + SourceIndex(0) +8 >Emitted(85, 24) Source(127, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(86, 2) Source(128, 2) + SourceIndex(0) +--- +>>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >for +3 > +4 > ({ name = "noName", skill = "noSkill" } of +5 > robots +6 > +7 > robots +8 > +9 > robots +10> +11> robots +12> ) +1->Emitted(87, 1) Source(130, 1) + SourceIndex(0) +2 >Emitted(87, 4) Source(130, 4) + SourceIndex(0) +3 >Emitted(87, 5) Source(130, 5) + SourceIndex(0) +4 >Emitted(87, 6) Source(130, 49) + SourceIndex(0) +5 >Emitted(87, 17) Source(130, 55) + SourceIndex(0) +6 >Emitted(87, 19) Source(130, 49) + SourceIndex(0) +7 >Emitted(87, 36) Source(130, 55) + SourceIndex(0) +8 >Emitted(87, 38) Source(130, 49) + SourceIndex(0) +9 >Emitted(87, 59) Source(130, 55) + SourceIndex(0) +10>Emitted(87, 61) Source(130, 49) + SourceIndex(0) +11>Emitted(87, 66) Source(130, 55) + SourceIndex(0) +12>Emitted(87, 67) Source(130, 56) + SourceIndex(0) +--- +>>> _63 = robots_4[_62], _64 = _63.name, name = _64 === void 0 ? "noName" : _64, _65 = _63.skill, skill = _65 === void 0 ? "noSkill" : _65; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name = "noName", skill = "noSkill" } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , +8 > skill = "noSkill" +9 > +10> skill = "noSkill" +1->Emitted(88, 5) Source(130, 6) + SourceIndex(0) +2 >Emitted(88, 24) Source(130, 45) + SourceIndex(0) +3 >Emitted(88, 26) Source(130, 8) + SourceIndex(0) +4 >Emitted(88, 40) Source(130, 23) + SourceIndex(0) +5 >Emitted(88, 42) Source(130, 8) + SourceIndex(0) +6 >Emitted(88, 80) Source(130, 23) + SourceIndex(0) +7 >Emitted(88, 82) Source(130, 25) + SourceIndex(0) +8 >Emitted(88, 97) Source(130, 43) + SourceIndex(0) +9 >Emitted(88, 99) Source(130, 25) + SourceIndex(0) +10>Emitted(88, 139) Source(130, 43) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of robots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(89, 5) Source(131, 5) + SourceIndex(0) +2 >Emitted(89, 12) Source(131, 12) + SourceIndex(0) +3 >Emitted(89, 13) Source(131, 13) + SourceIndex(0) +4 >Emitted(89, 16) Source(131, 16) + SourceIndex(0) +5 >Emitted(89, 17) Source(131, 17) + SourceIndex(0) +6 >Emitted(89, 22) Source(131, 22) + SourceIndex(0) +7 >Emitted(89, 23) Source(131, 23) + SourceIndex(0) +8 >Emitted(89, 24) Source(131, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(90, 2) Source(132, 2) + SourceIndex(0) +--- +>>>for (var _66 = 0, _67 = getRobots(); _66 < _67.length; _66++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ name = "noName", skill = "noSkill" } of +5 > getRobots() +6 > +7 > +8 > getRobots +9 > () +10> +11> getRobots() +12> +13> getRobots() +14> ) +1->Emitted(91, 1) Source(133, 1) + SourceIndex(0) +2 >Emitted(91, 4) Source(133, 4) + SourceIndex(0) +3 >Emitted(91, 5) Source(133, 5) + SourceIndex(0) +4 >Emitted(91, 6) Source(133, 49) + SourceIndex(0) +5 >Emitted(91, 17) Source(133, 60) + SourceIndex(0) +6 >Emitted(91, 19) Source(133, 49) + SourceIndex(0) +7 >Emitted(91, 25) Source(133, 49) + SourceIndex(0) +8 >Emitted(91, 34) Source(133, 58) + SourceIndex(0) +9 >Emitted(91, 36) Source(133, 60) + SourceIndex(0) +10>Emitted(91, 38) Source(133, 49) + SourceIndex(0) +11>Emitted(91, 54) Source(133, 60) + SourceIndex(0) +12>Emitted(91, 56) Source(133, 49) + SourceIndex(0) +13>Emitted(91, 61) Source(133, 60) + SourceIndex(0) +14>Emitted(91, 62) Source(133, 61) + SourceIndex(0) +--- +>>> _68 = _67[_66], _69 = _68.name, name = _69 === void 0 ? "noName" : _69, _70 = _68.skill, skill = _70 === void 0 ? "noSkill" : _70; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name = "noName", skill = "noSkill" } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , +8 > skill = "noSkill" +9 > +10> skill = "noSkill" +1->Emitted(92, 5) Source(133, 6) + SourceIndex(0) +2 >Emitted(92, 19) Source(133, 45) + SourceIndex(0) +3 >Emitted(92, 21) Source(133, 8) + SourceIndex(0) +4 >Emitted(92, 35) Source(133, 23) + SourceIndex(0) +5 >Emitted(92, 37) Source(133, 8) + SourceIndex(0) +6 >Emitted(92, 75) Source(133, 23) + SourceIndex(0) +7 >Emitted(92, 77) Source(133, 25) + SourceIndex(0) +8 >Emitted(92, 92) Source(133, 42) + SourceIndex(0) +9 >Emitted(92, 94) Source(133, 25) + SourceIndex(0) +10>Emitted(92, 134) Source(133, 42) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of getRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(93, 5) Source(134, 5) + SourceIndex(0) +2 >Emitted(93, 12) Source(134, 12) + SourceIndex(0) +3 >Emitted(93, 13) Source(134, 13) + SourceIndex(0) +4 >Emitted(93, 16) Source(134, 16) + SourceIndex(0) +5 >Emitted(93, 17) Source(134, 17) + SourceIndex(0) +6 >Emitted(93, 22) Source(134, 22) + SourceIndex(0) +7 >Emitted(93, 23) Source(134, 23) + SourceIndex(0) +8 >Emitted(93, 24) Source(134, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(94, 2) Source(135, 2) + SourceIndex(0) +--- +>>>for (var _71 = 0, _72 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _71 < _72.length; _71++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^ +18> ^^ +19> ^^^^ +20> ^^ +21> ^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^^ +25> ^^^^^^^^^^ +26> ^^ +27> ^ +28> ^^ +29> ^^^^^^^^^^^^^^^^ +30> ^^ +31> ^^^^^ +32> ^ +33> ^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ name = "noName", skill = "noSkill" } of +5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skill +14> : +15> "mowing" +16> } +17> , +18> { +19> name +20> : +21> "trimmer" +22> , +23> skill +24> : +25> "trimming" +26> } +27> ] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +30> +31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +32> ) +1->Emitted(95, 1) Source(136, 1) + SourceIndex(0) +2 >Emitted(95, 4) Source(136, 4) + SourceIndex(0) +3 >Emitted(95, 5) Source(136, 5) + SourceIndex(0) +4 >Emitted(95, 6) Source(136, 49) + SourceIndex(0) +5 >Emitted(95, 17) Source(136, 125) + SourceIndex(0) +6 >Emitted(95, 19) Source(136, 49) + SourceIndex(0) +7 >Emitted(95, 26) Source(136, 50) + SourceIndex(0) +8 >Emitted(95, 28) Source(136, 52) + SourceIndex(0) +9 >Emitted(95, 32) Source(136, 56) + SourceIndex(0) +10>Emitted(95, 34) Source(136, 58) + SourceIndex(0) +11>Emitted(95, 41) Source(136, 65) + SourceIndex(0) +12>Emitted(95, 43) Source(136, 67) + SourceIndex(0) +13>Emitted(95, 48) Source(136, 72) + SourceIndex(0) +14>Emitted(95, 50) Source(136, 74) + SourceIndex(0) +15>Emitted(95, 58) Source(136, 82) + SourceIndex(0) +16>Emitted(95, 60) Source(136, 84) + SourceIndex(0) +17>Emitted(95, 62) Source(136, 86) + SourceIndex(0) +18>Emitted(95, 64) Source(136, 88) + SourceIndex(0) +19>Emitted(95, 68) Source(136, 92) + SourceIndex(0) +20>Emitted(95, 70) Source(136, 94) + SourceIndex(0) +21>Emitted(95, 79) Source(136, 103) + SourceIndex(0) +22>Emitted(95, 81) Source(136, 105) + SourceIndex(0) +23>Emitted(95, 86) Source(136, 110) + SourceIndex(0) +24>Emitted(95, 88) Source(136, 112) + SourceIndex(0) +25>Emitted(95, 98) Source(136, 122) + SourceIndex(0) +26>Emitted(95, 100) Source(136, 124) + SourceIndex(0) +27>Emitted(95, 101) Source(136, 125) + SourceIndex(0) +28>Emitted(95, 103) Source(136, 49) + SourceIndex(0) +29>Emitted(95, 119) Source(136, 125) + SourceIndex(0) +30>Emitted(95, 121) Source(136, 49) + SourceIndex(0) +31>Emitted(95, 126) Source(136, 125) + SourceIndex(0) +32>Emitted(95, 127) Source(136, 126) + SourceIndex(0) +--- +>>> _73 = _72[_71], _74 = _73.name, name = _74 === void 0 ? "noName" : _74, _75 = _73.skill, skill = _75 === void 0 ? "noSkill" : _75; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name = "noName", skill = "noSkill" } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , +8 > skill = "noSkill" +9 > +10> skill = "noSkill" +1->Emitted(96, 5) Source(136, 6) + SourceIndex(0) +2 >Emitted(96, 19) Source(136, 45) + SourceIndex(0) +3 >Emitted(96, 21) Source(136, 8) + SourceIndex(0) +4 >Emitted(96, 35) Source(136, 23) + SourceIndex(0) +5 >Emitted(96, 37) Source(136, 8) + SourceIndex(0) +6 >Emitted(96, 75) Source(136, 23) + SourceIndex(0) +7 >Emitted(96, 77) Source(136, 25) + SourceIndex(0) +8 >Emitted(96, 92) Source(136, 43) + SourceIndex(0) +9 >Emitted(96, 94) Source(136, 25) + SourceIndex(0) +10>Emitted(96, 134) Source(136, 43) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(97, 5) Source(137, 5) + SourceIndex(0) +2 >Emitted(97, 12) Source(137, 12) + SourceIndex(0) +3 >Emitted(97, 13) Source(137, 13) + SourceIndex(0) +4 >Emitted(97, 16) Source(137, 16) + SourceIndex(0) +5 >Emitted(97, 17) Source(137, 17) + SourceIndex(0) +6 >Emitted(97, 22) Source(137, 22) + SourceIndex(0) +7 >Emitted(97, 23) Source(137, 23) + SourceIndex(0) +8 >Emitted(97, 24) Source(137, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(98, 2) Source(138, 2) + SourceIndex(0) +--- +>>>for (var _76 = 0, multiRobots_4 = multiRobots; _76 < multiRobots_4.length; _76++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots +10> +11> multiRobots +12> ) +1->Emitted(99, 1) Source(139, 1) + SourceIndex(0) +2 >Emitted(99, 4) Source(139, 4) + SourceIndex(0) +3 >Emitted(99, 5) Source(139, 5) + SourceIndex(0) +4 >Emitted(99, 6) Source(145, 6) + SourceIndex(0) +5 >Emitted(99, 17) Source(145, 17) + SourceIndex(0) +6 >Emitted(99, 19) Source(145, 6) + SourceIndex(0) +7 >Emitted(99, 46) Source(145, 17) + SourceIndex(0) +8 >Emitted(99, 48) Source(145, 6) + SourceIndex(0) +9 >Emitted(99, 74) Source(145, 17) + SourceIndex(0) +10>Emitted(99, 76) Source(145, 6) + SourceIndex(0) +11>Emitted(99, 81) Source(145, 17) + SourceIndex(0) +12>Emitted(99, 82) Source(145, 18) + SourceIndex(0) +--- +>>> _77 = multiRobots_4[_76], _78 = _77.name, name = _78 === void 0 ? "noName" : _78, _79 = _77.skills, _80 = _79 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _79, _81 = _80.primary, primary = _81 === void 0 ? "primary" : _81, _82 = _80.secondary, secondary = _82 === void 0 ? "secondary" : _82; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , + > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +1->Emitted(100, 5) Source(139, 6) + SourceIndex(0) +2 >Emitted(100, 29) Source(145, 2) + SourceIndex(0) +3 >Emitted(100, 31) Source(140, 5) + SourceIndex(0) +4 >Emitted(100, 45) Source(140, 20) + SourceIndex(0) +5 >Emitted(100, 47) Source(140, 5) + SourceIndex(0) +6 >Emitted(100, 85) Source(140, 20) + SourceIndex(0) +7 >Emitted(100, 87) Source(141, 5) + SourceIndex(0) +8 >Emitted(100, 103) Source(144, 53) + SourceIndex(0) +9 >Emitted(100, 105) Source(141, 5) + SourceIndex(0) +10>Emitted(100, 178) Source(144, 53) + SourceIndex(0) +11>Emitted(100, 180) Source(142, 9) + SourceIndex(0) +12>Emitted(100, 197) Source(142, 28) + SourceIndex(0) +13>Emitted(100, 199) Source(142, 9) + SourceIndex(0) +14>Emitted(100, 241) Source(142, 28) + SourceIndex(0) +15>Emitted(100, 243) Source(143, 9) + SourceIndex(0) +16>Emitted(100, 262) Source(143, 32) + SourceIndex(0) +17>Emitted(100, 264) Source(143, 9) + SourceIndex(0) +18>Emitted(100, 310) Source(143, 32) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of multiRobots) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(101, 5) Source(146, 5) + SourceIndex(0) +2 >Emitted(101, 12) Source(146, 12) + SourceIndex(0) +3 >Emitted(101, 13) Source(146, 13) + SourceIndex(0) +4 >Emitted(101, 16) Source(146, 16) + SourceIndex(0) +5 >Emitted(101, 17) Source(146, 17) + SourceIndex(0) +6 >Emitted(101, 22) Source(146, 22) + SourceIndex(0) +7 >Emitted(101, 23) Source(146, 23) + SourceIndex(0) +8 >Emitted(101, 24) Source(146, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(102, 2) Source(147, 2) + SourceIndex(0) +--- +>>>for (var _83 = 0, _84 = getMultiRobots(); _83 < _84.length; _83++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > getMultiRobots() +6 > +7 > +8 > getMultiRobots +9 > () +10> +11> getMultiRobots() +12> +13> getMultiRobots() +14> ) +1->Emitted(103, 1) Source(148, 1) + SourceIndex(0) +2 >Emitted(103, 4) Source(148, 4) + SourceIndex(0) +3 >Emitted(103, 5) Source(148, 5) + SourceIndex(0) +4 >Emitted(103, 6) Source(154, 6) + SourceIndex(0) +5 >Emitted(103, 17) Source(154, 22) + SourceIndex(0) +6 >Emitted(103, 19) Source(154, 6) + SourceIndex(0) +7 >Emitted(103, 25) Source(154, 6) + SourceIndex(0) +8 >Emitted(103, 39) Source(154, 20) + SourceIndex(0) +9 >Emitted(103, 41) Source(154, 22) + SourceIndex(0) +10>Emitted(103, 43) Source(154, 6) + SourceIndex(0) +11>Emitted(103, 59) Source(154, 22) + SourceIndex(0) +12>Emitted(103, 61) Source(154, 6) + SourceIndex(0) +13>Emitted(103, 66) Source(154, 22) + SourceIndex(0) +14>Emitted(103, 67) Source(154, 23) + SourceIndex(0) +--- +>>> _85 = _84[_83], _86 = _85.name, name = _86 === void 0 ? "noName" : _86, _87 = _85.skills, _88 = _87 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _87, _89 = _88.primary, primary = _89 === void 0 ? "primary" : _89, _90 = _88.secondary, secondary = _90 === void 0 ? "secondary" : _90; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , + > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +1->Emitted(104, 5) Source(148, 6) + SourceIndex(0) +2 >Emitted(104, 19) Source(154, 2) + SourceIndex(0) +3 >Emitted(104, 21) Source(149, 5) + SourceIndex(0) +4 >Emitted(104, 35) Source(149, 20) + SourceIndex(0) +5 >Emitted(104, 37) Source(149, 5) + SourceIndex(0) +6 >Emitted(104, 75) Source(149, 20) + SourceIndex(0) +7 >Emitted(104, 77) Source(150, 5) + SourceIndex(0) +8 >Emitted(104, 93) Source(153, 53) + SourceIndex(0) +9 >Emitted(104, 95) Source(150, 5) + SourceIndex(0) +10>Emitted(104, 168) Source(153, 53) + SourceIndex(0) +11>Emitted(104, 170) Source(151, 9) + SourceIndex(0) +12>Emitted(104, 187) Source(151, 28) + SourceIndex(0) +13>Emitted(104, 189) Source(151, 9) + SourceIndex(0) +14>Emitted(104, 231) Source(151, 28) + SourceIndex(0) +15>Emitted(104, 233) Source(152, 9) + SourceIndex(0) +16>Emitted(104, 252) Source(152, 32) + SourceIndex(0) +17>Emitted(104, 254) Source(152, 9) + SourceIndex(0) +18>Emitted(104, 300) Source(152, 32) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of getMultiRobots()) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(105, 5) Source(155, 5) + SourceIndex(0) +2 >Emitted(105, 12) Source(155, 12) + SourceIndex(0) +3 >Emitted(105, 13) Source(155, 13) + SourceIndex(0) +4 >Emitted(105, 16) Source(155, 16) + SourceIndex(0) +5 >Emitted(105, 17) Source(155, 17) + SourceIndex(0) +6 >Emitted(105, 22) Source(155, 22) + SourceIndex(0) +7 >Emitted(105, 23) Source(155, 23) + SourceIndex(0) +8 >Emitted(105, 24) Source(155, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(106, 2) Source(156, 2) + SourceIndex(0) +--- +>>>for (var _91 = 0, _92 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^ +11> ^^^^^^^ +12> ^^ +13> ^^^^^^ +14> ^^ +15> ^^ +16> ^^^^^^^ +17> ^^ +18> ^^^^^^^^ +19> ^^ +20> ^^^^^^^^^ +21> ^^ +22> ^^^^^^ +23> ^^ +24> ^^ +25> ^^^^^^^^^^^^^^^-> +1-> + > +2 >for +3 > +4 > ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } of +5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +6 > +7 > [ +8 > { +9 > name +10> : +11> "mower" +12> , +13> skills +14> : +15> { +16> primary +17> : +18> "mowing" +19> , +20> secondary +21> : +22> "none" +23> } +24> } +1->Emitted(107, 1) Source(157, 1) + SourceIndex(0) +2 >Emitted(107, 4) Source(157, 4) + SourceIndex(0) +3 >Emitted(107, 5) Source(157, 5) + SourceIndex(0) +4 >Emitted(107, 6) Source(163, 6) + SourceIndex(0) +5 >Emitted(107, 17) Source(164, 79) + SourceIndex(0) +6 >Emitted(107, 19) Source(163, 6) + SourceIndex(0) +7 >Emitted(107, 26) Source(163, 7) + SourceIndex(0) +8 >Emitted(107, 28) Source(163, 9) + SourceIndex(0) +9 >Emitted(107, 32) Source(163, 13) + SourceIndex(0) +10>Emitted(107, 34) Source(163, 15) + SourceIndex(0) +11>Emitted(107, 41) Source(163, 22) + SourceIndex(0) +12>Emitted(107, 43) Source(163, 24) + SourceIndex(0) +13>Emitted(107, 49) Source(163, 30) + SourceIndex(0) +14>Emitted(107, 51) Source(163, 32) + SourceIndex(0) +15>Emitted(107, 53) Source(163, 34) + SourceIndex(0) +16>Emitted(107, 60) Source(163, 41) + SourceIndex(0) +17>Emitted(107, 62) Source(163, 43) + SourceIndex(0) +18>Emitted(107, 70) Source(163, 51) + SourceIndex(0) +19>Emitted(107, 72) Source(163, 53) + SourceIndex(0) +20>Emitted(107, 81) Source(163, 62) + SourceIndex(0) +21>Emitted(107, 83) Source(163, 64) + SourceIndex(0) +22>Emitted(107, 89) Source(163, 70) + SourceIndex(0) +23>Emitted(107, 91) Source(163, 72) + SourceIndex(0) +24>Emitted(107, 93) Source(163, 74) + SourceIndex(0) +--- +>>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _91 < _92.length; _91++) { +1->^^^^ +2 > ^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^^^^^^^^^^^^^^^ +22> ^^ +23> ^^^^^ +24> ^ +25> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->, + > +2 > { +3 > name +4 > : +5 > "trimmer" +6 > , +7 > skills +8 > : +9 > { +10> primary +11> : +12> "trimming" +13> , +14> secondary +15> : +16> "edging" +17> } +18> } +19> ] +20> +21> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +22> +23> [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] +24> ) +1->Emitted(108, 5) Source(164, 5) + SourceIndex(0) +2 >Emitted(108, 7) Source(164, 7) + SourceIndex(0) +3 >Emitted(108, 11) Source(164, 11) + SourceIndex(0) +4 >Emitted(108, 13) Source(164, 13) + SourceIndex(0) +5 >Emitted(108, 22) Source(164, 22) + SourceIndex(0) +6 >Emitted(108, 24) Source(164, 24) + SourceIndex(0) +7 >Emitted(108, 30) Source(164, 30) + SourceIndex(0) +8 >Emitted(108, 32) Source(164, 32) + SourceIndex(0) +9 >Emitted(108, 34) Source(164, 34) + SourceIndex(0) +10>Emitted(108, 41) Source(164, 41) + SourceIndex(0) +11>Emitted(108, 43) Source(164, 43) + SourceIndex(0) +12>Emitted(108, 53) Source(164, 53) + SourceIndex(0) +13>Emitted(108, 55) Source(164, 55) + SourceIndex(0) +14>Emitted(108, 64) Source(164, 64) + SourceIndex(0) +15>Emitted(108, 66) Source(164, 66) + SourceIndex(0) +16>Emitted(108, 74) Source(164, 74) + SourceIndex(0) +17>Emitted(108, 76) Source(164, 76) + SourceIndex(0) +18>Emitted(108, 78) Source(164, 78) + SourceIndex(0) +19>Emitted(108, 79) Source(164, 79) + SourceIndex(0) +20>Emitted(108, 81) Source(163, 6) + SourceIndex(0) +21>Emitted(108, 97) Source(164, 79) + SourceIndex(0) +22>Emitted(108, 99) Source(163, 6) + SourceIndex(0) +23>Emitted(108, 104) Source(164, 79) + SourceIndex(0) +24>Emitted(108, 105) Source(164, 80) + SourceIndex(0) +--- +>>> _93 = _92[_91], _94 = _93.name, name = _94 === void 0 ? "noName" : _94, _95 = _93.skills, _96 = _95 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _95, _97 = _96.primary, primary = _97 === void 0 ? "primary" : _97, _98 = _96.secondary, secondary = _98 === void 0 ? "secondary" : _98; +1->^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + > } +3 > +4 > name = "noName" +5 > +6 > name = "noName" +7 > , + > +8 > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } +11> +12> primary = "primary" +13> +14> primary = "primary" +15> , + > +16> secondary = "secondary" +17> +18> secondary = "secondary" +1->Emitted(109, 5) Source(157, 6) + SourceIndex(0) +2 >Emitted(109, 19) Source(163, 2) + SourceIndex(0) +3 >Emitted(109, 21) Source(158, 5) + SourceIndex(0) +4 >Emitted(109, 35) Source(158, 20) + SourceIndex(0) +5 >Emitted(109, 37) Source(158, 5) + SourceIndex(0) +6 >Emitted(109, 75) Source(158, 20) + SourceIndex(0) +7 >Emitted(109, 77) Source(159, 5) + SourceIndex(0) +8 >Emitted(109, 93) Source(162, 53) + SourceIndex(0) +9 >Emitted(109, 95) Source(159, 5) + SourceIndex(0) +10>Emitted(109, 168) Source(162, 53) + SourceIndex(0) +11>Emitted(109, 170) Source(160, 9) + SourceIndex(0) +12>Emitted(109, 187) Source(160, 28) + SourceIndex(0) +13>Emitted(109, 189) Source(160, 9) + SourceIndex(0) +14>Emitted(109, 231) Source(160, 28) + SourceIndex(0) +15>Emitted(109, 233) Source(161, 9) + SourceIndex(0) +16>Emitted(109, 252) Source(161, 32) + SourceIndex(0) +17>Emitted(109, 254) Source(161, 9) + SourceIndex(0) +18>Emitted(109, 300) Source(161, 32) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "noSkill", secondary: "noSkill" } + >} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(110, 5) Source(165, 5) + SourceIndex(0) +2 >Emitted(110, 12) Source(165, 12) + SourceIndex(0) +3 >Emitted(110, 13) Source(165, 13) + SourceIndex(0) +4 >Emitted(110, 16) Source(165, 16) + SourceIndex(0) +5 >Emitted(110, 17) Source(165, 17) + SourceIndex(0) +6 >Emitted(110, 22) Source(165, 22) + SourceIndex(0) +7 >Emitted(110, 23) Source(165, 23) + SourceIndex(0) +8 >Emitted(110, 24) Source(165, 24) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(111, 2) Source(166, 2) + SourceIndex(0) +--- +>>>var _a, _d, _g, _j, _k, _l, _m, _q, _r, _s, _t, _w, _x, _y, _z, _1, _4, _7, _9, _10, _11, _12, _15, _16, _17, _18, _21, _22, _23, _24, _26, _27, _28, _31, _32, _33, _36, _37, _38, _40, _41, _42, _43, _44, _45, _48, _49, _50, _51, _52, _53, _56, _57, _58, _59, _60, _61, _63, _64, _65, _68, _69, _70, _73, _74, _75, _77, _78, _79, _80, _81, _82, _85, _86, _87, _88, _89, _90, _93, _94, _95, _96, _97, _98; +>>>//# sourceMappingURL=sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..7194270c784 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.symbols @@ -0,0 +1,564 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 3, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 4, 17)) +} + +interface MultiRobot { +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 8, 22)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 9, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 10, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 11, 24)) + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 24)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 39)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 60)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 77)) + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 34)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 49)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 59)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 78)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 53)) + +function getRobots() { +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + return robots; +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) +} + +function getMultiRobots() { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + return multiRobots; +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) +>i : Symbol(i, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) + +let name: string, primary: string, secondary: string, skill: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 3)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 17)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 34)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 29, 53)) + +for ({name: nameA = "noName" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 31, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 34, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 36)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 51)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 72)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 37, 89)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 40, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 40, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 40, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 41, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 41, 25)) +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 44, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 44, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 44, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 45, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 45, 25)) +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 48, 6)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 48, 16)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 48, 47)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + { primary: "nosKill", secondary: "noSkill" } } of +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 49, 5)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 49, 25)) + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 20)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 35)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 45)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 50, 64)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 9)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 26)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 36)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 51, 57)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} + +for ({ name = "noName" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 55, 6)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 58, 6)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 6)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 30)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 45)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 66)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 61, 83)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 64, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 65, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 66, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 68, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 68, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 72, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 73, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 74, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 76, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 76, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} +for ({ + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 80, 6)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 81, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 82, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 84, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 84, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 7)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 85, 51)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 86, 53)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 91, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 91, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 94, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 94, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 29)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 67)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 64)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 79)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 100)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 97, 117)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 100, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 101, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 102, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 103, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 105, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 105, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 109, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 110, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 111, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 112, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 114, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 114, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name: nameA = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 118, 6)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 119, 27)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 120, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 18)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 121, 38)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 36)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 123, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 123, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>MultiRobot : Symbol(MultiRobot, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 6, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 124, 65)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 125, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} + +for ({ name = "noName", skill = "noSkill" } of robots) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 129, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 129, 23)) +>robots : Symbol(robots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 16, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 132, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 132, 23)) +>getRobots : Symbol(getRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 18, 79)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 23)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 50)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 65)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 86)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 135, 103)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 138, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 139, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 140, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 141, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 143, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 143, 29)) + +} of multiRobots) { +>multiRobots : Symbol(multiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 17, 3)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 147, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 148, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 149, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 150, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 152, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 152, 29)) + +} of getMultiRobots()) { +>getMultiRobots : Symbol(getMultiRobots, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 22, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} +for ({ + name = "noName", +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 156, 6)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 157, 20)) + + primary = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 158, 13)) + + secondary = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 159, 28)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 161, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 161, 29)) + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 7)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 162, 51)) + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>name : Symbol(name, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 22)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 32)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 163, 53)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts, 28, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..fe630aafccc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types @@ -0,0 +1,829 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} + +interface MultiRobot { +>MultiRobot : MultiRobot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +>robots : Robot[] +>Robot : Robot +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>multiRobots : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +function getRobots() { +>getRobots : () => Robot[] + + return robots; +>robots : Robot[] +} + +function getMultiRobots() { +>getMultiRobots : () => MultiRobot[] + + return multiRobots; +>multiRobots : MultiRobot[] +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +>nameA : string +>primaryA : string +>secondaryA : string +>i : number +>skillA : string + +let name: string, primary: string, secondary: string, skill: string; +>name : string +>primary : string +>secondary : string +>skill : string + +for ({name: nameA = "noName" } of robots) { +>{name: nameA = "noName" } : { name: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } of getRobots()) { +>{name: nameA = "noName" } : { name: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA = "noName" } : { name: string; } +>name : { name: string; skill: string; } +>nameA = "noName" : string +>nameA : string +>"noName" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills: { primary?: string; secondary?: string; }; } +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills: { primary?: string; secondary?: string; }; } +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills: { primary?: string; secondary?: string; }; } +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + { primary: "nosKill", secondary: "noSkill" } } of +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"nosKill" : string +>secondary : string +>"noSkill" : string + + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + +for ({ name = "noName" } of robots) { +>{ name = "noName" } : { name: string; } +>name : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } of getRobots()) { +>{ name = "noName" } : { name: string; } +>name : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{ name = "noName" } : { name: string; } +>name : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills: { primary?: string; secondary?: string; }; } + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills: { primary?: string; secondary?: string; }; } + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} +for ({ +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills: { primary?: string; secondary?: string; }; } + + skills: { +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>primaryA : string +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +>{name: nameA = "noName", skill: skillA = "noSkill" } : { name: string; skill: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : Robot +>skillA = "noSkill" : string +>skillA : string +>"noSkill" : string +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +>{name: nameA = "noName", skill: skillA = "noSkill" } : { name: string; skill: string; } +>name : Robot +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : Robot +>skillA = "noSkill" : string +>skillA : string +>"noSkill" : string +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{name: nameA = "noName", skill: skillA = "noSkill" } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>nameA = "noName" : string +>nameA : string +>"noName" : string +>skill : { name: string; skill: string; } +>skillA = "noSkill" : string +>skillA : string +>"noSkill" : string +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : MultiRobot +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : MultiRobot +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name: nameA = "noName", +>name : MultiRobot +>nameA = "noName" : string +>nameA : string +>"noName" : string + + skills: { +>skills : MultiRobot +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } + + primary: primaryA = "primary", +>primary : string +>primaryA = "primary" : string +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : string +>secondaryA = "secondary" : string +>secondaryA : string +>"secondary" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] +>MultiRobot : MultiRobot +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} + +for ({ name = "noName", skill = "noSkill" } of robots) { +>{ name = "noName", skill = "noSkill" } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>robots : Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { +>{ name = "noName", skill = "noSkill" } : { name: string; skill: string; } +>name : Robot +>skill : Robot +>getRobots() : Robot[] +>getRobots : () => Robot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +>{ name = "noName", skill = "noSkill" } : { name: string; skill: string; } +>name : { name: string; skill: string; } +>skill : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : MultiRobot + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of multiRobots) { +>multiRobots : MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : MultiRobot + + skills: { +>skills : MultiRobot +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of getMultiRobots()) { +>getMultiRobots() : MultiRobot[] +>getMultiRobots : () => MultiRobot[] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} +for ({ +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name: string; skills: { primary?: string; secondary?: string; }; } + + name = "noName", +>name : { name: string; skills: { primary: string; secondary: string; }; } + + skills: { +>skills : { name: string; skills: { primary: string; secondary: string; }; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } + + primary = "primary", +>primary : string + + secondary = "secondary" +>secondary : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js new file mode 100644 index 00000000000..4c7c0d6307b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js @@ -0,0 +1,54 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + console.log(primaryA); +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + console.log(secondaryB); +} +function foo3({ skills }: Robot) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function foo1(_a) { + var _b = _a.skills, primaryA = _b.primary, secondaryA = _b.secondary; + console.log(primaryA); +} +function foo2(_a) { + var nameC = _a.name, _b = _a.skills, primaryB = _b.primary, secondaryB = _b.secondary; + console.log(secondaryB); +} +function foo3(_a) { + var skills = _a.skills; + console.log(skills.primary); +} +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map new file mode 100644 index 00000000000..b05ceecbc4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AAExF,cAAc,EAA+D;QAA7D,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAC9D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,cAAc,EAA4E;QAA1E,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAC3E,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AACD,cAAc,EAAiB;QAAf,kBAAM;IAClB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..8e39fd676d0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.sourcemap.txt @@ -0,0 +1,578 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > { skills: { primary: primaryA, secondary: secondaryA } }: Robot +1 >Emitted(2, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(13, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(13, 78) + SourceIndex(0) +--- +>>> var _b = _a.skills, primaryA = _b.primary, secondaryA = _b.secondary; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +1->Emitted(3, 9) Source(13, 17) + SourceIndex(0) +2 >Emitted(3, 23) Source(13, 69) + SourceIndex(0) +3 >Emitted(3, 25) Source(13, 27) + SourceIndex(0) +4 >Emitted(3, 46) Source(13, 44) + SourceIndex(0) +5 >Emitted(3, 48) Source(13, 46) + SourceIndex(0) +6 >Emitted(3, 73) Source(13, 67) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > } }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(14, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(14, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(14, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(14, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(14, 17) + SourceIndex(0) +6 >Emitted(4, 25) Source(14, 25) + SourceIndex(0) +7 >Emitted(4, 26) Source(14, 26) + SourceIndex(0) +8 >Emitted(4, 27) Source(14, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(15, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( +3 > { name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot +1->Emitted(6, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(16, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(16, 91) + SourceIndex(0) +--- +>>> var nameC = _a.name, _b = _a.skills, primaryB = _b.primary, secondaryB = _b.secondary; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameC +3 > , +4 > skills: { primary: primaryB, secondary: secondaryB } +5 > +6 > primary: primaryB +7 > , +8 > secondary: secondaryB +1->Emitted(7, 9) Source(16, 17) + SourceIndex(0) +2 >Emitted(7, 24) Source(16, 28) + SourceIndex(0) +3 >Emitted(7, 26) Source(16, 30) + SourceIndex(0) +4 >Emitted(7, 40) Source(16, 82) + SourceIndex(0) +5 >Emitted(7, 42) Source(16, 40) + SourceIndex(0) +6 >Emitted(7, 63) Source(16, 57) + SourceIndex(0) +7 >Emitted(7, 65) Source(16, 59) + SourceIndex(0) +8 >Emitted(7, 90) Source(16, 80) + SourceIndex(0) +--- +>>> console.log(secondaryB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 > } }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > secondaryB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(17, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(17, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(17, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(17, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(17, 17) + SourceIndex(0) +6 >Emitted(8, 27) Source(17, 27) + SourceIndex(0) +7 >Emitted(8, 28) Source(17, 28) + SourceIndex(0) +8 >Emitted(8, 29) Source(17, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(18, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { skills }: Robot +1->Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(19, 32) + SourceIndex(0) +--- +>>> var skills = _a.skills; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^-> +1-> +2 > skills +1->Emitted(11, 9) Source(19, 17) + SourceIndex(0) +2 >Emitted(11, 27) Source(19, 23) + SourceIndex(0) +--- +>>> console.log(skills.primary); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^^^^^^^ +9 > ^ +10> ^ +1-> }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skills +7 > . +8 > primary +9 > ) +10> ; +1->Emitted(12, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(20, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(20, 24) + SourceIndex(0) +8 >Emitted(12, 31) Source(20, 31) + SourceIndex(0) +9 >Emitted(12, 32) Source(20, 32) + SourceIndex(0) +10>Emitted(12, 33) Source(20, 33) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(14, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(14, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(14, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(15, 8) Source(24, 8) + SourceIndex(0) +5 >Emitted(15, 12) Source(24, 12) + SourceIndex(0) +6 >Emitted(15, 14) Source(24, 14) + SourceIndex(0) +7 >Emitted(15, 21) Source(24, 21) + SourceIndex(0) +8 >Emitted(15, 23) Source(24, 23) + SourceIndex(0) +9 >Emitted(15, 29) Source(24, 29) + SourceIndex(0) +10>Emitted(15, 31) Source(24, 31) + SourceIndex(0) +11>Emitted(15, 33) Source(24, 33) + SourceIndex(0) +12>Emitted(15, 40) Source(24, 40) + SourceIndex(0) +13>Emitted(15, 42) Source(24, 42) + SourceIndex(0) +14>Emitted(15, 50) Source(24, 50) + SourceIndex(0) +15>Emitted(15, 52) Source(24, 52) + SourceIndex(0) +16>Emitted(15, 61) Source(24, 61) + SourceIndex(0) +17>Emitted(15, 63) Source(24, 63) + SourceIndex(0) +18>Emitted(15, 80) Source(24, 80) + SourceIndex(0) +19>Emitted(15, 82) Source(24, 82) + SourceIndex(0) +20>Emitted(15, 84) Source(24, 84) + SourceIndex(0) +21>Emitted(15, 85) Source(24, 85) + SourceIndex(0) +22>Emitted(15, 86) Source(24, 86) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(16, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(16, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(16, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(16, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(17, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(17, 8) Source(27, 8) + SourceIndex(0) +5 >Emitted(17, 12) Source(27, 12) + SourceIndex(0) +6 >Emitted(17, 14) Source(27, 14) + SourceIndex(0) +7 >Emitted(17, 21) Source(27, 21) + SourceIndex(0) +8 >Emitted(17, 23) Source(27, 23) + SourceIndex(0) +9 >Emitted(17, 29) Source(27, 29) + SourceIndex(0) +10>Emitted(17, 31) Source(27, 31) + SourceIndex(0) +11>Emitted(17, 33) Source(27, 33) + SourceIndex(0) +12>Emitted(17, 40) Source(27, 40) + SourceIndex(0) +13>Emitted(17, 42) Source(27, 42) + SourceIndex(0) +14>Emitted(17, 50) Source(27, 50) + SourceIndex(0) +15>Emitted(17, 52) Source(27, 52) + SourceIndex(0) +16>Emitted(17, 61) Source(27, 61) + SourceIndex(0) +17>Emitted(17, 63) Source(27, 63) + SourceIndex(0) +18>Emitted(17, 80) Source(27, 80) + SourceIndex(0) +19>Emitted(17, 82) Source(27, 82) + SourceIndex(0) +20>Emitted(17, 84) Source(27, 84) + SourceIndex(0) +21>Emitted(17, 85) Source(27, 85) + SourceIndex(0) +22>Emitted(17, 86) Source(27, 86) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(18, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +23> ^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(19, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(19, 8) Source(30, 8) + SourceIndex(0) +5 >Emitted(19, 12) Source(30, 12) + SourceIndex(0) +6 >Emitted(19, 14) Source(30, 14) + SourceIndex(0) +7 >Emitted(19, 21) Source(30, 21) + SourceIndex(0) +8 >Emitted(19, 23) Source(30, 23) + SourceIndex(0) +9 >Emitted(19, 29) Source(30, 29) + SourceIndex(0) +10>Emitted(19, 31) Source(30, 31) + SourceIndex(0) +11>Emitted(19, 33) Source(30, 33) + SourceIndex(0) +12>Emitted(19, 40) Source(30, 40) + SourceIndex(0) +13>Emitted(19, 42) Source(30, 42) + SourceIndex(0) +14>Emitted(19, 50) Source(30, 50) + SourceIndex(0) +15>Emitted(19, 52) Source(30, 52) + SourceIndex(0) +16>Emitted(19, 61) Source(30, 61) + SourceIndex(0) +17>Emitted(19, 63) Source(30, 63) + SourceIndex(0) +18>Emitted(19, 80) Source(30, 80) + SourceIndex(0) +19>Emitted(19, 82) Source(30, 82) + SourceIndex(0) +20>Emitted(19, 84) Source(30, 84) + SourceIndex(0) +21>Emitted(19, 85) Source(30, 85) + SourceIndex(0) +22>Emitted(19, 86) Source(30, 86) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.symbols new file mode 100644 index 00000000000..3b2a89b2bda --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.symbols @@ -0,0 +1,112 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 4, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 6, 24)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 65)) + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 88)) +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 12, 25)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 6, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 12, 44)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 12, 25)) +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 14, 1)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 3, 17)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 15)) +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 38)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 6, 24)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 57)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + console.log(secondaryB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 15, 57)) +} +function foo3({ skills }: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 17, 1)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 18, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 2, 1)) + + console.log(skills.primary); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 0, 22)) +>skills.primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 18, 15)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 5, 13)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 88)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 88)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 23, 50)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 14, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 14, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 26, 50)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 17, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 10, 3)) + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 17, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts, 29, 50)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types new file mode 100644 index 00000000000..029e47cd3a0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types @@ -0,0 +1,141 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { +>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>Robot : Robot + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>primaryA : string +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { +>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>name : any +>nameC : string +>skills : any +>primary : any +>primaryB : string +>secondary : any +>secondaryB : string +>Robot : Robot + + console.log(secondaryB); +>console.log(secondaryB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>secondaryB : string +} +function foo3({ skills }: Robot) { +>foo3 : ({ skills }: Robot) => void +>skills : { primary: string; secondary: string; } +>Robot : Robot + + console.log(skills.primary); +>console.log(skills.primary) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skills.primary : string +>skills : { primary: string; secondary: string; } +>primary : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ skills }: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo3 : ({ skills }: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..b67f5047965 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js @@ -0,0 +1,67 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1( + { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(primaryA); +} +function foo2( + { + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(secondaryB); +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + + +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function foo1(_a) { + var _b = (_a === void 0 ? robotA : _a).skills, _c = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b, _d = _c.primary, primaryA = _d === void 0 ? "primary" : _d, _e = _c.secondary, secondaryA = _e === void 0 ? "secondary" : _e; + console.log(primaryA); +} +function foo2(_a) { + var _b = _a === void 0 ? robotA : _a, _c = _b.name, nameC = _c === void 0 ? "name" : _c, _d = _b.skills, _e = _d === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _d, _f = _e.primary, primaryB = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryB = _g === void 0 ? "secondary" : _g; + console.log(secondaryB); +} +function foo3(_a) { + var _b = (_a === void 0 ? robotA : _a).skills, skills = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b; + console.log(skills.primary); +} +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..0fdd3c9bcec --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AAExF,cACI,EAKiB;QAJb,yCAGoD,EAHpD,0EAGoD,EAFhD,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC;IAG3C,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,cACI,EAMiB;QANjB,gCAMiB,EALb,YAAoB,EAApB,mCAAoB,EACpB,cAGoD,EAHpD,0EAGoD,EAFhD,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC;IAG3C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AACD,cAAc,EAA8E;QAA5E,yCAAyD,EAAzD,8EAAyD;IACrE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..aca1d58bcac --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,669 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( + > +3 > { + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA +1 >Emitted(2, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(14, 5) + SourceIndex(0) +3 >Emitted(2, 17) Source(19, 22) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? robotA : _a).skills, _c = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b, _d = _c.primary, primaryA = _d === void 0 ? "primary" : _d, _e = _c.secondary, secondaryA = _e === void 0 ? "secondary" : _e; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +3 > +4 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +5 > +6 > primary: primaryA = "primary" +7 > +8 > primary: primaryA = "primary" +9 > , + > +10> secondary: secondaryA = "secondary" +11> +12> secondary: secondaryA = "secondary" +1->Emitted(3, 9) Source(15, 9) + SourceIndex(0) +2 >Emitted(3, 50) Source(18, 61) + SourceIndex(0) +3 >Emitted(3, 52) Source(15, 9) + SourceIndex(0) +4 >Emitted(3, 126) Source(18, 61) + SourceIndex(0) +5 >Emitted(3, 128) Source(16, 13) + SourceIndex(0) +6 >Emitted(3, 143) Source(16, 42) + SourceIndex(0) +7 >Emitted(3, 145) Source(16, 13) + SourceIndex(0) +8 >Emitted(3, 186) Source(16, 42) + SourceIndex(0) +9 >Emitted(3, 188) Source(17, 13) + SourceIndex(0) +10>Emitted(3, 205) Source(17, 48) + SourceIndex(0) +11>Emitted(3, 207) Source(17, 13) + SourceIndex(0) +12>Emitted(3, 252) Source(17, 48) + SourceIndex(0) +--- +>>> console.log(primaryA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA) { + > +2 > console +3 > . +4 > log +5 > ( +6 > primaryA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(4, 25) Source(20, 25) + SourceIndex(0) +7 >Emitted(4, 26) Source(20, 26) + SourceIndex(0) +8 >Emitted(4, 27) Source(20, 27) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(21, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( + > +3 > { + > name: nameC = "name", + > skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA +1->Emitted(6, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(23, 5) + SourceIndex(0) +3 >Emitted(6, 17) Source(29, 22) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? robotA : _a, _c = _b.name, nameC = _c === void 0 ? "name" : _c, _d = _b.skills, _e = _d === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _d, _f = _e.primary, primaryB = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryB = _g === void 0 ? "secondary" : _g; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { + > name: nameC = "name", + > skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA +3 > +4 > name: nameC = "name" +5 > +6 > name: nameC = "name" +7 > , + > +8 > skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +9 > +10> skills: { + > primary: primaryB = "primary", + > secondary: secondaryB = "secondary" + > } = { primary: "SomeSkill", secondary: "someSkill" } +11> +12> primary: primaryB = "primary" +13> +14> primary: primaryB = "primary" +15> , + > +16> secondary: secondaryB = "secondary" +17> +18> secondary: secondaryB = "secondary" +1->Emitted(7, 9) Source(23, 5) + SourceIndex(0) +2 >Emitted(7, 41) Source(29, 22) + SourceIndex(0) +3 >Emitted(7, 43) Source(24, 9) + SourceIndex(0) +4 >Emitted(7, 55) Source(24, 29) + SourceIndex(0) +5 >Emitted(7, 57) Source(24, 9) + SourceIndex(0) +6 >Emitted(7, 92) Source(24, 29) + SourceIndex(0) +7 >Emitted(7, 94) Source(25, 9) + SourceIndex(0) +8 >Emitted(7, 108) Source(28, 61) + SourceIndex(0) +9 >Emitted(7, 110) Source(25, 9) + SourceIndex(0) +10>Emitted(7, 184) Source(28, 61) + SourceIndex(0) +11>Emitted(7, 186) Source(26, 13) + SourceIndex(0) +12>Emitted(7, 201) Source(26, 42) + SourceIndex(0) +13>Emitted(7, 203) Source(26, 13) + SourceIndex(0) +14>Emitted(7, 244) Source(26, 42) + SourceIndex(0) +15>Emitted(7, 246) Source(27, 13) + SourceIndex(0) +16>Emitted(7, 263) Source(27, 48) + SourceIndex(0) +17>Emitted(7, 265) Source(27, 13) + SourceIndex(0) +18>Emitted(7, 310) Source(27, 48) + SourceIndex(0) +--- +>>> console.log(secondaryB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 > + > } = { primary: "SomeSkill", secondary: "someSkill" } + > }: Robot = robotA) { + > +2 > console +3 > . +4 > log +5 > ( +6 > secondaryB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(30, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(30, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(30, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(30, 17) + SourceIndex(0) +6 >Emitted(8, 27) Source(30, 27) + SourceIndex(0) +7 >Emitted(8, 28) Source(30, 28) + SourceIndex(0) +8 >Emitted(8, 29) Source(30, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(31, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(31, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA +1->Emitted(10, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(32, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(32, 93) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? robotA : _a).skills, skills = _b === void 0 ? { primary: "SomeSkill", secondary: "someSkill" } : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > skills = { primary: "SomeSkill", secondary: "someSkill" } +3 > +4 > skills = { primary: "SomeSkill", secondary: "someSkill" } +1->Emitted(11, 9) Source(32, 17) + SourceIndex(0) +2 >Emitted(11, 50) Source(32, 74) + SourceIndex(0) +3 >Emitted(11, 52) Source(32, 17) + SourceIndex(0) +4 >Emitted(11, 130) Source(32, 74) + SourceIndex(0) +--- +>>> console.log(skills.primary); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^^^^^^^ +9 > ^ +10> ^ +1 > }: Robot = robotA) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skills +7 > . +8 > primary +9 > ) +10> ; +1 >Emitted(12, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(33, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(33, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(33, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(33, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(33, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(33, 24) + SourceIndex(0) +8 >Emitted(12, 31) Source(33, 31) + SourceIndex(0) +9 >Emitted(12, 32) Source(33, 32) + SourceIndex(0) +10>Emitted(12, 33) Source(33, 33) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(34, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(14, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(36, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(36, 6) + SourceIndex(0) +4 >Emitted(14, 12) Source(36, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(36, 13) + SourceIndex(0) +6 >Emitted(14, 14) Source(36, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(15, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(37, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(37, 6) + SourceIndex(0) +4 >Emitted(15, 8) Source(37, 8) + SourceIndex(0) +5 >Emitted(15, 12) Source(37, 12) + SourceIndex(0) +6 >Emitted(15, 14) Source(37, 14) + SourceIndex(0) +7 >Emitted(15, 21) Source(37, 21) + SourceIndex(0) +8 >Emitted(15, 23) Source(37, 23) + SourceIndex(0) +9 >Emitted(15, 29) Source(37, 29) + SourceIndex(0) +10>Emitted(15, 31) Source(37, 31) + SourceIndex(0) +11>Emitted(15, 33) Source(37, 33) + SourceIndex(0) +12>Emitted(15, 40) Source(37, 40) + SourceIndex(0) +13>Emitted(15, 42) Source(37, 42) + SourceIndex(0) +14>Emitted(15, 50) Source(37, 50) + SourceIndex(0) +15>Emitted(15, 52) Source(37, 52) + SourceIndex(0) +16>Emitted(15, 61) Source(37, 61) + SourceIndex(0) +17>Emitted(15, 63) Source(37, 63) + SourceIndex(0) +18>Emitted(15, 80) Source(37, 80) + SourceIndex(0) +19>Emitted(15, 82) Source(37, 82) + SourceIndex(0) +20>Emitted(15, 84) Source(37, 84) + SourceIndex(0) +21>Emitted(15, 85) Source(37, 85) + SourceIndex(0) +22>Emitted(15, 86) Source(37, 86) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(16, 1) Source(39, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(39, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(39, 6) + SourceIndex(0) +4 >Emitted(16, 12) Source(39, 12) + SourceIndex(0) +5 >Emitted(16, 13) Source(39, 13) + SourceIndex(0) +6 >Emitted(16, 14) Source(39, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(17, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(40, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(40, 6) + SourceIndex(0) +4 >Emitted(17, 8) Source(40, 8) + SourceIndex(0) +5 >Emitted(17, 12) Source(40, 12) + SourceIndex(0) +6 >Emitted(17, 14) Source(40, 14) + SourceIndex(0) +7 >Emitted(17, 21) Source(40, 21) + SourceIndex(0) +8 >Emitted(17, 23) Source(40, 23) + SourceIndex(0) +9 >Emitted(17, 29) Source(40, 29) + SourceIndex(0) +10>Emitted(17, 31) Source(40, 31) + SourceIndex(0) +11>Emitted(17, 33) Source(40, 33) + SourceIndex(0) +12>Emitted(17, 40) Source(40, 40) + SourceIndex(0) +13>Emitted(17, 42) Source(40, 42) + SourceIndex(0) +14>Emitted(17, 50) Source(40, 50) + SourceIndex(0) +15>Emitted(17, 52) Source(40, 52) + SourceIndex(0) +16>Emitted(17, 61) Source(40, 61) + SourceIndex(0) +17>Emitted(17, 63) Source(40, 63) + SourceIndex(0) +18>Emitted(17, 80) Source(40, 80) + SourceIndex(0) +19>Emitted(17, 82) Source(40, 82) + SourceIndex(0) +20>Emitted(17, 84) Source(40, 84) + SourceIndex(0) +21>Emitted(17, 85) Source(40, 85) + SourceIndex(0) +22>Emitted(17, 86) Source(40, 86) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(18, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(42, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(42, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(42, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(42, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(42, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^^ +12> ^^^^^^^ +13> ^^ +14> ^^^^^^^^ +15> ^^ +16> ^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^ +21> ^ +22> ^ +23> ^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skills +10> : +11> { +12> primary +13> : +14> "edging" +15> , +16> secondary +17> : +18> "branch trimming" +19> } +20> } +21> ) +22> ; +1->Emitted(19, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(43, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(43, 6) + SourceIndex(0) +4 >Emitted(19, 8) Source(43, 8) + SourceIndex(0) +5 >Emitted(19, 12) Source(43, 12) + SourceIndex(0) +6 >Emitted(19, 14) Source(43, 14) + SourceIndex(0) +7 >Emitted(19, 21) Source(43, 21) + SourceIndex(0) +8 >Emitted(19, 23) Source(43, 23) + SourceIndex(0) +9 >Emitted(19, 29) Source(43, 29) + SourceIndex(0) +10>Emitted(19, 31) Source(43, 31) + SourceIndex(0) +11>Emitted(19, 33) Source(43, 33) + SourceIndex(0) +12>Emitted(19, 40) Source(43, 40) + SourceIndex(0) +13>Emitted(19, 42) Source(43, 42) + SourceIndex(0) +14>Emitted(19, 50) Source(43, 50) + SourceIndex(0) +15>Emitted(19, 52) Source(43, 52) + SourceIndex(0) +16>Emitted(19, 61) Source(43, 61) + SourceIndex(0) +17>Emitted(19, 63) Source(43, 63) + SourceIndex(0) +18>Emitted(19, 80) Source(43, 80) + SourceIndex(0) +19>Emitted(19, 82) Source(43, 82) + SourceIndex(0) +20>Emitted(19, 84) Source(43, 84) + SourceIndex(0) +21>Emitted(19, 85) Source(43, 85) + SourceIndex(0) +22>Emitted(19, 86) Source(43, 86) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..229e9acb6da --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 4, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 6, 25)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 65)) + +function foo1( +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 88)) + { + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 4, 17)) + + primary: primaryA = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 14, 17)) + + secondary: secondaryA = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 6, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 15, 42)) + + } = { primary: "SomeSkill", secondary: "someSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 17, 13)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 17, 35)) + + }: Robot = robotA) { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + + console.log(primaryA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 14, 17)) +} +function foo2( +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 20, 1)) + { + name: nameC = "name", +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 3, 17)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 22, 5)) + + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 4, 17)) + + primary: primaryB = "primary", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 24, 17)) + + secondary: secondaryB = "secondary" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 6, 25)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 25, 42)) + + } = { primary: "SomeSkill", secondary: "someSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 27, 13)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 27, 35)) + + }: Robot = robotA) { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + + console.log(secondaryB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 25, 42)) +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 30, 1)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 15)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 26)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 48)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 2, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + + console.log(skills.primary); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 0, 22)) +>skills.primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 31, 15)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 5, 13)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 88)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 88)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 36, 50)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 20, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 20, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 39, 50)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 30, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 10, 3)) + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 30, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 6)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 21)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 31)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts, 42, 50)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..a9e5c2d6ee6 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -0,0 +1,219 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +function foo1( +>foo1 : ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void + { + skills: { +>skills : any + + primary: primaryA = "primary", +>primary : any +>primaryA : string +>"primary" : string + + secondary: secondaryA = "secondary" +>secondary : any +>secondaryA : string +>"secondary" : string + + } = { primary: "SomeSkill", secondary: "someSkill" } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"SomeSkill" : string +>secondary : string +>"someSkill" : string + + }: Robot = robotA) { +>Robot : Robot +>robotA : Robot + + console.log(primaryA); +>console.log(primaryA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>primaryA : string +} +function foo2( +>foo2 : ({ + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void + { + name: nameC = "name", +>name : any +>nameC : string +>"name" : string + + skills: { +>skills : any + + primary: primaryB = "primary", +>primary : any +>primaryB : string +>"primary" : string + + secondary: secondaryB = "secondary" +>secondary : any +>secondaryB : string +>"secondary" : string + + } = { primary: "SomeSkill", secondary: "someSkill" } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"SomeSkill" : string +>secondary : string +>"someSkill" : string + + }: Robot = robotA) { +>Robot : Robot +>robotA : Robot + + console.log(secondaryB); +>console.log(secondaryB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>secondaryB : string +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { +>foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>skills : { primary?: string; secondary?: string; } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } +>primary : string +>"SomeSkill" : string +>secondary : string +>"someSkill" : string +>Robot : Robot +>robotA : Robot + + console.log(skills.primary); +>console.log(skills.primary) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skills.primary : string +>skills : { primary?: string; secondary?: string; } +>primary : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo1 : ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo2 : ({ + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }?: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void +>foo3 : ({ skills = { primary: "SomeSkill", secondary: "someSkill" } }?: Robot) => void +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js new file mode 100644 index 00000000000..4a56f449ecc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js @@ -0,0 +1,53 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA }: Robot) { + console.log(nameA); +} +function foo2({ name: nameB, skill: skillB }: Robot) { + console.log(nameB); +} +function foo3({ name }: Robot) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); + + +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +function foo1(_a) { + var nameA = _a.name; + console.log(nameA); +} +function foo2(_a) { + var nameB = _a.name, skillB = _a.skill; + console.log(nameB); +} +function foo3(_a) { + var name = _a.name; + console.log(name); +} +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map new file mode 100644 index 00000000000..adc7a7dbb90 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterObjectBindingPattern.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAEvD,cAAc,EAAsB;QAApB,eAAW;IACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAqC;QAAnC,eAAW,EAAE,iBAAa;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAe;QAAb,cAAI;IAChB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..ee826647f54 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt @@ -0,0 +1,472 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringParameterObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringParameterObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > { name: nameA }: Robot +1 >Emitted(3, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(3, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(3, 17) Source(11, 37) + SourceIndex(0) +--- +>>> var nameA = _a.name; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^-> +1-> +2 > name: nameA +1->Emitted(4, 9) Source(11, 17) + SourceIndex(0) +2 >Emitted(4, 24) Source(11, 28) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(5, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(5, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(5, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(5, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(5, 22) Source(12, 22) + SourceIndex(0) +7 >Emitted(5, 23) Source(12, 23) + SourceIndex(0) +8 >Emitted(5, 24) Source(12, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( +3 > { name: nameB, skill: skillB }: Robot +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 15) Source(14, 15) + SourceIndex(0) +3 >Emitted(7, 17) Source(14, 52) + SourceIndex(0) +--- +>>> var nameB = _a.name, skillB = _a.skill; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameB +3 > , +4 > skill: skillB +1->Emitted(8, 9) Source(14, 17) + SourceIndex(0) +2 >Emitted(8, 24) Source(14, 28) + SourceIndex(0) +3 >Emitted(8, 26) Source(14, 30) + SourceIndex(0) +4 >Emitted(8, 43) Source(14, 43) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(9, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(9, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(9, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(9, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(9, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(9, 22) Source(15, 22) + SourceIndex(0) +7 >Emitted(9, 23) Source(15, 23) + SourceIndex(0) +8 >Emitted(9, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(16, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { name }: Robot +1->Emitted(11, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(11, 15) Source(17, 15) + SourceIndex(0) +3 >Emitted(11, 17) Source(17, 30) + SourceIndex(0) +--- +>>> var name = _a.name; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^-> +1-> +2 > name +1->Emitted(12, 9) Source(17, 17) + SourceIndex(0) +2 >Emitted(12, 23) Source(17, 21) + SourceIndex(0) +--- +>>> console.log(name); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +1-> }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > name +7 > ) +8 > ; +1->Emitted(13, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(13, 21) Source(18, 21) + SourceIndex(0) +7 >Emitted(13, 22) Source(18, 22) + SourceIndex(0) +8 >Emitted(13, 23) Source(18, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(19, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(15, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(15, 12) Source(21, 12) + SourceIndex(0) +5 >Emitted(15, 13) Source(21, 13) + SourceIndex(0) +6 >Emitted(15, 14) Source(21, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(16, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(22, 6) + SourceIndex(0) +4 >Emitted(16, 8) Source(22, 8) + SourceIndex(0) +5 >Emitted(16, 12) Source(22, 12) + SourceIndex(0) +6 >Emitted(16, 14) Source(22, 14) + SourceIndex(0) +7 >Emitted(16, 21) Source(22, 21) + SourceIndex(0) +8 >Emitted(16, 23) Source(22, 23) + SourceIndex(0) +9 >Emitted(16, 28) Source(22, 28) + SourceIndex(0) +10>Emitted(16, 30) Source(22, 30) + SourceIndex(0) +11>Emitted(16, 45) Source(22, 45) + SourceIndex(0) +12>Emitted(16, 47) Source(22, 47) + SourceIndex(0) +13>Emitted(16, 48) Source(22, 48) + SourceIndex(0) +14>Emitted(16, 49) Source(22, 49) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(17, 12) Source(24, 12) + SourceIndex(0) +5 >Emitted(17, 13) Source(24, 13) + SourceIndex(0) +6 >Emitted(17, 14) Source(24, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(18, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(18, 8) Source(25, 8) + SourceIndex(0) +5 >Emitted(18, 12) Source(25, 12) + SourceIndex(0) +6 >Emitted(18, 14) Source(25, 14) + SourceIndex(0) +7 >Emitted(18, 21) Source(25, 21) + SourceIndex(0) +8 >Emitted(18, 23) Source(25, 23) + SourceIndex(0) +9 >Emitted(18, 28) Source(25, 28) + SourceIndex(0) +10>Emitted(18, 30) Source(25, 30) + SourceIndex(0) +11>Emitted(18, 45) Source(25, 45) + SourceIndex(0) +12>Emitted(18, 47) Source(25, 47) + SourceIndex(0) +13>Emitted(18, 48) Source(25, 48) + SourceIndex(0) +14>Emitted(18, 49) Source(25, 49) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +5 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +6 >Emitted(19, 14) Source(27, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(20, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(28, 6) + SourceIndex(0) +4 >Emitted(20, 8) Source(28, 8) + SourceIndex(0) +5 >Emitted(20, 12) Source(28, 12) + SourceIndex(0) +6 >Emitted(20, 14) Source(28, 14) + SourceIndex(0) +7 >Emitted(20, 21) Source(28, 21) + SourceIndex(0) +8 >Emitted(20, 23) Source(28, 23) + SourceIndex(0) +9 >Emitted(20, 28) Source(28, 28) + SourceIndex(0) +10>Emitted(20, 30) Source(28, 30) + SourceIndex(0) +11>Emitted(20, 45) Source(28, 45) + SourceIndex(0) +12>Emitted(20, 47) Source(28, 47) + SourceIndex(0) +13>Emitted(20, 48) Source(28, 48) + SourceIndex(0) +14>Emitted(20, 49) Source(28, 49) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols new file mode 100644 index 00000000000..9b810165c1b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 36)) + +function foo1({ name: nameA }: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 10, 15)) +} +function foo2({ name: nameB, skill: skillB }: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 15)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 28)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 15)) +} +function foo3({ name }: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 16, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(name); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 16, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 21, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 21, 21)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 24, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 24, 21)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 27, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 27, 21)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types new file mode 100644 index 00000000000..894cd714c73 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -0,0 +1,113 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +function foo1({ name: nameA }: Robot) { +>foo1 : ({ name: nameA }: Robot) => void +>name : any +>nameA : string +>Robot : Robot + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameA : string +} +function foo2({ name: nameB, skill: skillB }: Robot) { +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>name : any +>nameB : string +>skill : any +>skillB : string +>Robot : Robot + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameB : string +} +function foo3({ name }: Robot) { +>foo3 : ({ name }: Robot) => void +>name : string +>Robot : Robot + + console.log(name); +>console.log(name) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>name : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ name: nameA }: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1({ name: "Edger", skill: "cutting edges" }) : void +>foo1 : ({ name: nameA }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2({ name: "Edger", skill: "cutting edges" }) : void +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ name }: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3({ name: "Edger", skill: "cutting edges" }) : void +>foo3 : ({ name }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js new file mode 100644 index 00000000000..9fd269c62cc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js @@ -0,0 +1,53 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts] +interface Robot { + name?: string; + skill?: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA = "" }: Robot = { }) { + console.log(nameA); +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + console.log(nameB); +} +function foo3({ name = "" }: Robot = {}) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); + + +//// [sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +function foo1(_a) { + var _b = (_a === void 0 ? {} : _a).name, nameA = _b === void 0 ? "" : _b; + console.log(nameA); +} +function foo2(_a) { + var _b = _a === void 0 ? {} : _a, _c = _b.name, nameB = _c === void 0 ? "" : _c, _d = _b.skill, skillB = _d === void 0 ? "noSkill" : _d; + console.log(nameB); +} +function foo3(_a) { + var _b = (_a === void 0 ? {} : _a).name, name = _b === void 0 ? "" : _b; + console.log(name); +} +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..ddf41d9e59f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAEvD,cAAc,EAAyC;QAAvC,mCAAwB,EAAxB,uCAAwB;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAmE;QAAnE,4BAAmE,EAAjE,YAAwB,EAAxB,uCAAwB,EAAE,aAAyB,EAAzB,uCAAyB;IAC/D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAiC;QAA/B,mCAAiB,EAAjB,sCAAiB;IAC7B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..555bc560797 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,500 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name?: string; + > skill?: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > { name: nameA = "" }: Robot = { } +1 >Emitted(3, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(3, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(3, 17) Source(11, 56) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? {} : _a).name, nameA = _b === void 0 ? "" : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameA = "" +3 > +4 > name: nameA = "" +1->Emitted(4, 9) Source(11, 17) + SourceIndex(0) +2 >Emitted(4, 44) Source(11, 41) + SourceIndex(0) +3 >Emitted(4, 46) Source(11, 17) + SourceIndex(0) +4 >Emitted(4, 85) Source(11, 41) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > }: Robot = { }) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(5, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(5, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(5, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(5, 22) Source(12, 22) + SourceIndex(0) +7 >Emitted(5, 23) Source(12, 23) + SourceIndex(0) +8 >Emitted(5, 24) Source(12, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( +3 > { name: nameB = "", skill: skillB = "noSkill" }: Robot = {} +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 15) Source(14, 15) + SourceIndex(0) +3 >Emitted(7, 17) Source(14, 82) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? {} : _a, _c = _b.name, nameB = _c === void 0 ? "" : _c, _d = _b.skill, skillB = _d === void 0 ? "noSkill" : _d; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > { name: nameB = "", skill: skillB = "noSkill" }: Robot = {} +3 > +4 > name: nameB = "" +5 > +6 > name: nameB = "" +7 > , +8 > skill: skillB = "noSkill" +9 > +10> skill: skillB = "noSkill" +1->Emitted(8, 9) Source(14, 15) + SourceIndex(0) +2 >Emitted(8, 37) Source(14, 82) + SourceIndex(0) +3 >Emitted(8, 39) Source(14, 17) + SourceIndex(0) +4 >Emitted(8, 51) Source(14, 41) + SourceIndex(0) +5 >Emitted(8, 53) Source(14, 17) + SourceIndex(0) +6 >Emitted(8, 92) Source(14, 41) + SourceIndex(0) +7 >Emitted(8, 94) Source(14, 43) + SourceIndex(0) +8 >Emitted(8, 107) Source(14, 68) + SourceIndex(0) +9 >Emitted(8, 109) Source(14, 43) + SourceIndex(0) +10>Emitted(8, 148) Source(14, 68) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > }: Robot = {}) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(9, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(9, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(9, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(9, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(9, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(9, 22) Source(15, 22) + SourceIndex(0) +7 >Emitted(9, 23) Source(15, 23) + SourceIndex(0) +8 >Emitted(9, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(16, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { name = "" }: Robot = {} +1->Emitted(11, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(11, 15) Source(17, 15) + SourceIndex(0) +3 >Emitted(11, 17) Source(17, 48) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? {} : _a).name, name = _b === void 0 ? "" : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > name = "" +3 > +4 > name = "" +1->Emitted(12, 9) Source(17, 17) + SourceIndex(0) +2 >Emitted(12, 44) Source(17, 34) + SourceIndex(0) +3 >Emitted(12, 46) Source(17, 17) + SourceIndex(0) +4 >Emitted(12, 84) Source(17, 34) + SourceIndex(0) +--- +>>> console.log(name); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +1 > }: Robot = {}) { + > +2 > console +3 > . +4 > log +5 > ( +6 > name +7 > ) +8 > ; +1 >Emitted(13, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(13, 21) Source(18, 21) + SourceIndex(0) +7 >Emitted(13, 22) Source(18, 22) + SourceIndex(0) +8 >Emitted(13, 23) Source(18, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(19, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(15, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(15, 12) Source(21, 12) + SourceIndex(0) +5 >Emitted(15, 13) Source(21, 13) + SourceIndex(0) +6 >Emitted(15, 14) Source(21, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(16, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(22, 6) + SourceIndex(0) +4 >Emitted(16, 8) Source(22, 8) + SourceIndex(0) +5 >Emitted(16, 12) Source(22, 12) + SourceIndex(0) +6 >Emitted(16, 14) Source(22, 14) + SourceIndex(0) +7 >Emitted(16, 21) Source(22, 21) + SourceIndex(0) +8 >Emitted(16, 23) Source(22, 23) + SourceIndex(0) +9 >Emitted(16, 28) Source(22, 28) + SourceIndex(0) +10>Emitted(16, 30) Source(22, 30) + SourceIndex(0) +11>Emitted(16, 45) Source(22, 45) + SourceIndex(0) +12>Emitted(16, 47) Source(22, 47) + SourceIndex(0) +13>Emitted(16, 48) Source(22, 48) + SourceIndex(0) +14>Emitted(16, 49) Source(22, 49) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(17, 12) Source(24, 12) + SourceIndex(0) +5 >Emitted(17, 13) Source(24, 13) + SourceIndex(0) +6 >Emitted(17, 14) Source(24, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(18, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(18, 8) Source(25, 8) + SourceIndex(0) +5 >Emitted(18, 12) Source(25, 12) + SourceIndex(0) +6 >Emitted(18, 14) Source(25, 14) + SourceIndex(0) +7 >Emitted(18, 21) Source(25, 21) + SourceIndex(0) +8 >Emitted(18, 23) Source(25, 23) + SourceIndex(0) +9 >Emitted(18, 28) Source(25, 28) + SourceIndex(0) +10>Emitted(18, 30) Source(25, 30) + SourceIndex(0) +11>Emitted(18, 45) Source(25, 45) + SourceIndex(0) +12>Emitted(18, 47) Source(25, 47) + SourceIndex(0) +13>Emitted(18, 48) Source(25, 48) + SourceIndex(0) +14>Emitted(18, 49) Source(25, 49) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +5 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +6 >Emitted(19, 14) Source(27, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(20, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(28, 6) + SourceIndex(0) +4 >Emitted(20, 8) Source(28, 8) + SourceIndex(0) +5 >Emitted(20, 12) Source(28, 12) + SourceIndex(0) +6 >Emitted(20, 14) Source(28, 14) + SourceIndex(0) +7 >Emitted(20, 21) Source(28, 21) + SourceIndex(0) +8 >Emitted(20, 23) Source(28, 23) + SourceIndex(0) +9 >Emitted(20, 28) Source(28, 28) + SourceIndex(0) +10>Emitted(20, 30) Source(28, 30) + SourceIndex(0) +11>Emitted(20, 45) Source(28, 45) + SourceIndex(0) +12>Emitted(20, 47) Source(28, 47) + SourceIndex(0) +13>Emitted(20, 48) Source(28, 48) + SourceIndex(0) +14>Emitted(20, 49) Source(28, 49) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..7e3804a5e88 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + name?: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 17)) + + skill?: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 1, 18)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 36)) + +function foo1({ name: nameA = "" }: Robot = { }) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 55)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 10, 15)) +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 12, 1)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 13, 15)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 1, 18)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 13, 41)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 13, 15)) +} +function foo3({ name = "" }: Robot = {}) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 16, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 0, 0)) + + console.log(name); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 4, 22)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 16, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 55)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 21, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 21, 21)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 12, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 24, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 24, 21)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 15, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 8, 3)) + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 27, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts, 27, 21)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types new file mode 100644 index 00000000000..669708f412f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types @@ -0,0 +1,120 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts === +interface Robot { +>Robot : Robot + + name?: string; +>name : string + + skill?: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +function foo1({ name: nameA = "" }: Robot = { }) { +>foo1 : ({ name: nameA = "" }?: Robot) => void +>name : any +>nameA : string +>"" : string +>Robot : Robot +>{ } : {} + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameA : string +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { +>foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>name : any +>nameB : string +>"" : string +>skill : any +>skillB : string +>"noSkill" : string +>Robot : Robot +>{} : {} + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameB : string +} +function foo3({ name = "" }: Robot = {}) { +>foo3 : ({ name = "" }?: Robot) => void +>name : string +>"" : string +>Robot : Robot +>{} : {} + + console.log(name); +>console.log(name) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>name : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ name: nameA = "" }?: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1({ name: "Edger", skill: "cutting edges" }) : void +>foo1 : ({ name: nameA = "" }?: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2({ name: "Edger", skill: "cutting edges" }) : void +>foo2 : ({ name: nameB = "", skill: skillB = "noSkill" }?: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ name = "" }?: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3({ name: "Edger", skill: "cutting edges" }) : void +>foo3 : ({ name = "" }?: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js new file mode 100644 index 00000000000..faa7b8dcde9 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js @@ -0,0 +1,62 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA]: Robot) { + console.log(nameA); +} + +function foo2([numberB]: Robot) { + console.log(numberB); +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { + console.log(nameA2); +} + +function foo4([numberA3, ...robotAInfo]: Robot) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +function foo1(_a) { + var nameA = _a[1]; + console.log(nameA); +} +function foo2(_a) { + var numberB = _a[0]; + console.log(numberB); +} +function foo3(_a) { + var numberA2 = _a[0], nameA2 = _a[1], skillA2 = _a[2]; + console.log(nameA2); +} +function foo4(_a) { + var numberA3 = _a[0], robotAInfo = _a.slice(1); + console.log(robotAInfo); +} +foo1(robotA); +foo1([2, "trimmer", "trimming"]); +foo2(robotA); +foo2([2, "trimmer", "trimming"]); +foo3(robotA); +foo3([2, "trimmer", "trimming"]); +foo4(robotA); +foo4([2, "trimmer", "trimming"]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js.map new file mode 100644 index 00000000000..246a2da30a4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPattern.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE3C,cAAc,EAAgB;QAAb,aAAK;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,cAAc,EAAgB;QAAf,eAAO;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,cAAc,EAAkC;QAAjC,gBAAQ,EAAE,cAAM,EAAE,eAAO;IACpC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAAgC;QAA/B,gBAAQ,EAAE,wBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..098cb5058a1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.sourcemap.txt @@ -0,0 +1,558 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, nameA]: Robot +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 31) + SourceIndex(0) +--- +>>> var nameA = _a[1]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > nameA +1->Emitted(3, 9) Source(7, 18) + SourceIndex(0) +2 >Emitted(3, 22) Source(7, 23) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 22) Source(8, 22) + SourceIndex(0) +7 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +8 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [numberB]: Robot +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 31) + SourceIndex(0) +--- +>>> var numberB = _a[0]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > numberB +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 24) Source(11, 23) + SourceIndex(0) +--- +>>> console.log(numberB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1->Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +7 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +8 >Emitted(8, 26) Source(12, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [numberA2, nameA2, skillA2]: Robot +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(15, 49) + SourceIndex(0) +--- +>>> var numberA2 = _a[0], nameA2 = _a[1], skillA2 = _a[2]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +1-> +2 > numberA2 +3 > , +4 > nameA2 +5 > , +6 > skillA2 +1->Emitted(11, 9) Source(15, 16) + SourceIndex(0) +2 >Emitted(11, 25) Source(15, 24) + SourceIndex(0) +3 >Emitted(11, 27) Source(15, 26) + SourceIndex(0) +4 >Emitted(11, 41) Source(15, 32) + SourceIndex(0) +5 >Emitted(11, 43) Source(15, 34) + SourceIndex(0) +6 >Emitted(11, 58) Source(15, 41) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(12, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(16, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(17, 2) + SourceIndex(0) +--- +>>>function foo4(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo4( +3 > [numberA3, ...robotAInfo]: Robot +1->Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(14, 17) Source(19, 47) + SourceIndex(0) +--- +>>> var numberA3 = _a[0], robotAInfo = _a.slice(1); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberA3 +3 > , +4 > ...robotAInfo +1->Emitted(15, 9) Source(19, 16) + SourceIndex(0) +2 >Emitted(15, 25) Source(19, 24) + SourceIndex(0) +3 >Emitted(15, 27) Source(19, 26) + SourceIndex(0) +4 >Emitted(15, 51) Source(19, 39) + SourceIndex(0) +--- +>>> console.log(robotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > robotAInfo +7 > ) +8 > ; +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(16, 27) Source(20, 27) + SourceIndex(0) +7 >Emitted(16, 28) Source(20, 28) + SourceIndex(0) +8 >Emitted(16, 29) Source(20, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(18, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(19, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(24, 7) + SourceIndex(0) +5 >Emitted(19, 8) Source(24, 8) + SourceIndex(0) +6 >Emitted(19, 10) Source(24, 10) + SourceIndex(0) +7 >Emitted(19, 19) Source(24, 19) + SourceIndex(0) +8 >Emitted(19, 21) Source(24, 21) + SourceIndex(0) +9 >Emitted(19, 31) Source(24, 31) + SourceIndex(0) +10>Emitted(19, 32) Source(24, 32) + SourceIndex(0) +11>Emitted(19, 33) Source(24, 33) + SourceIndex(0) +12>Emitted(19, 34) Source(24, 34) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(20, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(20, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(20, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(20, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(21, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(21, 7) Source(27, 7) + SourceIndex(0) +5 >Emitted(21, 8) Source(27, 8) + SourceIndex(0) +6 >Emitted(21, 10) Source(27, 10) + SourceIndex(0) +7 >Emitted(21, 19) Source(27, 19) + SourceIndex(0) +8 >Emitted(21, 21) Source(27, 21) + SourceIndex(0) +9 >Emitted(21, 31) Source(27, 31) + SourceIndex(0) +10>Emitted(21, 32) Source(27, 32) + SourceIndex(0) +11>Emitted(21, 33) Source(27, 33) + SourceIndex(0) +12>Emitted(21, 34) Source(27, 34) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(22, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(22, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(22, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(22, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(22, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(23, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(23, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(23, 7) Source(30, 7) + SourceIndex(0) +5 >Emitted(23, 8) Source(30, 8) + SourceIndex(0) +6 >Emitted(23, 10) Source(30, 10) + SourceIndex(0) +7 >Emitted(23, 19) Source(30, 19) + SourceIndex(0) +8 >Emitted(23, 21) Source(30, 21) + SourceIndex(0) +9 >Emitted(23, 31) Source(30, 31) + SourceIndex(0) +10>Emitted(23, 32) Source(30, 32) + SourceIndex(0) +11>Emitted(23, 33) Source(30, 33) + SourceIndex(0) +12>Emitted(23, 34) Source(30, 34) + SourceIndex(0) +--- +>>>foo4(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo4 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(24, 6) Source(32, 6) + SourceIndex(0) +4 >Emitted(24, 12) Source(32, 12) + SourceIndex(0) +5 >Emitted(24, 13) Source(32, 13) + SourceIndex(0) +6 >Emitted(24, 14) Source(32, 14) + SourceIndex(0) +--- +>>>foo4([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo4 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +4 >Emitted(25, 7) Source(33, 7) + SourceIndex(0) +5 >Emitted(25, 8) Source(33, 8) + SourceIndex(0) +6 >Emitted(25, 10) Source(33, 10) + SourceIndex(0) +7 >Emitted(25, 19) Source(33, 19) + SourceIndex(0) +8 >Emitted(25, 21) Source(33, 21) + SourceIndex(0) +9 >Emitted(25, 31) Source(33, 31) + SourceIndex(0) +10>Emitted(25, 32) Source(33, 32) + SourceIndex(0) +11>Emitted(25, 33) Source(33, 33) + SourceIndex(0) +12>Emitted(25, 34) Source(33, 34) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.symbols new file mode 100644 index 00000000000..a1370b132c2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + +function foo1([, nameA]: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 43)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 6, 16)) +} + +function foo2([numberB]: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 8, 1)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 10, 15)) +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 12, 1)) +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 15)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 24)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 32)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 14, 24)) +} + +function foo4([numberA3, ...robotAInfo]: Robot) { +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 16, 1)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 18, 15)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 18, 24)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 2, 1)) + + console.log(robotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 0, 22)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 18, 24)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 43)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo1([2, "trimmer", "trimming"]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 43)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo2([2, "trimmer", "trimming"]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo3([2, "trimmer", "trimming"]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 12, 1)) + +foo4(robotA); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 16, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 4, 3)) + +foo4([2, "trimmer", "trimming"]); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern.ts, 16, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types new file mode 100644 index 00000000000..9c695f1c0dd --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types @@ -0,0 +1,127 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function foo1([, nameA]: Robot) { +>foo1 : ([, nameA]: [number, string, string]) => void +> : undefined +>nameA : string +>Robot : [number, string, string] + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} + +function foo2([numberB]: Robot) { +>foo2 : ([numberB]: [number, string, string]) => void +>numberB : number +>Robot : [number, string, string] + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { +>foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void +>numberA2 : number +>nameA2 : string +>skillA2 : string +>Robot : [number, string, string] + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} + +function foo4([numberA3, ...robotAInfo]: Robot) { +>foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void +>numberA3 : number +>robotAInfo : (number | string)[] +>Robot : [number, string, string] + + console.log(robotAInfo); +>console.log(robotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>robotAInfo : (number | string)[] +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, nameA]: [number, string, string]) => void +>robotA : [number, string, string] + +foo1([2, "trimmer", "trimming"]); +>foo1([2, "trimmer", "trimming"]) : void +>foo1 : ([, nameA]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([numberB]: [number, string, string]) => void +>robotA : [number, string, string] + +foo2([2, "trimmer", "trimming"]); +>foo2([2, "trimmer", "trimming"]) : void +>foo2 : ([numberB]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void +>robotA : [number, string, string] + +foo3([2, "trimmer", "trimming"]); +>foo3([2, "trimmer", "trimming"]) : void +>foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo4(robotA); +>foo4(robotA) : void +>foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void +>robotA : [number, string, string] + +foo4([2, "trimmer", "trimming"]); +>foo4([2, "trimmer", "trimming"]) : void +>foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js new file mode 100644 index 00000000000..0aa302e0990 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js @@ -0,0 +1,62 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [string, [string, string]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA]: Robot) { + console.log(skillA); +} + +function foo2([nameMB]: Robot) { + console.log(nameMB); +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + console.log(nameMA); +} + +function foo4([...multiRobotAInfo]: Robot) { + console.log(multiRobotAInfo); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); + +foo4(robotA); +foo4(["roomba", ["vaccum", "mopping"]]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPattern2.js] +var robotA = ["trimmer", ["trimming", "edging"]]; +function foo1(_a) { + var skillA = _a[1]; + console.log(skillA); +} +function foo2(_a) { + var nameMB = _a[0]; + console.log(nameMB); +} +function foo3(_a) { + var nameMA = _a[0], _b = _a[1], primarySkillA = _b[0], secondarySkillA = _b[1]; + console.log(nameMA); +} +function foo4(_a) { + var multiRobotAInfo = _a.slice(0); + console.log(multiRobotAInfo); +} +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); +foo4(robotA); +foo4(["roomba", ["vaccum", "mopping"]]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map new file mode 100644 index 00000000000..b242ccd9114 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPattern2.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAExD,cAAc,EAAiB;QAAd,cAAM;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAAe;QAAd,cAAM;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAAiD;QAAhD,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IAClD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAA2B;QAA1B,6BAAkB;IAC7B,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..491e5025ecd --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,588 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var robotA = ["trimmer", ["trimming", "edging"]]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [string, [string, string]]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 24) Source(5, 31) + SourceIndex(0) +7 >Emitted(1, 26) Source(5, 33) + SourceIndex(0) +8 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +9 >Emitted(1, 37) Source(5, 44) + SourceIndex(0) +10>Emitted(1, 39) Source(5, 46) + SourceIndex(0) +11>Emitted(1, 47) Source(5, 54) + SourceIndex(0) +12>Emitted(1, 48) Source(5, 55) + SourceIndex(0) +13>Emitted(1, 49) Source(5, 56) + SourceIndex(0) +14>Emitted(1, 50) Source(5, 57) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, skillA]: Robot +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 32) + SourceIndex(0) +--- +>>> var skillA = _a[1]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > skillA +1->Emitted(3, 9) Source(7, 18) + SourceIndex(0) +2 >Emitted(3, 23) Source(7, 24) + SourceIndex(0) +--- +>>> console.log(skillA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > ) +8 > ; +1->Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +8 >Emitted(4, 25) Source(8, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [nameMB]: Robot +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 30) + SourceIndex(0) +--- +>>> var nameMB = _a[0]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^^-> +1-> +2 > nameMB +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 23) Source(11, 22) + SourceIndex(0) +--- +>>> console.log(nameMB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1->]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMB +7 > ) +8 > ; +1->Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(12, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [nameMA, [primarySkillA, secondarySkillA]]: Robot +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(15, 64) + SourceIndex(0) +--- +>>> var nameMA = _a[0], _b = _a[1], primarySkillA = _b[0], secondarySkillA = _b[1]; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameMA +3 > , +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +1->Emitted(11, 9) Source(15, 16) + SourceIndex(0) +2 >Emitted(11, 23) Source(15, 22) + SourceIndex(0) +3 >Emitted(11, 25) Source(15, 24) + SourceIndex(0) +4 >Emitted(11, 35) Source(15, 56) + SourceIndex(0) +5 >Emitted(11, 37) Source(15, 25) + SourceIndex(0) +6 >Emitted(11, 58) Source(15, 38) + SourceIndex(0) +7 >Emitted(11, 60) Source(15, 40) + SourceIndex(0) +8 >Emitted(11, 83) Source(15, 55) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(16, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(17, 2) + SourceIndex(0) +--- +>>>function foo4(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo4( +3 > [...multiRobotAInfo]: Robot +1->Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(14, 17) Source(19, 42) + SourceIndex(0) +--- +>>> var multiRobotAInfo = _a.slice(0); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > ...multiRobotAInfo +1->Emitted(15, 9) Source(19, 16) + SourceIndex(0) +2 >Emitted(15, 38) Source(19, 34) + SourceIndex(0) +--- +>>> console.log(multiRobotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > multiRobotAInfo +7 > ) +8 > ; +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(16, 32) Source(20, 32) + SourceIndex(0) +7 >Emitted(16, 33) Source(20, 33) + SourceIndex(0) +8 >Emitted(16, 34) Source(20, 34) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(18, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(19, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(24, 7) + SourceIndex(0) +5 >Emitted(19, 15) Source(24, 15) + SourceIndex(0) +6 >Emitted(19, 17) Source(24, 17) + SourceIndex(0) +7 >Emitted(19, 18) Source(24, 18) + SourceIndex(0) +8 >Emitted(19, 26) Source(24, 26) + SourceIndex(0) +9 >Emitted(19, 28) Source(24, 28) + SourceIndex(0) +10>Emitted(19, 37) Source(24, 37) + SourceIndex(0) +11>Emitted(19, 38) Source(24, 38) + SourceIndex(0) +12>Emitted(19, 39) Source(24, 39) + SourceIndex(0) +13>Emitted(19, 40) Source(24, 40) + SourceIndex(0) +14>Emitted(19, 41) Source(24, 41) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(20, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(20, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(20, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(20, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(21, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(21, 7) Source(27, 7) + SourceIndex(0) +5 >Emitted(21, 15) Source(27, 15) + SourceIndex(0) +6 >Emitted(21, 17) Source(27, 17) + SourceIndex(0) +7 >Emitted(21, 18) Source(27, 18) + SourceIndex(0) +8 >Emitted(21, 26) Source(27, 26) + SourceIndex(0) +9 >Emitted(21, 28) Source(27, 28) + SourceIndex(0) +10>Emitted(21, 37) Source(27, 37) + SourceIndex(0) +11>Emitted(21, 38) Source(27, 38) + SourceIndex(0) +12>Emitted(21, 39) Source(27, 39) + SourceIndex(0) +13>Emitted(21, 40) Source(27, 40) + SourceIndex(0) +14>Emitted(21, 41) Source(27, 41) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(22, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(22, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(22, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(22, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(22, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(23, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(23, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(23, 7) Source(30, 7) + SourceIndex(0) +5 >Emitted(23, 15) Source(30, 15) + SourceIndex(0) +6 >Emitted(23, 17) Source(30, 17) + SourceIndex(0) +7 >Emitted(23, 18) Source(30, 18) + SourceIndex(0) +8 >Emitted(23, 26) Source(30, 26) + SourceIndex(0) +9 >Emitted(23, 28) Source(30, 28) + SourceIndex(0) +10>Emitted(23, 37) Source(30, 37) + SourceIndex(0) +11>Emitted(23, 38) Source(30, 38) + SourceIndex(0) +12>Emitted(23, 39) Source(30, 39) + SourceIndex(0) +13>Emitted(23, 40) Source(30, 40) + SourceIndex(0) +14>Emitted(23, 41) Source(30, 41) + SourceIndex(0) +--- +>>>foo4(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo4 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(24, 6) Source(32, 6) + SourceIndex(0) +4 >Emitted(24, 12) Source(32, 12) + SourceIndex(0) +5 >Emitted(24, 13) Source(32, 13) + SourceIndex(0) +6 >Emitted(24, 14) Source(32, 14) + SourceIndex(0) +--- +>>>foo4(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo4 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +4 >Emitted(25, 7) Source(33, 7) + SourceIndex(0) +5 >Emitted(25, 15) Source(33, 15) + SourceIndex(0) +6 >Emitted(25, 17) Source(33, 17) + SourceIndex(0) +7 >Emitted(25, 18) Source(33, 18) + SourceIndex(0) +8 >Emitted(25, 26) Source(33, 26) + SourceIndex(0) +9 >Emitted(25, 28) Source(33, 28) + SourceIndex(0) +10>Emitted(25, 37) Source(33, 37) + SourceIndex(0) +11>Emitted(25, 38) Source(33, 38) + SourceIndex(0) +12>Emitted(25, 39) Source(33, 39) + SourceIndex(0) +13>Emitted(25, 40) Source(33, 40) + SourceIndex(0) +14>Emitted(25, 41) Source(33, 41) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.symbols new file mode 100644 index 00000000000..26797210f4b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.symbols @@ -0,0 +1,93 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 1, 8)) +} +type Robot = [string, [string, string]]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + +function foo1([, skillA]: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(skillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 6, 16)) +} + +function foo2([nameMB]: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 8, 1)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(nameMB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 10, 15)) +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 12, 1)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 15)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 24)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 38)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 14, 15)) +} + +function foo4([...multiRobotAInfo]: Robot) { +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 16, 1)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 18, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 2, 1)) + + console.log(multiRobotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 0, 22)) +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 18, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 56)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 56)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 12, 1)) + +foo4(robotA); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 16, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 4, 3)) + +foo4(["roomba", ["vaccum", "mopping"]]); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPattern2.ts, 16, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types new file mode 100644 index 00000000000..b3e09d962c3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types @@ -0,0 +1,131 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [string, [string, string]]; +>Robot : [string, [string, string]] + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : [string, [string, string]] +>Robot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +function foo1([, skillA]: Robot) { +>foo1 : ([, skillA]: [string, [string, string]]) => void +> : undefined +>skillA : [string, string] +>Robot : [string, [string, string]] + + console.log(skillA); +>console.log(skillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillA : [string, string] +} + +function foo2([nameMB]: Robot) { +>foo2 : ([nameMB]: [string, [string, string]]) => void +>nameMB : string +>Robot : [string, [string, string]] + + console.log(nameMB); +>console.log(nameMB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMB : string +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>Robot : [string, [string, string]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +function foo4([...multiRobotAInfo]: Robot) { +>foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void +>multiRobotAInfo : (string | [string, string])[] +>Robot : [string, [string, string]] + + console.log(multiRobotAInfo); +>console.log(multiRobotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>multiRobotAInfo : (string | [string, string])[] +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, skillA]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1(["roomba", ["vaccum", "mopping"]]) : void +>foo1 : ([, skillA]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([nameMB]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2(["roomba", ["vaccum", "mopping"]]) : void +>foo2 : ([nameMB]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3(["roomba", ["vaccum", "mopping"]]) : void +>foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +foo4(robotA); +>foo4(robotA) : void +>foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void +>robotA : [string, [string, string]] + +foo4(["roomba", ["vaccum", "mopping"]]); +>foo4(["roomba", ["vaccum", "mopping"]]) : void +>foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..327791a6416 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js @@ -0,0 +1,62 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + console.log(nameA); +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + console.log(numberB); +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + console.log(nameA2); +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +function foo1(_a) { + var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[1], nameA = _c === void 0 ? "noName" : _c; + console.log(nameA); +} +function foo2(_a) { + var _b = (_a === void 0 ? [-1, "name", "skill"] : _a)[0], numberB = _b === void 0 ? -1 : _b; + console.log(numberB); +} +function foo3(_a) { + var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA2 = _c === void 0 ? -1 : _c, _d = _b[1], nameA2 = _d === void 0 ? "name" : _d, _e = _b[2], skillA2 = _e === void 0 ? "skill" : _e; + console.log(nameA2); +} +function foo4(_a) { + var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA3 = _c === void 0 ? -1 : _c, robotAInfo = _b.slice(1); + console.log(robotAInfo); +} +foo1(robotA); +foo1([2, "trimmer", "trimming"]); +foo2(robotA); +foo2([2, "trimmer", "trimming"]); +foo3(robotA); +foo3([2, "trimmer", "trimming"]); +foo4(robotA); +foo4([2, "trimmer", "trimming"]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..7fdda34358b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE3C,cAAc,EAAmD;QAAnD,+CAAmD,EAAhD,UAAgB,EAAhB,qCAAgB;IAC7B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,cAAc,EAA6C;QAA5C,oDAAY,EAAZ,iCAAY;IACvB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AAED,cAAc,EAAkF;QAAlF,+CAAkF,EAAjF,UAAa,EAAb,kCAAa,EAAE,UAAe,EAAf,oCAAe,EAAE,UAAiB,EAAjB,sCAAiB;IAC5D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAA6D;QAA7D,+CAA6D,EAA5D,UAAa,EAAb,kCAAa,EAAE,wBAAa;IACvC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..250d7ec2931 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,610 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, nameA = "noName"]: Robot = [-1, "name", "skill"] +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 66) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[1], nameA = _c === void 0 ? "noName" : _c; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, nameA = "noName"]: Robot = [-1, "name", "skill"] +3 > +4 > nameA = "noName" +5 > +6 > nameA = "noName" +1->Emitted(3, 9) Source(7, 15) + SourceIndex(0) +2 >Emitted(3, 56) Source(7, 66) + SourceIndex(0) +3 >Emitted(3, 58) Source(7, 18) + SourceIndex(0) +4 >Emitted(3, 68) Source(7, 34) + SourceIndex(0) +5 >Emitted(3, 70) Source(7, 18) + SourceIndex(0) +6 >Emitted(3, 107) Source(7, 34) + SourceIndex(0) +--- +>>> console.log(nameA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 22) Source(8, 22) + SourceIndex(0) +7 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +8 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [numberB = -1]: Robot = [-1, "name", "skill"] +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 60) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? [-1, "name", "skill"] : _a)[0], numberB = _b === void 0 ? -1 : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > numberB = -1 +3 > +4 > numberB = -1 +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 61) Source(11, 28) + SourceIndex(0) +3 >Emitted(7, 63) Source(11, 16) + SourceIndex(0) +4 >Emitted(7, 96) Source(11, 28) + SourceIndex(0) +--- +>>> console.log(numberB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > numberB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +7 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +8 >Emitted(8, 26) Source(12, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"] +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(15, 97) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA2 = _c === void 0 ? -1 : _c, _d = _b[1], nameA2 = _d === void 0 ? "name" : _d, _e = _b[2], skillA2 = _e === void 0 ? "skill" : _e; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"] +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "name" +9 > +10> nameA2 = "name" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +1->Emitted(11, 9) Source(15, 15) + SourceIndex(0) +2 >Emitted(11, 56) Source(15, 97) + SourceIndex(0) +3 >Emitted(11, 58) Source(15, 16) + SourceIndex(0) +4 >Emitted(11, 68) Source(15, 29) + SourceIndex(0) +5 >Emitted(11, 70) Source(15, 16) + SourceIndex(0) +6 >Emitted(11, 104) Source(15, 29) + SourceIndex(0) +7 >Emitted(11, 106) Source(15, 31) + SourceIndex(0) +8 >Emitted(11, 116) Source(15, 46) + SourceIndex(0) +9 >Emitted(11, 118) Source(15, 31) + SourceIndex(0) +10>Emitted(11, 154) Source(15, 46) + SourceIndex(0) +11>Emitted(11, 156) Source(15, 48) + SourceIndex(0) +12>Emitted(11, 166) Source(15, 65) + SourceIndex(0) +13>Emitted(11, 168) Source(15, 48) + SourceIndex(0) +14>Emitted(11, 206) Source(15, 65) + SourceIndex(0) +--- +>>> console.log(nameA2); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA2 +7 > ) +8 > ; +1 >Emitted(12, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(16, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(17, 2) + SourceIndex(0) +--- +>>>function foo4(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo4( +3 > [numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"] +1->Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 15) Source(19, 15) + SourceIndex(0) +3 >Emitted(14, 17) Source(19, 76) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? [-1, "name", "skill"] : _a, _c = _b[0], numberA3 = _c === void 0 ? -1 : _c, robotAInfo = _b.slice(1); +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"] +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +1->Emitted(15, 9) Source(19, 15) + SourceIndex(0) +2 >Emitted(15, 56) Source(19, 76) + SourceIndex(0) +3 >Emitted(15, 58) Source(19, 16) + SourceIndex(0) +4 >Emitted(15, 68) Source(19, 29) + SourceIndex(0) +5 >Emitted(15, 70) Source(19, 16) + SourceIndex(0) +6 >Emitted(15, 104) Source(19, 29) + SourceIndex(0) +7 >Emitted(15, 106) Source(19, 31) + SourceIndex(0) +8 >Emitted(15, 130) Source(19, 44) + SourceIndex(0) +--- +>>> console.log(robotAInfo); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = [-1, "name", "skill"]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > robotAInfo +7 > ) +8 > ; +1 >Emitted(16, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(16, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(16, 13) Source(20, 13) + SourceIndex(0) +4 >Emitted(16, 16) Source(20, 16) + SourceIndex(0) +5 >Emitted(16, 17) Source(20, 17) + SourceIndex(0) +6 >Emitted(16, 27) Source(20, 27) + SourceIndex(0) +7 >Emitted(16, 28) Source(20, 28) + SourceIndex(0) +8 >Emitted(16, 29) Source(20, 29) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(17, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(17, 2) Source(21, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(18, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(23, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(23, 14) + SourceIndex(0) +--- +>>>foo1([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(19, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(24, 7) + SourceIndex(0) +5 >Emitted(19, 8) Source(24, 8) + SourceIndex(0) +6 >Emitted(19, 10) Source(24, 10) + SourceIndex(0) +7 >Emitted(19, 19) Source(24, 19) + SourceIndex(0) +8 >Emitted(19, 21) Source(24, 21) + SourceIndex(0) +9 >Emitted(19, 31) Source(24, 31) + SourceIndex(0) +10>Emitted(19, 32) Source(24, 32) + SourceIndex(0) +11>Emitted(19, 33) Source(24, 33) + SourceIndex(0) +12>Emitted(19, 34) Source(24, 34) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(20, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(20, 12) Source(26, 12) + SourceIndex(0) +5 >Emitted(20, 13) Source(26, 13) + SourceIndex(0) +6 >Emitted(20, 14) Source(26, 14) + SourceIndex(0) +--- +>>>foo2([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(21, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(21, 7) Source(27, 7) + SourceIndex(0) +5 >Emitted(21, 8) Source(27, 8) + SourceIndex(0) +6 >Emitted(21, 10) Source(27, 10) + SourceIndex(0) +7 >Emitted(21, 19) Source(27, 19) + SourceIndex(0) +8 >Emitted(21, 21) Source(27, 21) + SourceIndex(0) +9 >Emitted(21, 31) Source(27, 31) + SourceIndex(0) +10>Emitted(21, 32) Source(27, 32) + SourceIndex(0) +11>Emitted(21, 33) Source(27, 33) + SourceIndex(0) +12>Emitted(21, 34) Source(27, 34) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(22, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(22, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(22, 12) Source(29, 12) + SourceIndex(0) +5 >Emitted(22, 13) Source(29, 13) + SourceIndex(0) +6 >Emitted(22, 14) Source(29, 14) + SourceIndex(0) +--- +>>>foo3([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(23, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(30, 5) + SourceIndex(0) +3 >Emitted(23, 6) Source(30, 6) + SourceIndex(0) +4 >Emitted(23, 7) Source(30, 7) + SourceIndex(0) +5 >Emitted(23, 8) Source(30, 8) + SourceIndex(0) +6 >Emitted(23, 10) Source(30, 10) + SourceIndex(0) +7 >Emitted(23, 19) Source(30, 19) + SourceIndex(0) +8 >Emitted(23, 21) Source(30, 21) + SourceIndex(0) +9 >Emitted(23, 31) Source(30, 31) + SourceIndex(0) +10>Emitted(23, 32) Source(30, 32) + SourceIndex(0) +11>Emitted(23, 33) Source(30, 33) + SourceIndex(0) +12>Emitted(23, 34) Source(30, 34) + SourceIndex(0) +--- +>>>foo4(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo4 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(24, 6) Source(32, 6) + SourceIndex(0) +4 >Emitted(24, 12) Source(32, 12) + SourceIndex(0) +5 >Emitted(24, 13) Source(32, 13) + SourceIndex(0) +6 >Emitted(24, 14) Source(32, 14) + SourceIndex(0) +--- +>>>foo4([2, "trimmer", "trimming"]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo4 +3 > ( +4 > [ +5 > 2 +6 > , +7 > "trimmer" +8 > , +9 > "trimming" +10> ] +11> ) +12> ; +1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(25, 6) Source(33, 6) + SourceIndex(0) +4 >Emitted(25, 7) Source(33, 7) + SourceIndex(0) +5 >Emitted(25, 8) Source(33, 8) + SourceIndex(0) +6 >Emitted(25, 10) Source(33, 10) + SourceIndex(0) +7 >Emitted(25, 19) Source(33, 19) + SourceIndex(0) +8 >Emitted(25, 21) Source(33, 21) + SourceIndex(0) +9 >Emitted(25, 31) Source(33, 31) + SourceIndex(0) +10>Emitted(25, 32) Source(33, 32) + SourceIndex(0) +11>Emitted(25, 33) Source(33, 33) + SourceIndex(0) +12>Emitted(25, 34) Source(33, 34) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..e3502b769a8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 43)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 6, 16)) +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 8, 1)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(numberB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 10, 15)) +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 12, 1)) +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 15)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 29)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 46)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(nameA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 14, 29)) +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 16, 1)) +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 18, 15)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 18, 29)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 2, 1)) + + console.log(robotAInfo); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 0, 22)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 18, 29)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 43)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo1([2, "trimmer", "trimming"]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 43)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo2([2, "trimmer", "trimming"]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo3([2, "trimmer", "trimming"]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 12, 1)) + +foo4(robotA); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 16, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 4, 3)) + +foo4([2, "trimmer", "trimming"]); +>foo4 : Symbol(foo4, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts, 16, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..8e12e876b1d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types @@ -0,0 +1,156 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { +>foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +> : undefined +>nameA : string +>"noName" : string +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA : string +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { +>foo2 : ([numberB = -1]?: [number, string, string]) => void +>numberB : number +>-1 : number +>1 : number +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(numberB); +>console.log(numberB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>numberB : number +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { +>foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"name" : string +>skillA2 : string +>"skill" : string +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(nameA2); +>console.log(nameA2) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameA2 : string +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { +>foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>Robot : [number, string, string] +>[-1, "name", "skill"] : [number, string, string] +>-1 : number +>1 : number +>"name" : string +>"skill" : string + + console.log(robotAInfo); +>console.log(robotAInfo) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>robotAInfo : (number | string)[] +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo1([2, "trimmer", "trimming"]); +>foo1([2, "trimmer", "trimming"]) : void +>foo1 : ([, nameA = "noName"]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([numberB = -1]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo2([2, "trimmer", "trimming"]); +>foo2([2, "trimmer", "trimming"]) : void +>foo2 : ([numberB = -1]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo3([2, "trimmer", "trimming"]); +>foo3([2, "trimmer", "trimming"]) : void +>foo3 : ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +foo4(robotA); +>foo4(robotA) : void +>foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>robotA : [number, string, string] + +foo4([2, "trimmer", "trimming"]); +>foo4([2, "trimmer", "trimming"]) : void +>foo4 : ([numberA3 = -1, ...robotAInfo]?: [number, string, string]) => void +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..81add872b0d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js @@ -0,0 +1,52 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [string, string[]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + console.log(skillA); +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + console.log(nameMB); +} + +function foo3([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: Robot) { + console.log(nameMA); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); + +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js] +var robotA = ["trimmer", ["trimming", "edging"]]; +function foo1(_a) { + var _b = _a === void 0 ? ["name", ["skill1", "skill2"]] : _a, _c = _b[1], skillA = _c === void 0 ? ["noSkill", "noSkill"] : _c; + console.log(skillA); +} +function foo2(_a) { + var _b = (_a === void 0 ? ["name", ["skill1", "skill2"]] : _a)[0], nameMB = _b === void 0 ? "noName" : _b; + console.log(nameMB); +} +function foo3(_a) { + var _b = _a[0], nameMA = _b === void 0 ? "noName" : _b, _c = _a[1], _d = _c === void 0 ? ["noSkill", "noSkill"] : _c, _e = _d[0], primarySkillA = _e === void 0 ? "primary" : _e, _f = _d[1], secondarySkillA = _f === void 0 ? "secondary" : _f; + console.log(nameMA); +} +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); +//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..a489a3e41bf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAExD,cAAc,EAA0E;QAA1E,wDAA0E,EAAvE,UAA+B,EAA/B,oDAA+B;IAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAA2D;QAA1D,6DAAiB,EAAjB,sCAAiB;IAC5B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,cAAc,EAGoB;QAHnB,UAAiB,EAAjB,sCAAiB,EAAE,UAGR,EAHQ,gDAGR,EAFtB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAExC,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..28f94da65a1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,512 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var robotA = ["trimmer", ["trimming", "edging"]]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [string, string[]]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 24) Source(5, 31) + SourceIndex(0) +7 >Emitted(1, 26) Source(5, 33) + SourceIndex(0) +8 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +9 >Emitted(1, 37) Source(5, 44) + SourceIndex(0) +10>Emitted(1, 39) Source(5, 46) + SourceIndex(0) +11>Emitted(1, 47) Source(5, 54) + SourceIndex(0) +12>Emitted(1, 48) Source(5, 55) + SourceIndex(0) +13>Emitted(1, 49) Source(5, 56) + SourceIndex(0) +14>Emitted(1, 50) Source(5, 57) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > [, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]] +1 >Emitted(2, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(2, 15) Source(7, 15) + SourceIndex(0) +3 >Emitted(2, 17) Source(7, 89) + SourceIndex(0) +--- +>>> var _b = _a === void 0 ? ["name", ["skill1", "skill2"]] : _a, _c = _b[1], skillA = _c === void 0 ? ["noSkill", "noSkill"] : _c; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > [, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]] +3 > +4 > skillA = ["noSkill", "noSkill"] +5 > +6 > skillA = ["noSkill", "noSkill"] +1->Emitted(3, 9) Source(7, 15) + SourceIndex(0) +2 >Emitted(3, 65) Source(7, 89) + SourceIndex(0) +3 >Emitted(3, 67) Source(7, 18) + SourceIndex(0) +4 >Emitted(3, 77) Source(7, 49) + SourceIndex(0) +5 >Emitted(3, 79) Source(7, 18) + SourceIndex(0) +6 >Emitted(3, 131) Source(7, 49) + SourceIndex(0) +--- +>>> console.log(skillA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot= ["name", ["skill1", "skill2"]]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > ) +8 > ; +1 >Emitted(4, 5) Source(8, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(8, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(8, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(8, 17) + SourceIndex(0) +6 >Emitted(4, 23) Source(8, 23) + SourceIndex(0) +7 >Emitted(4, 24) Source(8, 24) + SourceIndex(0) +8 >Emitted(4, 25) Source(8, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(9, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo2( +3 > [nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]] +1->Emitted(6, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(6, 17) Source(11, 74) + SourceIndex(0) +--- +>>> var _b = (_a === void 0 ? ["name", ["skill1", "skill2"]] : _a)[0], nameMB = _b === void 0 ? "noName" : _b; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameMB = "noName" +3 > +4 > nameMB = "noName" +1->Emitted(7, 9) Source(11, 16) + SourceIndex(0) +2 >Emitted(7, 70) Source(11, 33) + SourceIndex(0) +3 >Emitted(7, 72) Source(11, 16) + SourceIndex(0) +4 >Emitted(7, 110) Source(11, 33) + SourceIndex(0) +--- +>>> console.log(nameMB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 >]: Robot = ["name", ["skill1", "skill2"]]) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMB +7 > ) +8 > ; +1 >Emitted(8, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(12, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(12, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(12, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >function foo3( +3 > [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["noSkill", "noSkill"]]: Robot +1->Emitted(10, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(10, 15) Source(15, 15) + SourceIndex(0) +3 >Emitted(10, 17) Source(18, 35) + SourceIndex(0) +--- +>>> var _b = _a[0], nameMA = _b === void 0 ? "noName" : _b, _c = _a[1], _d = _c === void 0 ? ["noSkill", "noSkill"] : _c, _e = _d[0], primarySkillA = _e === void 0 ? "primary" : _e, _f = _d[1], secondarySkillA = _f === void 0 ? "secondary" : _f; +1->^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1-> +2 > nameMA = "noName" +3 > +4 > nameMA = "noName" +5 > , +6 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["noSkill", "noSkill"] +7 > +8 > [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + > ] = ["noSkill", "noSkill"] +9 > +10> primarySkillA = "primary" +11> +12> primarySkillA = "primary" +13> , + > +14> secondarySkillA = "secondary" +15> +16> secondarySkillA = "secondary" +1->Emitted(11, 9) Source(15, 16) + SourceIndex(0) +2 >Emitted(11, 19) Source(15, 33) + SourceIndex(0) +3 >Emitted(11, 21) Source(15, 16) + SourceIndex(0) +4 >Emitted(11, 59) Source(15, 33) + SourceIndex(0) +5 >Emitted(11, 61) Source(15, 35) + SourceIndex(0) +6 >Emitted(11, 71) Source(18, 27) + SourceIndex(0) +7 >Emitted(11, 73) Source(15, 35) + SourceIndex(0) +8 >Emitted(11, 121) Source(18, 27) + SourceIndex(0) +9 >Emitted(11, 123) Source(16, 5) + SourceIndex(0) +10>Emitted(11, 133) Source(16, 30) + SourceIndex(0) +11>Emitted(11, 135) Source(16, 5) + SourceIndex(0) +12>Emitted(11, 181) Source(16, 30) + SourceIndex(0) +13>Emitted(11, 183) Source(17, 5) + SourceIndex(0) +14>Emitted(11, 193) Source(17, 34) + SourceIndex(0) +15>Emitted(11, 195) Source(17, 5) + SourceIndex(0) +16>Emitted(11, 245) Source(17, 34) + SourceIndex(0) +--- +>>> console.log(nameMA); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1 > + >] = ["noSkill", "noSkill"]]: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameMA +7 > ) +8 > ; +1 >Emitted(12, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(12, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(12, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(12, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(12, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(12, 23) Source(19, 23) + SourceIndex(0) +7 >Emitted(12, 24) Source(19, 24) + SourceIndex(0) +8 >Emitted(12, 25) Source(19, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(13, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(13, 2) Source(20, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(14, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(14, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(14, 6) Source(22, 6) + SourceIndex(0) +4 >Emitted(14, 12) Source(22, 12) + SourceIndex(0) +5 >Emitted(14, 13) Source(22, 13) + SourceIndex(0) +6 >Emitted(14, 14) Source(22, 14) + SourceIndex(0) +--- +>>>foo1(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(15, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(23, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(23, 6) + SourceIndex(0) +4 >Emitted(15, 7) Source(23, 7) + SourceIndex(0) +5 >Emitted(15, 15) Source(23, 15) + SourceIndex(0) +6 >Emitted(15, 17) Source(23, 17) + SourceIndex(0) +7 >Emitted(15, 18) Source(23, 18) + SourceIndex(0) +8 >Emitted(15, 26) Source(23, 26) + SourceIndex(0) +9 >Emitted(15, 28) Source(23, 28) + SourceIndex(0) +10>Emitted(15, 37) Source(23, 37) + SourceIndex(0) +11>Emitted(15, 38) Source(23, 38) + SourceIndex(0) +12>Emitted(15, 39) Source(23, 39) + SourceIndex(0) +13>Emitted(15, 40) Source(23, 40) + SourceIndex(0) +14>Emitted(15, 41) Source(23, 41) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(16, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(16, 12) Source(25, 12) + SourceIndex(0) +5 >Emitted(16, 13) Source(25, 13) + SourceIndex(0) +6 >Emitted(16, 14) Source(25, 14) + SourceIndex(0) +--- +>>>foo2(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(26, 6) + SourceIndex(0) +4 >Emitted(17, 7) Source(26, 7) + SourceIndex(0) +5 >Emitted(17, 15) Source(26, 15) + SourceIndex(0) +6 >Emitted(17, 17) Source(26, 17) + SourceIndex(0) +7 >Emitted(17, 18) Source(26, 18) + SourceIndex(0) +8 >Emitted(17, 26) Source(26, 26) + SourceIndex(0) +9 >Emitted(17, 28) Source(26, 28) + SourceIndex(0) +10>Emitted(17, 37) Source(26, 37) + SourceIndex(0) +11>Emitted(17, 38) Source(26, 38) + SourceIndex(0) +12>Emitted(17, 39) Source(26, 39) + SourceIndex(0) +13>Emitted(17, 40) Source(26, 40) + SourceIndex(0) +14>Emitted(17, 41) Source(26, 41) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(18, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(28, 6) + SourceIndex(0) +4 >Emitted(18, 12) Source(28, 12) + SourceIndex(0) +5 >Emitted(18, 13) Source(28, 13) + SourceIndex(0) +6 >Emitted(18, 14) Source(28, 14) + SourceIndex(0) +--- +>>>foo3(["roomba", ["vaccum", "mopping"]]); +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > [ +5 > "roomba" +6 > , +7 > [ +8 > "vaccum" +9 > , +10> "mopping" +11> ] +12> ] +13> ) +14> ; +1->Emitted(19, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(29, 6) + SourceIndex(0) +4 >Emitted(19, 7) Source(29, 7) + SourceIndex(0) +5 >Emitted(19, 15) Source(29, 15) + SourceIndex(0) +6 >Emitted(19, 17) Source(29, 17) + SourceIndex(0) +7 >Emitted(19, 18) Source(29, 18) + SourceIndex(0) +8 >Emitted(19, 26) Source(29, 26) + SourceIndex(0) +9 >Emitted(19, 28) Source(29, 28) + SourceIndex(0) +10>Emitted(19, 37) Source(29, 37) + SourceIndex(0) +11>Emitted(19, 38) Source(29, 38) + SourceIndex(0) +12>Emitted(19, 39) Source(29, 39) + SourceIndex(0) +13>Emitted(19, 40) Source(29, 40) + SourceIndex(0) +14>Emitted(19, 41) Source(29, 41) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..923e8327e6c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,80 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type Robot = [string, string[]]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 56)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 6, 16)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + + console.log(skillA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 6, 16)) +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 8, 1)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + + console.log(nameMB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 10, 15)) +} + +function foo3([nameMA = "noName", [ +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 12, 1)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 14, 15)) + + primarySkillA = "primary", +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 14, 35)) + + secondarySkillA = "secondary" +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 15, 30)) + +] = ["noSkill", "noSkill"]]: Robot) { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 2, 1)) + + console.log(nameMA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 0, 22)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 14, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 56)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 56)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 8, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 8, 1)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 4, 3)) + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts, 12, 1)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..52423dfce21 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types @@ -0,0 +1,139 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [string, string[]]; +>Robot : [string, string[]] + +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +>robotA : [string, string[]] +>Robot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { +>foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +> : undefined +>skillA : string[] +>["noSkill", "noSkill"] : string[] +>"noSkill" : string +>"noSkill" : string +>Robot : [string, string[]] +>["name", ["skill1", "skill2"]] : [string, string[]] +>"name" : string +>["skill1", "skill2"] : string[] +>"skill1" : string +>"skill2" : string + + console.log(skillA); +>console.log(skillA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillA : string[] +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { +>foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>nameMB : string +>"noName" : string +>Robot : [string, string[]] +>["name", ["skill1", "skill2"]] : [string, string[]] +>"name" : string +>["skill1", "skill2"] : string[] +>"skill1" : string +>"skill2" : string + + console.log(nameMB); +>console.log(nameMB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMB : string +} + +function foo3([nameMA = "noName", [ +>foo3 : ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>nameMA : string +>"noName" : string + + primarySkillA = "primary", +>primarySkillA : string +>"primary" : string + + secondarySkillA = "secondary" +>secondarySkillA : string +>"secondary" : string + +] = ["noSkill", "noSkill"]]: Robot) { +>["noSkill", "noSkill"] : [string, string] +>"noSkill" : string +>"noSkill" : string +>Robot : [string, string[]] + + console.log(nameMA); +>console.log(nameMA) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>nameMA : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +>robotA : [string, string[]] + +foo1(["roomba", ["vaccum", "mopping"]]); +>foo1(["roomba", ["vaccum", "mopping"]]) : void +>foo1 : ([, skillA = ["noSkill", "noSkill"]]?: [string, string[]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>robotA : [string, string[]] + +foo2(["roomba", ["vaccum", "mopping"]]); +>foo2(["roomba", ["vaccum", "mopping"]]) : void +>foo2 : ([nameMB = "noName"]?: [string, string[]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>robotA : [string, string[]] + +foo3(["roomba", ["vaccum", "mopping"]]); +>foo3(["roomba", ["vaccum", "mopping"]]) : void +>foo3 : ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: [string, string[]]) => void +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js new file mode 100644 index 00000000000..4bd4feab384 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js @@ -0,0 +1,35 @@ +//// [sourceMapValidationDestructuringVariableStatement.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA } = robotA; +var { name: nameB, skill: skillB } = robotB; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatement.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +var robotB = { name: "trimmer", skill: "trimming" }; +var nameA = robotA.name; +var nameB = robotB.name, skillB = robotB.skill; +var _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map new file mode 100644 index 00000000000..17d9a9b0411 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatement.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatement.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,uBAAW,CAAY;AACvB,uBAAW,EAAE,qBAAa,CAAY;AAC5C,IAAA,8CAA8E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAC/E,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt new file mode 100644 index 00000000000..f066ec465cf --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt @@ -0,0 +1,313 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatement.js +mapUrl: sourceMapValidationDestructuringVariableStatement.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatement.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.js +sourceFile:sourceMapValidationDestructuringVariableStatement.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skill: "trimming" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skill +11> : +12> "trimming" +13> } +14> ; +1->Emitted(3, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(10, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(10, 21) + SourceIndex(0) +5 >Emitted(3, 16) Source(10, 23) + SourceIndex(0) +6 >Emitted(3, 20) Source(10, 27) + SourceIndex(0) +7 >Emitted(3, 22) Source(10, 29) + SourceIndex(0) +8 >Emitted(3, 31) Source(10, 38) + SourceIndex(0) +9 >Emitted(3, 33) Source(10, 40) + SourceIndex(0) +10>Emitted(3, 38) Source(10, 45) + SourceIndex(0) +11>Emitted(3, 40) Source(10, 47) + SourceIndex(0) +12>Emitted(3, 50) Source(10, 57) + SourceIndex(0) +13>Emitted(3, 52) Source(10, 59) + SourceIndex(0) +14>Emitted(3, 53) Source(10, 60) + SourceIndex(0) +--- +>>>var nameA = robotA.name; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >var { +2 >name: nameA +3 > } = robotA; +1 >Emitted(4, 1) Source(11, 7) + SourceIndex(0) +2 >Emitted(4, 24) Source(11, 18) + SourceIndex(0) +3 >Emitted(4, 25) Source(11, 30) + SourceIndex(0) +--- +>>>var nameB = robotB.name, skillB = robotB.skill; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB +3 > , +4 > skill: skillB +5 > } = robotB; +1->Emitted(5, 1) Source(12, 7) + SourceIndex(0) +2 >Emitted(5, 24) Source(12, 18) + SourceIndex(0) +3 >Emitted(5, 26) Source(12, 20) + SourceIndex(0) +4 >Emitted(5, 47) Source(12, 33) + SourceIndex(0) +5 >Emitted(5, 48) Source(12, 45) + SourceIndex(0) +--- +>>>var _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^ +1-> + > +2 > +3 > var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +4 > +5 > name: nameC +6 > , +7 > skill: skillC +8 > } = { name: "Edger", skill: "cutting edges" }; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(6, 51) Source(13, 79) + SourceIndex(0) +4 >Emitted(6, 53) Source(13, 7) + SourceIndex(0) +5 >Emitted(6, 68) Source(13, 18) + SourceIndex(0) +6 >Emitted(6, 70) Source(13, 20) + SourceIndex(0) +7 >Emitted(6, 87) Source(13, 33) + SourceIndex(0) +8 >Emitted(6, 88) Source(13, 80) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 3) Source(14, 3) + SourceIndex(0) +3 >Emitted(7, 4) Source(14, 4) + SourceIndex(0) +4 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +5 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) +6 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) +7 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) +8 >Emitted(7, 20) Source(14, 20) + SourceIndex(0) +9 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) +10>Emitted(7, 22) Source(14, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(15, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(10, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(10, 6) Source(17, 6) + SourceIndex(0) +4 >Emitted(10, 7) Source(17, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(18, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.symbols new file mode 100644 index 00000000000..3d8e925d8b3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.symbols @@ -0,0 +1,69 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatement.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 36)) + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 38)) + +var { name: nameA } = robotA; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 10, 5)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 8, 3)) + +var { name: nameB, skill: skillB } = robotB; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 5)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 18)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 9, 3)) + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 38)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 5)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 53)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 18)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 38)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 53)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement.ts, 10, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 5)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement.ts, 11, 18)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement.ts, 4, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement.ts, 12, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types new file mode 100644 index 00000000000..82a2ffe88f6 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types @@ -0,0 +1,82 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +var { name: nameA } = robotA; +>name : any +>nameA : string +>robotA : Robot + +var { name: nameB, skill: skillB } = robotB; +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillB : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js new file mode 100644 index 00000000000..cdf4451195e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js @@ -0,0 +1,49 @@ +//// [sourceMapValidationDestructuringVariableStatement1.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var a: string, { name: nameA } = robotA; +var b: string, { name: nameB, skill: skillB } = robotB; +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + +var { name: nameA } = robotA, a = hello; +var { name: nameB, skill: skillB } = robotB, b = " hello"; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + +var a = hello, { name: nameA } = robotA, a1= "hello"; +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatement1.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +var robotB = { name: "trimmer", skill: "trimming" }; +var a, nameA = robotA.name; +var b, nameB = robotB.name, skillB = robotB.skill; +var c, _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +var nameA = robotA.name, a = hello; +var nameB = robotB.name, skillB = robotB.skill, b = " hello"; +var _b = { name: "Edger", skill: "cutting edges" }, nameC = _b.name, skillC = _b.skill, c = hello; +var a = hello, nameA = robotA.name, a1 = "hello"; +var b = hello, nameB = robotB.name, skillB = robotB.skill, b1 = "hello"; +var c = hello, _c = { name: "Edger", skill: "cutting edges" }, nameC = _c.name, skillC = _c.skill, c1 = hello; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map new file mode 100644 index 00000000000..cc2ae54143d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatement1.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatement1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement1.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC3D,IAAI,CAAS,EAAI,mBAAW,CAAY;AACxC,IAAI,CAAS,EAAI,mBAAW,EAAE,qBAAa,CAAY;AACvD,IAAI,CAAS,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAEpF,uBAAW,EAAa,CAAC,GAAG,KAAK,CAAC;AAClC,uBAAW,EAAE,qBAAa,EAAa,CAAC,GAAG,QAAQ,CAAC;AAC1D,IAAA,8CAA8E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,CAAC,GAAG,KAAK,CAAC;AAE1F,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAa,EAAE,GAAE,OAAO,CAAC;AACrD,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAE,qBAAa,EAAa,EAAE,GAAG,OAAO,CAAC;AACrE,IAAI,CAAC,GAAG,KAAK,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,EAAE,GAAG,KAAK,CAAC;AACtG,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt new file mode 100644 index 00000000000..70407ad9f81 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt @@ -0,0 +1,571 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatement1.js +mapUrl: sourceMapValidationDestructuringVariableStatement1.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatement1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.js +sourceFile:sourceMapValidationDestructuringVariableStatement1.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skill: "trimming" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skill +11> : +12> "trimming" +13> } +14> ; +1->Emitted(3, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(10, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(10, 21) + SourceIndex(0) +5 >Emitted(3, 16) Source(10, 23) + SourceIndex(0) +6 >Emitted(3, 20) Source(10, 27) + SourceIndex(0) +7 >Emitted(3, 22) Source(10, 29) + SourceIndex(0) +8 >Emitted(3, 31) Source(10, 38) + SourceIndex(0) +9 >Emitted(3, 33) Source(10, 40) + SourceIndex(0) +10>Emitted(3, 38) Source(10, 45) + SourceIndex(0) +11>Emitted(3, 40) Source(10, 47) + SourceIndex(0) +12>Emitted(3, 50) Source(10, 57) + SourceIndex(0) +13>Emitted(3, 52) Source(10, 59) + SourceIndex(0) +14>Emitted(3, 53) Source(10, 60) + SourceIndex(0) +--- +>>>var a, nameA = robotA.name; +1 > +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >var +3 > a: string +4 > , { +5 > name: nameA +6 > } = robotA; +1 >Emitted(4, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(4, 6) Source(11, 14) + SourceIndex(0) +4 >Emitted(4, 8) Source(11, 18) + SourceIndex(0) +5 >Emitted(4, 27) Source(11, 29) + SourceIndex(0) +6 >Emitted(4, 28) Source(11, 41) + SourceIndex(0) +--- +>>>var b, nameB = robotB.name, skillB = robotB.skill; +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > b: string +4 > , { +5 > name: nameB +6 > , +7 > skill: skillB +8 > } = robotB; +1->Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 6) Source(12, 14) + SourceIndex(0) +4 >Emitted(5, 8) Source(12, 18) + SourceIndex(0) +5 >Emitted(5, 27) Source(12, 29) + SourceIndex(0) +6 >Emitted(5, 29) Source(12, 31) + SourceIndex(0) +7 >Emitted(5, 50) Source(12, 44) + SourceIndex(0) +8 >Emitted(5, 51) Source(12, 56) + SourceIndex(0) +--- +>>>var c, _a = { name: "Edger", skill: "cutting edges" }, nameC = _a.name, skillC = _a.skill; +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^ +10> ^ +1-> + > +2 >var +3 > c: string +4 > , +5 > { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +6 > +7 > name: nameC +8 > , +9 > skill: skillC +10> } = { name: "Edger", skill: "cutting edges" }; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 6) Source(13, 14) + SourceIndex(0) +4 >Emitted(6, 8) Source(13, 16) + SourceIndex(0) +5 >Emitted(6, 54) Source(13, 90) + SourceIndex(0) +6 >Emitted(6, 56) Source(13, 18) + SourceIndex(0) +7 >Emitted(6, 71) Source(13, 29) + SourceIndex(0) +8 >Emitted(6, 73) Source(13, 31) + SourceIndex(0) +9 >Emitted(6, 90) Source(13, 44) + SourceIndex(0) +10>Emitted(6, 91) Source(13, 91) + SourceIndex(0) +--- +>>>var nameA = robotA.name, a = hello; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^^ +6 > ^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >var { +2 >name: nameA +3 > } = robotA, +4 > a +5 > = +6 > hello +7 > ; +1 >Emitted(7, 1) Source(15, 7) + SourceIndex(0) +2 >Emitted(7, 24) Source(15, 18) + SourceIndex(0) +3 >Emitted(7, 26) Source(15, 31) + SourceIndex(0) +4 >Emitted(7, 27) Source(15, 32) + SourceIndex(0) +5 >Emitted(7, 30) Source(15, 35) + SourceIndex(0) +6 >Emitted(7, 35) Source(15, 40) + SourceIndex(0) +7 >Emitted(7, 36) Source(15, 41) + SourceIndex(0) +--- +>>>var nameB = robotB.name, skillB = robotB.skill, b = " hello"; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB +3 > , +4 > skill: skillB +5 > } = robotB, +6 > b +7 > = +8 > " hello" +9 > ; +1->Emitted(8, 1) Source(16, 7) + SourceIndex(0) +2 >Emitted(8, 24) Source(16, 18) + SourceIndex(0) +3 >Emitted(8, 26) Source(16, 20) + SourceIndex(0) +4 >Emitted(8, 47) Source(16, 33) + SourceIndex(0) +5 >Emitted(8, 49) Source(16, 46) + SourceIndex(0) +6 >Emitted(8, 50) Source(16, 47) + SourceIndex(0) +7 >Emitted(8, 53) Source(16, 50) + SourceIndex(0) +8 >Emitted(8, 61) Source(16, 58) + SourceIndex(0) +9 >Emitted(8, 62) Source(16, 59) + SourceIndex(0) +--- +>>>var _b = { name: "Edger", skill: "cutting edges" }, nameC = _b.name, skillC = _b.skill, c = hello; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^^^^^ +12> ^ +1-> + > +2 > +3 > var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +4 > +5 > name: nameC +6 > , +7 > skill: skillC +8 > } = { name: "Edger", skill: "cutting edges" }, +9 > c +10> = +11> hello +12> ; +1->Emitted(9, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(17, 1) + SourceIndex(0) +3 >Emitted(9, 51) Source(17, 79) + SourceIndex(0) +4 >Emitted(9, 53) Source(17, 7) + SourceIndex(0) +5 >Emitted(9, 68) Source(17, 18) + SourceIndex(0) +6 >Emitted(9, 70) Source(17, 20) + SourceIndex(0) +7 >Emitted(9, 87) Source(17, 33) + SourceIndex(0) +8 >Emitted(9, 89) Source(17, 81) + SourceIndex(0) +9 >Emitted(9, 90) Source(17, 82) + SourceIndex(0) +10>Emitted(9, 93) Source(17, 85) + SourceIndex(0) +11>Emitted(9, 98) Source(17, 90) + SourceIndex(0) +12>Emitted(9, 99) Source(17, 91) + SourceIndex(0) +--- +>>>var a = hello, nameA = robotA.name, a1 = "hello"; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^ +10> ^^^ +11> ^^^^^^^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >var +3 > a +4 > = +5 > hello +6 > , { +7 > name: nameA +8 > } = robotA, +9 > a1 +10> = +11> "hello" +12> ; +1 >Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(19, 5) + SourceIndex(0) +3 >Emitted(10, 6) Source(19, 6) + SourceIndex(0) +4 >Emitted(10, 9) Source(19, 9) + SourceIndex(0) +5 >Emitted(10, 14) Source(19, 14) + SourceIndex(0) +6 >Emitted(10, 16) Source(19, 18) + SourceIndex(0) +7 >Emitted(10, 35) Source(19, 29) + SourceIndex(0) +8 >Emitted(10, 37) Source(19, 42) + SourceIndex(0) +9 >Emitted(10, 39) Source(19, 44) + SourceIndex(0) +10>Emitted(10, 42) Source(19, 46) + SourceIndex(0) +11>Emitted(10, 49) Source(19, 53) + SourceIndex(0) +12>Emitted(10, 50) Source(19, 54) + SourceIndex(0) +--- +>>>var b = hello, nameB = robotB.name, skillB = robotB.skill, b1 = "hello"; +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^ +12> ^^^ +13> ^^^^^^^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > b +4 > = +5 > hello +6 > , { +7 > name: nameB +8 > , +9 > skill: skillB +10> } = robotB, +11> b1 +12> = +13> "hello" +14> ; +1->Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(20, 5) + SourceIndex(0) +3 >Emitted(11, 6) Source(20, 6) + SourceIndex(0) +4 >Emitted(11, 9) Source(20, 9) + SourceIndex(0) +5 >Emitted(11, 14) Source(20, 14) + SourceIndex(0) +6 >Emitted(11, 16) Source(20, 18) + SourceIndex(0) +7 >Emitted(11, 35) Source(20, 29) + SourceIndex(0) +8 >Emitted(11, 37) Source(20, 31) + SourceIndex(0) +9 >Emitted(11, 58) Source(20, 44) + SourceIndex(0) +10>Emitted(11, 60) Source(20, 57) + SourceIndex(0) +11>Emitted(11, 62) Source(20, 59) + SourceIndex(0) +12>Emitted(11, 65) Source(20, 62) + SourceIndex(0) +13>Emitted(11, 72) Source(20, 69) + SourceIndex(0) +14>Emitted(11, 73) Source(20, 70) + SourceIndex(0) +--- +>>>var c = hello, _c = { name: "Edger", skill: "cutting edges" }, nameC = _c.name, skillC = _c.skill, c1 = hello; +1-> +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^ +14> ^^^ +15> ^^^^^ +16> ^ +1-> + > +2 >var +3 > c +4 > = +5 > hello +6 > , +7 > { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" } +8 > +9 > name: nameC +10> , +11> skill: skillC +12> } = { name: "Edger", skill: "cutting edges" }, +13> c1 +14> = +15> hello +16> ; +1->Emitted(12, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(12, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(12, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(12, 9) Source(21, 9) + SourceIndex(0) +5 >Emitted(12, 14) Source(21, 14) + SourceIndex(0) +6 >Emitted(12, 16) Source(21, 16) + SourceIndex(0) +7 >Emitted(12, 62) Source(21, 90) + SourceIndex(0) +8 >Emitted(12, 64) Source(21, 18) + SourceIndex(0) +9 >Emitted(12, 79) Source(21, 29) + SourceIndex(0) +10>Emitted(12, 81) Source(21, 31) + SourceIndex(0) +11>Emitted(12, 98) Source(21, 44) + SourceIndex(0) +12>Emitted(12, 100) Source(21, 92) + SourceIndex(0) +13>Emitted(12, 102) Source(21, 94) + SourceIndex(0) +14>Emitted(12, 105) Source(21, 97) + SourceIndex(0) +15>Emitted(12, 110) Source(21, 102) + SourceIndex(0) +16>Emitted(12, 111) Source(21, 103) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(13, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(13, 3) Source(22, 3) + SourceIndex(0) +3 >Emitted(13, 4) Source(22, 4) + SourceIndex(0) +4 >Emitted(13, 5) Source(22, 5) + SourceIndex(0) +5 >Emitted(13, 10) Source(22, 10) + SourceIndex(0) +6 >Emitted(13, 14) Source(22, 14) + SourceIndex(0) +7 >Emitted(13, 19) Source(22, 19) + SourceIndex(0) +8 >Emitted(13, 20) Source(22, 20) + SourceIndex(0) +9 >Emitted(13, 21) Source(22, 21) + SourceIndex(0) +10>Emitted(13, 22) Source(22, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(14, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(14, 12) Source(23, 12) + SourceIndex(0) +3 >Emitted(14, 13) Source(23, 13) + SourceIndex(0) +4 >Emitted(14, 16) Source(23, 16) + SourceIndex(0) +5 >Emitted(14, 17) Source(23, 17) + SourceIndex(0) +6 >Emitted(14, 23) Source(23, 23) + SourceIndex(0) +7 >Emitted(14, 24) Source(23, 24) + SourceIndex(0) +8 >Emitted(14, 25) Source(23, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(15, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(24, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(16, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(16, 7) Source(25, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(17, 5) Source(26, 5) + SourceIndex(0) +2 >Emitted(17, 12) Source(26, 12) + SourceIndex(0) +3 >Emitted(17, 13) Source(26, 13) + SourceIndex(0) +4 >Emitted(17, 16) Source(26, 16) + SourceIndex(0) +5 >Emitted(17, 17) Source(26, 17) + SourceIndex(0) +6 >Emitted(17, 22) Source(26, 22) + SourceIndex(0) +7 >Emitted(17, 23) Source(26, 23) + SourceIndex(0) +8 >Emitted(17, 24) Source(26, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(18, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(18, 2) Source(27, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.symbols new file mode 100644 index 00000000000..eb009ba9ad7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.symbols @@ -0,0 +1,127 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 36)) + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 38)) + +var a: string, { name: nameA } = robotA; +>a : Symbol(a, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) + +var b: string, { name: nameB, skill: skillB } = robotB; +>b : Symbol(b, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 44), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) + +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>c : Symbol(c, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 79), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 49)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 64)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 29)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 49)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 64)) + +var { name: nameA } = robotA, a = hello; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) +>a : Symbol(a, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +var { name: nameB, skill: skillB } = robotB, b = " hello"; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) +>b : Symbol(b, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 44), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 3)) + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 38)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 53)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 29)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 38)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 53)) +>c : Symbol(c, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 79), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +var a = hello, { name: nameA } = robotA, a1= "hello"; +>a : Symbol(a, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 8, 3)) +>a1 : Symbol(a1, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 40)) + +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +>b : Symbol(b, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 44), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 9, 3)) +>b1 : Symbol(b1, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 55)) + +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +>c : Symbol(c, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 3), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 79), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 3)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 49)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 64)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 29)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 49)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 64)) +>c1 : Symbol(c1, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 90)) +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 7, 3)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 10, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 14, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 18, 16)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 16)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 11, 29), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 15, 18), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 19, 29)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 4, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatement1.ts, 12, 16), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 16, 5), Decl(sourceMapValidationDestructuringVariableStatement1.ts, 20, 16)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types new file mode 100644 index 00000000000..9d8023f5f74 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types @@ -0,0 +1,149 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +var a: string, { name: nameA } = robotA; +>a : string +>name : any +>nameA : string +>robotA : Robot + +var b: string, { name: nameB, skill: skillB } = robotB; +>b : string +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot + +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +>c : string +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +var { name: nameA } = robotA, a = hello; +>name : any +>nameA : string +>robotA : Robot +>a : string +>hello : string + +var { name: nameB, skill: skillB } = robotB, b = " hello"; +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot +>b : string +>" hello" : string + +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string +>c : string +>hello : string + +var a = hello, { name: nameA } = robotA, a1= "hello"; +>a : string +>hello : string +>name : any +>nameA : string +>robotA : Robot +>a1 : string +>"hello" : string + +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +>b : string +>hello : string +>name : any +>nameB : string +>skill : any +>skillB : string +>robotB : Robot +>b1 : string +>"hello" : string + +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +>c : string +>hello : string +>name : any +>nameC : string +>skill : any +>skillC : string +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string +>c1 : string +>hello : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillB : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js new file mode 100644 index 00000000000..fea40d4b900 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js @@ -0,0 +1,35 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts] +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + + +let [, nameA] = robotA; +let [numberB] = robotB; +let [numberA2, nameA2, skillA2] = robotA; + +let [numberC2] = [3, "edging", "Trimming edges"]; +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + +let [numberA3, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var nameA = robotA[1]; +var numberB = robotB[0]; +var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2]; +var numberC2 = [3, "edging", "Trimming edges"][0]; +var _a = [3, "edging", "Trimming edges"], numberC = _a[0], nameC = _a[1], skillC = _a[2]; +var numberA3 = robotA[0], robotAInfo = robotA.slice(1); +if (nameA == nameA2) { + console.log(skillA2); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map new file mode 100644 index 00000000000..cf91be353da --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAGxC,qBAAK,CAAW;AAClB,uBAAO,CAAW;AAClB,wBAAQ,EAAE,kBAAM,EAAE,mBAAO,CAAW;AAEpC,iDAAQ,CAAoC;AACjD,IAAA,oCAA8D,EAAzD,eAAO,EAAE,aAAK,EAAE,cAAM,CAAoC;AAE1D,wBAAQ,EAAE,4BAAa,CAAW;AAEvC,EAAE,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..43bcf108a9d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt @@ -0,0 +1,283 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(6, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(6, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(6, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(6, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(6, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(6, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(6, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(6, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(6, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(6, 48) + SourceIndex(0) +--- +>>>var nameA = robotA[1]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^-> +1 > + > + > + >let [, +2 >nameA +3 > ] = robotA; +1 >Emitted(3, 1) Source(9, 8) + SourceIndex(0) +2 >Emitted(3, 22) Source(9, 13) + SourceIndex(0) +3 >Emitted(3, 23) Source(9, 24) + SourceIndex(0) +--- +>>>var numberB = robotB[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >let [ +2 >numberB +3 > ] = robotB; +1->Emitted(4, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(4, 24) Source(10, 13) + SourceIndex(0) +3 >Emitted(4, 25) Source(10, 24) + SourceIndex(0) +--- +>>>var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + >let [ +2 >numberA2 +3 > , +4 > nameA2 +5 > , +6 > skillA2 +7 > ] = robotA; +1->Emitted(5, 1) Source(11, 6) + SourceIndex(0) +2 >Emitted(5, 25) Source(11, 14) + SourceIndex(0) +3 >Emitted(5, 27) Source(11, 16) + SourceIndex(0) +4 >Emitted(5, 45) Source(11, 22) + SourceIndex(0) +5 >Emitted(5, 47) Source(11, 24) + SourceIndex(0) +6 >Emitted(5, 66) Source(11, 31) + SourceIndex(0) +7 >Emitted(5, 67) Source(11, 42) + SourceIndex(0) +--- +>>>var numberC2 = [3, "edging", "Trimming edges"][0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >numberC2 +3 > ] = [3, "edging", "Trimming edges"]; +1 >Emitted(6, 1) Source(13, 6) + SourceIndex(0) +2 >Emitted(6, 50) Source(13, 14) + SourceIndex(0) +3 >Emitted(6, 51) Source(13, 50) + SourceIndex(0) +--- +>>>var _a = [3, "edging", "Trimming edges"], numberC = _a[0], nameC = _a[1], skillC = _a[2]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^ +1-> + > +2 > +3 > let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"] +4 > +5 > numberC +6 > , +7 > nameC +8 > , +9 > skillC +10> ] = [3, "edging", "Trimming edges"]; +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 1) + SourceIndex(0) +3 >Emitted(7, 41) Source(14, 63) + SourceIndex(0) +4 >Emitted(7, 43) Source(14, 6) + SourceIndex(0) +5 >Emitted(7, 58) Source(14, 13) + SourceIndex(0) +6 >Emitted(7, 60) Source(14, 15) + SourceIndex(0) +7 >Emitted(7, 73) Source(14, 20) + SourceIndex(0) +8 >Emitted(7, 75) Source(14, 22) + SourceIndex(0) +9 >Emitted(7, 89) Source(14, 28) + SourceIndex(0) +10>Emitted(7, 90) Source(14, 64) + SourceIndex(0) +--- +>>>var numberA3 = robotA[0], robotAInfo = robotA.slice(1); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1 > + > + >let [ +2 >numberA3 +3 > , +4 > ...robotAInfo +5 > ] = robotA; +1 >Emitted(8, 1) Source(16, 6) + SourceIndex(0) +2 >Emitted(8, 25) Source(16, 14) + SourceIndex(0) +3 >Emitted(8, 27) Source(16, 16) + SourceIndex(0) +4 >Emitted(8, 55) Source(16, 29) + SourceIndex(0) +5 >Emitted(8, 56) Source(16, 40) + SourceIndex(0) +--- +>>>if (nameA == nameA2) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameA2 +8 > ) +9 > +10> { +1 >Emitted(9, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(9, 3) Source(18, 3) + SourceIndex(0) +3 >Emitted(9, 4) Source(18, 4) + SourceIndex(0) +4 >Emitted(9, 5) Source(18, 5) + SourceIndex(0) +5 >Emitted(9, 10) Source(18, 10) + SourceIndex(0) +6 >Emitted(9, 14) Source(18, 14) + SourceIndex(0) +7 >Emitted(9, 20) Source(18, 20) + SourceIndex(0) +8 >Emitted(9, 21) Source(18, 21) + SourceIndex(0) +9 >Emitted(9, 22) Source(18, 22) + SourceIndex(0) +10>Emitted(9, 23) Source(18, 23) + SourceIndex(0) +--- +>>> console.log(skillA2); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA2 +7 > ) +8 > ; +1->Emitted(10, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(10, 24) Source(19, 24) + SourceIndex(0) +7 >Emitted(10, 25) Source(19, 25) + SourceIndex(0) +8 >Emitted(10, 26) Source(19, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(20, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.symbols new file mode 100644 index 00000000000..943f9e1c400 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 5, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 2, 1)) + + +let [, nameA] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 8, 6)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) + +let [numberB] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 9, 5)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 5, 3)) + +let [numberA2, nameA2, skillA2] = robotA; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 5)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 14)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 22)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) + +let [numberC2] = [3, "edging", "Trimming edges"]; +>numberC2 : Symbol(numberC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 12, 5)) + +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; +>numberC : Symbol(numberC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 13, 5)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 13, 13)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 13, 20)) + +let [numberA3, ...robotAInfo] = robotA; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 15, 5)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 15, 14)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 4, 3)) + +if (nameA == nameA2) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 8, 6)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 14)) + + console.log(skillA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 0, 22)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts, 10, 22)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types new file mode 100644 index 00000000000..73006f4ec45 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types @@ -0,0 +1,76 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + + +let [, nameA] = robotA; +> : undefined +>nameA : string +>robotA : [number, string, string] + +let [numberB] = robotB; +>numberB : number +>robotB : [number, string, string] + +let [numberA2, nameA2, skillA2] = robotA; +>numberA2 : number +>nameA2 : string +>skillA2 : string +>robotA : [number, string, string] + +let [numberC2] = [3, "edging", "Trimming edges"]; +>numberC2 : number +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; +>numberC : number +>nameC : string +>skillC : string +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberA3, ...robotAInfo] = robotA; +>numberA3 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] + +if (nameA == nameA2) { +>nameA == nameA2 : boolean +>nameA : string +>nameA2 : string + + console.log(skillA2); +>console.log(skillA2) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA2 : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js new file mode 100644 index 00000000000..b93acc66a10 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js @@ -0,0 +1,34 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts] +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, [string, string]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA] = multiRobotA; +let [nameMB] = multiRobotB; +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + +let [...multiRobotAInfo] = multiRobotA; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js] +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var skillA = multiRobotA[1]; +var nameMB = multiRobotB[0]; +var nameMA = multiRobotA[0], _a = multiRobotA[1], primarySkillA = _a[0], secondarySkillA = _a[1]; +var nameMC = ["roomba", ["vaccum", "mopping"]][0]; +var _b = ["roomba", ["vaccum", "mopping"]], nameMC2 = _b[0], _c = _b[1], primarySkillC = _c[0], secondarySkillC = _c[1]; +var multiRobotAInfo = multiRobotA.slice(0); +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map new file mode 100644 index 00000000000..6d0bcc3b9b2 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,2BAAM,CAAgB;AACxB,2BAAM,CAAgB;AACtB,2BAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AAExD,iDAAM,CAAsC;AACjD,IAAA,sCAAmF,EAA9E,eAAO,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAuC;AAE/E,0CAAkB,CAAgB;AAEvC,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..64e22a28771 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt @@ -0,0 +1,324 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts +------------------------------------------------------------------- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type MultiSkilledRobot = [string, [string, string]]; + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 16) Source(5, 16) + SourceIndex(0) +4 >Emitted(1, 19) Source(5, 38) + SourceIndex(0) +5 >Emitted(1, 20) Source(5, 39) + SourceIndex(0) +6 >Emitted(1, 27) Source(5, 46) + SourceIndex(0) +7 >Emitted(1, 29) Source(5, 48) + SourceIndex(0) +8 >Emitted(1, 30) Source(5, 49) + SourceIndex(0) +9 >Emitted(1, 38) Source(5, 57) + SourceIndex(0) +10>Emitted(1, 40) Source(5, 59) + SourceIndex(0) +11>Emitted(1, 42) Source(5, 61) + SourceIndex(0) +12>Emitted(1, 43) Source(5, 62) + SourceIndex(0) +13>Emitted(1, 44) Source(5, 63) + SourceIndex(0) +14>Emitted(1, 45) Source(5, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(6, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(6, 38) + SourceIndex(0) +5 >Emitted(2, 20) Source(6, 39) + SourceIndex(0) +6 >Emitted(2, 29) Source(6, 48) + SourceIndex(0) +7 >Emitted(2, 31) Source(6, 50) + SourceIndex(0) +8 >Emitted(2, 32) Source(6, 51) + SourceIndex(0) +9 >Emitted(2, 42) Source(6, 61) + SourceIndex(0) +10>Emitted(2, 44) Source(6, 63) + SourceIndex(0) +11>Emitted(2, 52) Source(6, 71) + SourceIndex(0) +12>Emitted(2, 53) Source(6, 72) + SourceIndex(0) +13>Emitted(2, 54) Source(6, 73) + SourceIndex(0) +14>Emitted(2, 55) Source(6, 74) + SourceIndex(0) +--- +>>>var skillA = multiRobotA[1]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^-> +1 > + > + >let [, +2 >skillA +3 > ] = multiRobotA; +1 >Emitted(3, 1) Source(8, 8) + SourceIndex(0) +2 >Emitted(3, 28) Source(8, 14) + SourceIndex(0) +3 >Emitted(3, 29) Source(8, 30) + SourceIndex(0) +--- +>>>var nameMB = multiRobotB[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >let [ +2 >nameMB +3 > ] = multiRobotB; +1->Emitted(4, 1) Source(9, 6) + SourceIndex(0) +2 >Emitted(4, 28) Source(9, 12) + SourceIndex(0) +3 >Emitted(4, 29) Source(9, 28) + SourceIndex(0) +--- +>>>var nameMA = multiRobotA[0], _a = multiRobotA[1], primarySkillA = _a[0], secondarySkillA = _a[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +1-> + >let [ +2 >nameMA +3 > , +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +9 > ]] = multiRobotA; +1->Emitted(5, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(5, 28) Source(10, 12) + SourceIndex(0) +3 >Emitted(5, 30) Source(10, 14) + SourceIndex(0) +4 >Emitted(5, 49) Source(10, 46) + SourceIndex(0) +5 >Emitted(5, 51) Source(10, 15) + SourceIndex(0) +6 >Emitted(5, 72) Source(10, 28) + SourceIndex(0) +7 >Emitted(5, 74) Source(10, 30) + SourceIndex(0) +8 >Emitted(5, 97) Source(10, 45) + SourceIndex(0) +9 >Emitted(5, 98) Source(10, 62) + SourceIndex(0) +--- +>>>var nameMC = ["roomba", ["vaccum", "mopping"]][0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >nameMC +3 > ] = ["roomba", ["vaccum", "mopping"]]; +1 >Emitted(6, 1) Source(12, 6) + SourceIndex(0) +2 >Emitted(6, 50) Source(12, 12) + SourceIndex(0) +3 >Emitted(6, 51) Source(12, 50) + SourceIndex(0) +--- +>>>var _b = ["roomba", ["vaccum", "mopping"]], nameMC2 = _b[0], _c = _b[1], primarySkillC = _c[0], secondarySkillC = _c[1]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^ +12> ^ +1-> + > +2 > +3 > let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]] +4 > +5 > nameMC2 +6 > , +7 > [primarySkillC, secondarySkillC] +8 > +9 > primarySkillC +10> , +11> secondarySkillC +12> ]] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(7, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(7, 43) Source(13, 84) + SourceIndex(0) +4 >Emitted(7, 45) Source(13, 6) + SourceIndex(0) +5 >Emitted(7, 60) Source(13, 13) + SourceIndex(0) +6 >Emitted(7, 62) Source(13, 15) + SourceIndex(0) +7 >Emitted(7, 72) Source(13, 47) + SourceIndex(0) +8 >Emitted(7, 74) Source(13, 16) + SourceIndex(0) +9 >Emitted(7, 95) Source(13, 29) + SourceIndex(0) +10>Emitted(7, 97) Source(13, 31) + SourceIndex(0) +11>Emitted(7, 120) Source(13, 46) + SourceIndex(0) +12>Emitted(7, 121) Source(13, 85) + SourceIndex(0) +--- +>>>var multiRobotAInfo = multiRobotA.slice(0); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +1 > + > + >let [ +2 >...multiRobotAInfo +3 > ] = multiRobotA; +1 >Emitted(8, 1) Source(15, 6) + SourceIndex(0) +2 >Emitted(8, 43) Source(15, 24) + SourceIndex(0) +3 >Emitted(8, 44) Source(15, 40) + SourceIndex(0) +--- +>>>if (nameMB == nameMA) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameMB +6 > == +7 > nameMA +8 > ) +9 > +10> { +1 >Emitted(9, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(9, 3) Source(17, 3) + SourceIndex(0) +3 >Emitted(9, 4) Source(17, 4) + SourceIndex(0) +4 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) +5 >Emitted(9, 11) Source(17, 11) + SourceIndex(0) +6 >Emitted(9, 15) Source(17, 15) + SourceIndex(0) +7 >Emitted(9, 21) Source(17, 21) + SourceIndex(0) +8 >Emitted(9, 22) Source(17, 22) + SourceIndex(0) +9 >Emitted(9, 23) Source(17, 23) + SourceIndex(0) +10>Emitted(9, 24) Source(17, 24) + SourceIndex(0) +--- +>>> console.log(skillA[0] + skillA[1]); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > [ +8 > 0 +9 > ] +10> + +11> skillA +12> [ +13> 1 +14> ] +15> ) +16> ; +1->Emitted(10, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(10, 23) Source(18, 23) + SourceIndex(0) +7 >Emitted(10, 24) Source(18, 24) + SourceIndex(0) +8 >Emitted(10, 25) Source(18, 25) + SourceIndex(0) +9 >Emitted(10, 26) Source(18, 26) + SourceIndex(0) +10>Emitted(10, 29) Source(18, 29) + SourceIndex(0) +11>Emitted(10, 35) Source(18, 35) + SourceIndex(0) +12>Emitted(10, 36) Source(18, 36) + SourceIndex(0) +13>Emitted(10, 37) Source(18, 37) + SourceIndex(0) +14>Emitted(10, 38) Source(18, 38) + SourceIndex(0) +15>Emitted(10, 39) Source(18, 39) + SourceIndex(0) +16>Emitted(10, 40) Source(18, 40) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.symbols new file mode 100644 index 00000000000..d2a61e2a5ef --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 1, 8)) +} +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 2, 1)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 5, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 2, 1)) + +let [, skillA] = multiRobotA; +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 7, 6)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) + +let [nameMB] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 8, 5)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 5, 3)) + +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 5)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 14)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 28)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : Symbol(nameMC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 11, 5)) + +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : Symbol(nameMC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 12, 5)) +>primarySkillC : Symbol(primarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 12, 15)) +>secondarySkillC : Symbol(secondarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 12, 29)) + +let [...multiRobotAInfo] = multiRobotA; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 14, 5)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 4, 3)) + +if (nameMB == nameMA) { +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 8, 5)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 9, 5)) + + console.log(skillA[0] + skillA[1]); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 7, 6)) +>0 : Symbol(0) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts, 7, 6)) +>1 : Symbol(1) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types new file mode 100644 index 00000000000..57d4b271c2f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types @@ -0,0 +1,84 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let [, skillA] = multiRobotA; +> : undefined +>skillA : [string, string] +>multiRobotA : [string, [string, string]] + +let [nameMB] = multiRobotB; +>nameMB : string +>multiRobotB : [string, [string, string]] + +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; +>nameMA : string +>primarySkillA : string +>secondarySkillA : string +>multiRobotA : [string, [string, string]] + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : string +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : string +>primarySkillC : string +>secondarySkillC : string +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +let [...multiRobotAInfo] = multiRobotA; +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] + +if (nameMB == nameMA) { +>nameMB == nameMA : boolean +>nameMB : string +>nameMA : string + + console.log(skillA[0] + skillA[1]); +>console.log(skillA[0] + skillA[1]) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA[0] + skillA[1] : string +>skillA[0] : string +>skillA : [string, string] +>0 : number +>skillA[1] : string +>skillA : [string, string] +>1 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js new file mode 100644 index 00000000000..32862b978db --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js @@ -0,0 +1,102 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | [string, string])[]; + +[, nameA] = robotA; +[, nameB] = getRobotB(); +[, nameB] = [2, "trimmer", "trimming"]; +[, multiSkillB] = multiRobotB; +[, multiSkillB] = getMultiRobotB(); +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; + +[numberB] = robotB; +[numberB] = getRobotB(); +[numberB] = [2, "trimmer", "trimming"]; +[nameMB] = multiRobotB; +[nameMB] = getMultiRobotB(); +[nameMB] = ["trimmer", ["trimming", "edging"]]; + +[numberB, nameB, skillB] = robotB; +[numberB, nameB, skillB] = getRobotB(); +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + +[numberB, ...robotAInfo] = robotB; +[numberB, ...robotAInfo] = getRobotB(); +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +[...multiRobotAInfo] = multiRobotA; +[...multiRobotAInfo] = getMultiRobotB(); +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var nameA, numberB, nameB, skillB; +var robotAInfo; +var multiSkillB, nameMB, primarySkillB, secondarySkillB; +var multiRobotAInfo; +nameA = robotA[1]; +_a = getRobotB(), nameB = _a[1]; +_b = [2, "trimmer", "trimming"], nameB = _b[1]; +multiSkillB = multiRobotB[1]; +_c = getMultiRobotB(), multiSkillB = _c[1]; +_d = ["roomba", ["vaccum", "mopping"]], multiSkillB = _d[1]; +numberB = robotB[0]; +numberB = getRobotB()[0]; +numberB = [2, "trimmer", "trimming"][0]; +nameMB = multiRobotB[0]; +nameMB = getMultiRobotB()[0]; +nameMB = ["trimmer", ["trimming", "edging"]][0]; +numberB = robotB[0], nameB = robotB[1], skillB = robotB[2]; +_e = getRobotB(), numberB = _e[0], nameB = _e[1], skillB = _e[2]; +_f = [2, "trimmer", "trimming"], numberB = _f[0], nameB = _f[1], skillB = _f[2]; +nameMB = multiRobotB[0], _g = multiRobotB[1], primarySkillB = _g[0], secondarySkillB = _g[1]; +_h = getMultiRobotB(), nameMB = _h[0], _j = _h[1], primarySkillB = _j[0], secondarySkillB = _j[1]; +_k = ["trimmer", ["trimming", "edging"]], nameMB = _k[0], _l = _k[1], primarySkillB = _l[0], secondarySkillB = _l[1]; +numberB = robotB[0], robotAInfo = robotB.slice(1); +_m = getRobotB(), numberB = _m[0], robotAInfo = _m.slice(1); +_o = [2, "trimmer", "trimming"], numberB = _o[0], robotAInfo = _o.slice(1); +multiRobotAInfo = multiRobotA.slice(0); +multiRobotAInfo = getMultiRobotB().slice(0); +multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0); +if (nameA == nameB) { + console.log(skillB); +} +function getRobotB() { + return robotB; +} +function getMultiRobotB() { + return multiRobotB; +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map new file mode 100644 index 00000000000..1b6c788952d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAA6B,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClG,IAAI,eAA8C,CAAC;AAEhD,iBAAK,CAAW;AACnB,gBAAuB,EAApB,aAAK,CAAgB;AACxB,+BAAsC,EAAnC,aAAK,CAA+B;AACpC,4BAAW,CAAgB;AAC9B,qBAAkC,EAA/B,mBAAW,CAAqB;AACnC,sCAAmD,EAAhD,mBAAW,CAAsC;AAEnD,mBAAO,CAAW;AAClB,wBAAO,CAAgB;AACvB,uCAAO,CAA+B;AACtC,uBAAM,CAAgB;AACtB,4BAAM,CAAqB;AAC3B,+CAAM,CAAwC;AAE9C,mBAAO,EAAE,iBAAK,EAAE,kBAAM,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,aAAK,EAAE,cAAM,CAAgB;AACvC,+BAAqD,EAApD,eAAO,EAAE,aAAK,EAAE,cAAM,CAA+B;AACrD,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AACzD,qBAA6D,EAA5D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAsB;AAC9D,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAyC;AAEhF,mBAAO,EAAE,4BAAa,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,wBAAa,CAAgB;AACvC,+BAA4D,EAA3D,eAAO,EAAE,wBAAa,CAAsC;AAC5D,sCAAkB,CAAgB;AAClC,2CAAkB,CAAqB;AACvC,8DAAkB,CAAwC;AAE3D,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt new file mode 100644 index 00000000000..466b36630c3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt @@ -0,0 +1,909 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, [string, string]]; + > + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 16) Source(9, 16) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 38) + SourceIndex(0) +5 >Emitted(3, 20) Source(9, 39) + SourceIndex(0) +6 >Emitted(3, 27) Source(9, 46) + SourceIndex(0) +7 >Emitted(3, 29) Source(9, 48) + SourceIndex(0) +8 >Emitted(3, 30) Source(9, 49) + SourceIndex(0) +9 >Emitted(3, 38) Source(9, 57) + SourceIndex(0) +10>Emitted(3, 40) Source(9, 59) + SourceIndex(0) +11>Emitted(3, 42) Source(9, 61) + SourceIndex(0) +12>Emitted(3, 43) Source(9, 62) + SourceIndex(0) +13>Emitted(3, 44) Source(9, 63) + SourceIndex(0) +14>Emitted(3, 45) Source(9, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(4, 16) Source(10, 16) + SourceIndex(0) +4 >Emitted(4, 19) Source(10, 38) + SourceIndex(0) +5 >Emitted(4, 20) Source(10, 39) + SourceIndex(0) +6 >Emitted(4, 29) Source(10, 48) + SourceIndex(0) +7 >Emitted(4, 31) Source(10, 50) + SourceIndex(0) +8 >Emitted(4, 32) Source(10, 51) + SourceIndex(0) +9 >Emitted(4, 42) Source(10, 61) + SourceIndex(0) +10>Emitted(4, 44) Source(10, 63) + SourceIndex(0) +11>Emitted(4, 52) Source(10, 71) + SourceIndex(0) +12>Emitted(4, 53) Source(10, 72) + SourceIndex(0) +13>Emitted(4, 54) Source(10, 73) + SourceIndex(0) +14>Emitted(4, 55) Source(10, 74) + SourceIndex(0) +--- +>>>var nameA, numberB, nameB, skillB; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +1 > + > + > +2 >let +3 > nameA: string +4 > , +5 > numberB: number +6 > , +7 > nameB: string +8 > , +9 > skillB: string +10> ; +1 >Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 10) Source(12, 18) + SourceIndex(0) +4 >Emitted(5, 12) Source(12, 20) + SourceIndex(0) +5 >Emitted(5, 19) Source(12, 35) + SourceIndex(0) +6 >Emitted(5, 21) Source(12, 37) + SourceIndex(0) +7 >Emitted(5, 26) Source(12, 50) + SourceIndex(0) +8 >Emitted(5, 28) Source(12, 52) + SourceIndex(0) +9 >Emitted(5, 34) Source(12, 66) + SourceIndex(0) +10>Emitted(5, 35) Source(12, 67) + SourceIndex(0) +--- +>>>var robotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > robotAInfo: (number | string)[] +4 > ; +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 15) Source(13, 36) + SourceIndex(0) +4 >Emitted(6, 16) Source(13, 37) + SourceIndex(0) +--- +>>>var multiSkillB, nameMB, primarySkillB, secondarySkillB; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^ +1-> + > + > +2 >let +3 > multiSkillB: [string, string] +4 > , +5 > nameMB: string +6 > , +7 > primarySkillB: string +8 > , +9 > secondarySkillB: string +10> ; +1->Emitted(7, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(15, 34) + SourceIndex(0) +4 >Emitted(7, 18) Source(15, 36) + SourceIndex(0) +5 >Emitted(7, 24) Source(15, 50) + SourceIndex(0) +6 >Emitted(7, 26) Source(15, 52) + SourceIndex(0) +7 >Emitted(7, 39) Source(15, 73) + SourceIndex(0) +8 >Emitted(7, 41) Source(15, 75) + SourceIndex(0) +9 >Emitted(7, 56) Source(15, 98) + SourceIndex(0) +10>Emitted(7, 57) Source(15, 99) + SourceIndex(0) +--- +>>>var multiRobotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^ +1 > + > +2 >let +3 > multiRobotAInfo: (string | [string, string])[] +4 > ; +1 >Emitted(8, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(8, 20) Source(16, 51) + SourceIndex(0) +4 >Emitted(8, 21) Source(16, 52) + SourceIndex(0) +--- +>>>nameA = robotA[1]; +1 > +2 >^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^-> +1 > + > + >[, +2 >nameA +3 > ] = robotA; +1 >Emitted(9, 1) Source(18, 4) + SourceIndex(0) +2 >Emitted(9, 18) Source(18, 9) + SourceIndex(0) +3 >Emitted(9, 19) Source(18, 20) + SourceIndex(0) +--- +>>>_a = getRobotB(), nameB = _a[1]; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, nameB] = getRobotB() +3 > +4 > nameB +5 > ] = getRobotB(); +1->Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 17) Source(19, 24) + SourceIndex(0) +3 >Emitted(10, 19) Source(19, 4) + SourceIndex(0) +4 >Emitted(10, 32) Source(19, 9) + SourceIndex(0) +5 >Emitted(10, 33) Source(19, 25) + SourceIndex(0) +--- +>>>_b = [2, "trimmer", "trimming"], nameB = _b[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^ +5 > ^ +1-> + > +2 >[, nameB] = [2, "trimmer", "trimming"] +3 > +4 > nameB +5 > ] = [2, "trimmer", "trimming"]; +1->Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 32) Source(20, 39) + SourceIndex(0) +3 >Emitted(11, 34) Source(20, 4) + SourceIndex(0) +4 >Emitted(11, 47) Source(20, 9) + SourceIndex(0) +5 >Emitted(11, 48) Source(20, 40) + SourceIndex(0) +--- +>>>multiSkillB = multiRobotB[1]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^-> +1 > + >[, +2 >multiSkillB +3 > ] = multiRobotB; +1 >Emitted(12, 1) Source(21, 4) + SourceIndex(0) +2 >Emitted(12, 29) Source(21, 15) + SourceIndex(0) +3 >Emitted(12, 30) Source(21, 31) + SourceIndex(0) +--- +>>>_c = getMultiRobotB(), multiSkillB = _c[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, multiSkillB] = getMultiRobotB() +3 > +4 > multiSkillB +5 > ] = getMultiRobotB(); +1->Emitted(13, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(13, 22) Source(22, 35) + SourceIndex(0) +3 >Emitted(13, 24) Source(22, 4) + SourceIndex(0) +4 >Emitted(13, 43) Source(22, 15) + SourceIndex(0) +5 >Emitted(13, 44) Source(22, 36) + SourceIndex(0) +--- +>>>_d = ["roomba", ["vaccum", "mopping"]], multiSkillB = _d[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + > +2 >[, multiSkillB] = ["roomba", ["vaccum", "mopping"]] +3 > +4 > multiSkillB +5 > ] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(14, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(14, 39) Source(23, 52) + SourceIndex(0) +3 >Emitted(14, 41) Source(23, 4) + SourceIndex(0) +4 >Emitted(14, 60) Source(23, 15) + SourceIndex(0) +5 >Emitted(14, 61) Source(23, 53) + SourceIndex(0) +--- +>>>numberB = robotB[0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^-> +1 > + > + >[ +2 >numberB +3 > ] = robotB; +1 >Emitted(15, 1) Source(25, 2) + SourceIndex(0) +2 >Emitted(15, 20) Source(25, 9) + SourceIndex(0) +3 >Emitted(15, 21) Source(25, 20) + SourceIndex(0) +--- +>>>numberB = getRobotB()[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >numberB +3 > ] = getRobotB(); +1->Emitted(16, 1) Source(26, 2) + SourceIndex(0) +2 >Emitted(16, 25) Source(26, 9) + SourceIndex(0) +3 >Emitted(16, 26) Source(26, 25) + SourceIndex(0) +--- +>>>numberB = [2, "trimmer", "trimming"][0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +1-> + >[ +2 >numberB +3 > ] = [2, "trimmer", "trimming"]; +1->Emitted(17, 1) Source(27, 2) + SourceIndex(0) +2 >Emitted(17, 40) Source(27, 9) + SourceIndex(0) +3 >Emitted(17, 41) Source(27, 40) + SourceIndex(0) +--- +>>>nameMB = multiRobotB[0]; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^-> +1 > + >[ +2 >nameMB +3 > ] = multiRobotB; +1 >Emitted(18, 1) Source(28, 2) + SourceIndex(0) +2 >Emitted(18, 24) Source(28, 8) + SourceIndex(0) +3 >Emitted(18, 25) Source(28, 24) + SourceIndex(0) +--- +>>>nameMB = getMultiRobotB()[0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB +3 > ] = getMultiRobotB(); +1->Emitted(19, 1) Source(29, 2) + SourceIndex(0) +2 >Emitted(19, 29) Source(29, 8) + SourceIndex(0) +3 >Emitted(19, 30) Source(29, 29) + SourceIndex(0) +--- +>>>nameMB = ["trimmer", ["trimming", "edging"]][0]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB +3 > ] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(20, 1) Source(30, 2) + SourceIndex(0) +2 >Emitted(20, 48) Source(30, 8) + SourceIndex(0) +3 >Emitted(20, 49) Source(30, 48) + SourceIndex(0) +--- +>>>numberB = robotB[0], nameB = robotB[1], skillB = robotB[2]; +1-> +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^-> +1-> + > + >[ +2 >numberB +3 > , +4 > nameB +5 > , +6 > skillB +7 > ] = robotB; +1->Emitted(21, 1) Source(32, 2) + SourceIndex(0) +2 >Emitted(21, 20) Source(32, 9) + SourceIndex(0) +3 >Emitted(21, 22) Source(32, 11) + SourceIndex(0) +4 >Emitted(21, 39) Source(32, 16) + SourceIndex(0) +5 >Emitted(21, 41) Source(32, 18) + SourceIndex(0) +6 >Emitted(21, 59) Source(32, 24) + SourceIndex(0) +7 >Emitted(21, 60) Source(32, 35) + SourceIndex(0) +--- +>>>_e = getRobotB(), numberB = _e[0], nameB = _e[1], skillB = _e[2]; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB, nameB, skillB] = getRobotB() +3 > +4 > numberB +5 > , +6 > nameB +7 > , +8 > skillB +9 > ] = getRobotB(); +1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(22, 17) Source(33, 39) + SourceIndex(0) +3 >Emitted(22, 19) Source(33, 2) + SourceIndex(0) +4 >Emitted(22, 34) Source(33, 9) + SourceIndex(0) +5 >Emitted(22, 36) Source(33, 11) + SourceIndex(0) +6 >Emitted(22, 49) Source(33, 16) + SourceIndex(0) +7 >Emitted(22, 51) Source(33, 18) + SourceIndex(0) +8 >Emitted(22, 65) Source(33, 24) + SourceIndex(0) +9 >Emitted(22, 66) Source(33, 40) + SourceIndex(0) +--- +>>>_f = [2, "trimmer", "trimming"], numberB = _f[0], nameB = _f[1], skillB = _f[2]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB, nameB, skillB] = [2, "trimmer", "trimming"] +3 > +4 > numberB +5 > , +6 > nameB +7 > , +8 > skillB +9 > ] = [2, "trimmer", "trimming"]; +1->Emitted(23, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(23, 32) Source(34, 54) + SourceIndex(0) +3 >Emitted(23, 34) Source(34, 2) + SourceIndex(0) +4 >Emitted(23, 49) Source(34, 9) + SourceIndex(0) +5 >Emitted(23, 51) Source(34, 11) + SourceIndex(0) +6 >Emitted(23, 64) Source(34, 16) + SourceIndex(0) +7 >Emitted(23, 66) Source(34, 18) + SourceIndex(0) +8 >Emitted(23, 80) Source(34, 24) + SourceIndex(0) +9 >Emitted(23, 81) Source(34, 55) + SourceIndex(0) +--- +>>>nameMB = multiRobotB[0], _g = multiRobotB[1], primarySkillB = _g[0], secondarySkillB = _g[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^-> +1-> + >[ +2 >nameMB +3 > , +4 > [primarySkillB, secondarySkillB] +5 > +6 > primarySkillB +7 > , +8 > secondarySkillB +9 > ]] = multiRobotB; +1->Emitted(24, 1) Source(35, 2) + SourceIndex(0) +2 >Emitted(24, 24) Source(35, 8) + SourceIndex(0) +3 >Emitted(24, 26) Source(35, 10) + SourceIndex(0) +4 >Emitted(24, 45) Source(35, 42) + SourceIndex(0) +5 >Emitted(24, 47) Source(35, 11) + SourceIndex(0) +6 >Emitted(24, 68) Source(35, 24) + SourceIndex(0) +7 >Emitted(24, 70) Source(35, 26) + SourceIndex(0) +8 >Emitted(24, 93) Source(35, 41) + SourceIndex(0) +9 >Emitted(24, 94) Source(35, 58) + SourceIndex(0) +--- +>>>_h = getMultiRobotB(), nameMB = _h[0], _j = _h[1], primarySkillB = _j[0], secondarySkillB = _j[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^ +12> ^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB() +3 > +4 > nameMB +5 > , +6 > [primarySkillB, secondarySkillB] +7 > +8 > primarySkillB +9 > , +10> secondarySkillB +11> ]] = getMultiRobotB(); +1->Emitted(25, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(25, 22) Source(36, 62) + SourceIndex(0) +3 >Emitted(25, 24) Source(36, 2) + SourceIndex(0) +4 >Emitted(25, 38) Source(36, 8) + SourceIndex(0) +5 >Emitted(25, 40) Source(36, 10) + SourceIndex(0) +6 >Emitted(25, 50) Source(36, 42) + SourceIndex(0) +7 >Emitted(25, 52) Source(36, 11) + SourceIndex(0) +8 >Emitted(25, 73) Source(36, 24) + SourceIndex(0) +9 >Emitted(25, 75) Source(36, 26) + SourceIndex(0) +10>Emitted(25, 98) Source(36, 41) + SourceIndex(0) +11>Emitted(25, 99) Source(36, 63) + SourceIndex(0) +--- +>>>_k = ["trimmer", ["trimming", "edging"]], nameMB = _k[0], _l = _k[1], primarySkillB = _l[0], secondarySkillB = _l[1]; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^ +1-> + > +2 >[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]] +3 > +4 > nameMB +5 > , +6 > [primarySkillB, secondarySkillB] +7 > +8 > primarySkillB +9 > , +10> secondarySkillB +11> ]] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(26, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(26, 41) Source(37, 81) + SourceIndex(0) +3 >Emitted(26, 43) Source(37, 2) + SourceIndex(0) +4 >Emitted(26, 57) Source(37, 8) + SourceIndex(0) +5 >Emitted(26, 59) Source(37, 10) + SourceIndex(0) +6 >Emitted(26, 69) Source(37, 42) + SourceIndex(0) +7 >Emitted(26, 71) Source(37, 11) + SourceIndex(0) +8 >Emitted(26, 92) Source(37, 24) + SourceIndex(0) +9 >Emitted(26, 94) Source(37, 26) + SourceIndex(0) +10>Emitted(26, 117) Source(37, 41) + SourceIndex(0) +11>Emitted(26, 118) Source(37, 82) + SourceIndex(0) +--- +>>>numberB = robotB[0], robotAInfo = robotB.slice(1); +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^-> +1 > + > + >[ +2 >numberB +3 > , +4 > ...robotAInfo +5 > ] = robotB; +1 >Emitted(27, 1) Source(39, 2) + SourceIndex(0) +2 >Emitted(27, 20) Source(39, 9) + SourceIndex(0) +3 >Emitted(27, 22) Source(39, 11) + SourceIndex(0) +4 >Emitted(27, 50) Source(39, 24) + SourceIndex(0) +5 >Emitted(27, 51) Source(39, 35) + SourceIndex(0) +--- +>>>_m = getRobotB(), numberB = _m[0], robotAInfo = _m.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB, ...robotAInfo] = getRobotB() +3 > +4 > numberB +5 > , +6 > ...robotAInfo +7 > ] = getRobotB(); +1->Emitted(28, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(28, 17) Source(40, 39) + SourceIndex(0) +3 >Emitted(28, 19) Source(40, 2) + SourceIndex(0) +4 >Emitted(28, 34) Source(40, 9) + SourceIndex(0) +5 >Emitted(28, 36) Source(40, 11) + SourceIndex(0) +6 >Emitted(28, 60) Source(40, 24) + SourceIndex(0) +7 >Emitted(28, 61) Source(40, 40) + SourceIndex(0) +--- +>>>_o = [2, "trimmer", "trimming"], numberB = _o[0], robotAInfo = _o.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + > +2 >[numberB, ...robotAInfo] = [2, "trimmer", "trimming"] +3 > +4 > numberB +5 > , +6 > ...robotAInfo +7 > ] = [2, "trimmer", "trimming"]; +1->Emitted(29, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(29, 32) Source(41, 61) + SourceIndex(0) +3 >Emitted(29, 34) Source(41, 2) + SourceIndex(0) +4 >Emitted(29, 49) Source(41, 9) + SourceIndex(0) +5 >Emitted(29, 51) Source(41, 11) + SourceIndex(0) +6 >Emitted(29, 75) Source(41, 24) + SourceIndex(0) +7 >Emitted(29, 76) Source(41, 62) + SourceIndex(0) +--- +>>>multiRobotAInfo = multiRobotA.slice(0); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^-> +1 > + >[ +2 >...multiRobotAInfo +3 > ] = multiRobotA; +1 >Emitted(30, 1) Source(42, 2) + SourceIndex(0) +2 >Emitted(30, 39) Source(42, 20) + SourceIndex(0) +3 >Emitted(30, 40) Source(42, 36) + SourceIndex(0) +--- +>>>multiRobotAInfo = getMultiRobotB().slice(0); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >...multiRobotAInfo +3 > ] = getMultiRobotB(); +1->Emitted(31, 1) Source(43, 2) + SourceIndex(0) +2 >Emitted(31, 44) Source(43, 20) + SourceIndex(0) +3 >Emitted(31, 45) Source(43, 41) + SourceIndex(0) +--- +>>>multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +1-> + >[ +2 >...multiRobotAInfo +3 > ] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(32, 1) Source(44, 2) + SourceIndex(0) +2 >Emitted(32, 63) Source(44, 20) + SourceIndex(0) +3 >Emitted(32, 64) Source(44, 60) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(33, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(33, 3) Source(46, 3) + SourceIndex(0) +3 >Emitted(33, 4) Source(46, 4) + SourceIndex(0) +4 >Emitted(33, 5) Source(46, 5) + SourceIndex(0) +5 >Emitted(33, 10) Source(46, 10) + SourceIndex(0) +6 >Emitted(33, 14) Source(46, 14) + SourceIndex(0) +7 >Emitted(33, 19) Source(46, 19) + SourceIndex(0) +8 >Emitted(33, 20) Source(46, 20) + SourceIndex(0) +9 >Emitted(33, 21) Source(46, 21) + SourceIndex(0) +10>Emitted(33, 22) Source(46, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(34, 5) Source(47, 5) + SourceIndex(0) +2 >Emitted(34, 12) Source(47, 12) + SourceIndex(0) +3 >Emitted(34, 13) Source(47, 13) + SourceIndex(0) +4 >Emitted(34, 16) Source(47, 16) + SourceIndex(0) +5 >Emitted(34, 17) Source(47, 17) + SourceIndex(0) +6 >Emitted(34, 23) Source(47, 23) + SourceIndex(0) +7 >Emitted(34, 24) Source(47, 24) + SourceIndex(0) +8 >Emitted(34, 25) Source(47, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(48, 2) + SourceIndex(0) +--- +>>>function getRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(36, 1) Source(50, 1) + SourceIndex(0) +--- +>>> return robotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobotB() { + > +2 > return +3 > +4 > robotB +5 > ; +1->Emitted(37, 5) Source(51, 5) + SourceIndex(0) +2 >Emitted(37, 11) Source(51, 11) + SourceIndex(0) +3 >Emitted(37, 12) Source(51, 12) + SourceIndex(0) +4 >Emitted(37, 18) Source(51, 18) + SourceIndex(0) +5 >Emitted(37, 19) Source(51, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(52, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(52, 2) + SourceIndex(0) +--- +>>>function getMultiRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(39, 1) Source(54, 1) + SourceIndex(0) +--- +>>> return multiRobotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobotB() { + > +2 > return +3 > +4 > multiRobotB +5 > ; +1->Emitted(40, 5) Source(55, 5) + SourceIndex(0) +2 >Emitted(40, 11) Source(55, 11) + SourceIndex(0) +3 >Emitted(40, 12) Source(55, 12) + SourceIndex(0) +4 >Emitted(40, 23) Source(55, 23) + SourceIndex(0) +5 >Emitted(40, 24) Source(55, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(41, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(41, 2) Source(56, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.symbols new file mode 100644 index 00000000000..931523c6b26 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.symbols @@ -0,0 +1,176 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 3, 38)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 8, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 3, 38)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 3, 38)) + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 3)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) + +let robotAInfo: (number | string)[]; +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) + +let multiRobotAInfo: (string | [string, string])[]; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) + +[, nameA] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 6, 3)) + +[, nameB] = getRobotB(); +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[, nameB] = [2, "trimmer", "trimming"]; +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) + +[, multiSkillB] = multiRobotB; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) + +[, multiSkillB] = getMultiRobotB(); +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 3)) + +[numberB] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) + +[numberB] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[numberB] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) + +[nameMB] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) + +[nameMB] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[nameMB] = ["trimmer", ["trimming", "edging"]]; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) + +[numberB, nameB, skillB] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) + +[numberB, nameB, skillB] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) + +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) + +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 34)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 50)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 14, 73)) + +[numberB, ...robotAInfo] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) + +[numberB, ...robotAInfo] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 12, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 2, 1)) + +[...multiRobotAInfo] = multiRobotA; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 8, 3)) + +[...multiRobotAInfo] = getMultiRobotB(); +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 15, 3)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 35)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 0, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 11, 50)) +} + +function getRobotB() { +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 47, 1)) + + return robotB; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 7, 3)) +} + +function getMultiRobotB() { +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 51, 1)) + + return multiRobotB; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts, 9, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types new file mode 100644 index 00000000000..5ca93029977 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types @@ -0,0 +1,304 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, [string, string]]; +>MultiSkilledRobot : [string, [string, string]] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["mower", ["mowing", ""]] : [string, [string, string]] +>"mower" : string +>["mowing", ""] : [string, string] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, [string, string]] +>MultiSkilledRobot : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : string +>numberB : number +>nameB : string +>skillB : string + +let robotAInfo: (number | string)[]; +>robotAInfo : (number | string)[] + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : [string, string] +>nameMB : string +>primarySkillB : string +>secondarySkillB : string + +let multiRobotAInfo: (string | [string, string])[]; +>multiRobotAInfo : (string | [string, string])[] + +[, nameA] = robotA; +>[, nameA] = robotA : [number, string, string] +>[, nameA] : [undefined, string] +> : undefined +>nameA : string +>robotA : [number, string, string] + +[, nameB] = getRobotB(); +>[, nameB] = getRobotB() : [number, string, string] +>[, nameB] : [undefined, string] +> : undefined +>nameB : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[, nameB] = [2, "trimmer", "trimming"]; +>[, nameB] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameB] : [undefined, string] +> : undefined +>nameB : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[, multiSkillB] = multiRobotB; +>[, multiSkillB] = multiRobotB : [string, [string, string]] +>[, multiSkillB] : [undefined, [string, string]] +> : undefined +>multiSkillB : [string, string] +>multiRobotB : [string, [string, string]] + +[, multiSkillB] = getMultiRobotB(); +>[, multiSkillB] = getMultiRobotB() : [string, [string, string]] +>[, multiSkillB] : [undefined, [string, string]] +> : undefined +>multiSkillB : [string, string] +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; +>[, multiSkillB] = ["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>[, multiSkillB] : [undefined, [string, string]] +> : undefined +>multiSkillB : [string, string] +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +[numberB] = robotB; +>[numberB] = robotB : [number, string, string] +>[numberB] : [number] +>numberB : number +>robotB : [number, string, string] + +[numberB] = getRobotB(); +>[numberB] = getRobotB() : [number, string, string] +>[numberB] : [number] +>numberB : number +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB] = [2, "trimmer", "trimming"]; +>[numberB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB] : [number] +>numberB : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB] = multiRobotB; +>[nameMB] = multiRobotB : [string, [string, string]] +>[nameMB] : [string] +>nameMB : string +>multiRobotB : [string, [string, string]] + +[nameMB] = getMultiRobotB(); +>[nameMB] = getMultiRobotB() : [string, [string, string]] +>[nameMB] : [string] +>nameMB : string +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[nameMB] = ["trimmer", ["trimming", "edging"]]; +>[nameMB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameMB] : [string] +>nameMB : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +[numberB, nameB, skillB] = robotB; +>[numberB, nameB, skillB] = robotB : [number, string, string] +>[numberB, nameB, skillB] : [number, string, string] +>numberB : number +>nameB : string +>skillB : string +>robotB : [number, string, string] + +[numberB, nameB, skillB] = getRobotB(); +>[numberB, nameB, skillB] = getRobotB() : [number, string, string] +>[numberB, nameB, skillB] : [number, string, string] +>numberB : number +>nameB : string +>skillB : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +>[numberB, nameB, skillB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB, nameB, skillB] : [number, string, string] +>numberB : number +>nameB : string +>skillB : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +>[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB : [string, [string, string]] +>[nameMB, [primarySkillB, secondarySkillB]] : [string, [string, string]] +>nameMB : string +>[primarySkillB, secondarySkillB] : [string, string] +>primarySkillB : string +>secondarySkillB : string +>multiRobotB : [string, [string, string]] + +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +>[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB() : [string, [string, string]] +>[nameMB, [primarySkillB, secondarySkillB]] : [string, [string, string]] +>nameMB : string +>[primarySkillB, secondarySkillB] : [string, string] +>primarySkillB : string +>secondarySkillB : string +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; +>[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMB, [primarySkillB, secondarySkillB]] : [string, [string, string]] +>nameMB : string +>[primarySkillB, secondarySkillB] : [string, string] +>primarySkillB : string +>secondarySkillB : string +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +[numberB, ...robotAInfo] = robotB; +>[numberB, ...robotAInfo] = robotB : [number, string, string] +>[numberB, ...robotAInfo] : (number | string)[] +>numberB : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotB : [number, string, string] + +[numberB, ...robotAInfo] = getRobotB(); +>[numberB, ...robotAInfo] = getRobotB() : [number, string, string] +>[numberB, ...robotAInfo] : (number | string)[] +>numberB : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +>[numberB, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB, ...robotAInfo] : (number | string)[] +>numberB : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[...multiRobotAInfo] = multiRobotA; +>[...multiRobotAInfo] = multiRobotA : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>multiRobotA : [string, [string, string]] + +[...multiRobotAInfo] = getMultiRobotB(); +>[...multiRobotAInfo] = getMultiRobotB() : [string, [string, string]] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>getMultiRobotB() : [string, [string, string]] +>getMultiRobotB : () => [string, [string, string]] + +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : (string | [string, string])[] +>[...multiRobotAInfo] : (string | [string, string])[] +>...multiRobotAInfo : string | [string, string] +>multiRobotAInfo : (string | [string, string])[] +>["trimmer", ["trimming", "edging"]] : (string | [string, string])[] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillB : string +} + +function getRobotB() { +>getRobotB : () => [number, string, string] + + return robotB; +>robotB : [number, string, string] +} + +function getMultiRobotB() { +>getMultiRobotB : () => [string, [string, string]] + + return multiRobotB; +>multiRobotB : [string, [string, string]] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js new file mode 100644 index 00000000000..8cc61944e76 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js @@ -0,0 +1,34 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts] +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + +let [, nameA = "noName"] = robotA; +let [numberB = -1] = robotB; +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + +let [numberA3 = -1, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var _a = robotA[1], nameA = _a === void 0 ? "noName" : _a; +var _b = robotB[0], numberB = _b === void 0 ? -1 : _b; +var _c = robotA[0], numberA2 = _c === void 0 ? -1 : _c, _d = robotA[1], nameA2 = _d === void 0 ? "noName" : _d, _e = robotA[2], skillA2 = _e === void 0 ? "noSkill" : _e; +var _f = [3, "edging", "Trimming edges"][0], numberC2 = _f === void 0 ? -1 : _f; +var _g = [3, "edging", "Trimming edges"], _h = _g[0], numberC = _h === void 0 ? -1 : _h, _j = _g[1], nameC = _j === void 0 ? "noName" : _j, _k = _g[2], skillC = _k === void 0 ? "noSkill" : _k; +var _l = robotA[0], numberA3 = _l === void 0 ? -1 : _l, robotAInfo = robotA.slice(1); +if (nameA == nameA2) { + console.log(skillA2); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map new file mode 100644 index 00000000000..ce017fbbbcd --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAExC,kBAAgB,EAAhB,qCAAgB,CAAW;AAC7B,kBAAY,EAAZ,iCAAY,CAAW;AACvB,kBAAa,EAAb,kCAAa,EAAE,cAAiB,EAAjB,sCAAiB,EAAE,cAAmB,EAAnB,wCAAmB,CAAW;AAEhE,2CAAa,EAAb,kCAAa,CAAoC;AACtD,IAAA,oCAA0F,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAgB,EAAhB,qCAAgB,EAAE,UAAkB,EAAlB,uCAAkB,CAAoC;AAEtF,kBAAa,EAAb,kCAAa,EAAE,4BAAa,CAAW;AAE5C,EAAE,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..9df44518ca1 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt @@ -0,0 +1,342 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type Robot = [number, string, string]; + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(5, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(5, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(5, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(5, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(5, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(5, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(5, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(5, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(5, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(6, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(6, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(6, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(6, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(6, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(6, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(6, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(6, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(6, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(6, 48) + SourceIndex(0) +--- +>>>var _a = robotA[1], nameA = _a === void 0 ? "noName" : _a; +1-> +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + > + >let [, +2 >nameA = "noName" +3 > +4 > nameA = "noName" +5 > ] = robotA; +1->Emitted(3, 1) Source(8, 8) + SourceIndex(0) +2 >Emitted(3, 19) Source(8, 24) + SourceIndex(0) +3 >Emitted(3, 21) Source(8, 8) + SourceIndex(0) +4 >Emitted(3, 58) Source(8, 24) + SourceIndex(0) +5 >Emitted(3, 59) Source(8, 35) + SourceIndex(0) +--- +>>>var _b = robotB[0], numberB = _b === void 0 ? -1 : _b; +1 > +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >let [ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = robotB; +1 >Emitted(4, 1) Source(9, 6) + SourceIndex(0) +2 >Emitted(4, 19) Source(9, 18) + SourceIndex(0) +3 >Emitted(4, 21) Source(9, 6) + SourceIndex(0) +4 >Emitted(4, 54) Source(9, 18) + SourceIndex(0) +5 >Emitted(4, 55) Source(9, 29) + SourceIndex(0) +--- +>>>var _c = robotA[0], numberA2 = _c === void 0 ? -1 : _c, _d = robotA[1], nameA2 = _d === void 0 ? "noName" : _d, _e = robotA[2], skillA2 = _e === void 0 ? "noSkill" : _e; +1-> +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^ +1-> + >let [ +2 >numberA2 = -1 +3 > +4 > numberA2 = -1 +5 > , +6 > nameA2 = "noName" +7 > +8 > nameA2 = "noName" +9 > , +10> skillA2 = "noSkill" +11> +12> skillA2 = "noSkill" +13> ] = robotA; +1->Emitted(5, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) +3 >Emitted(5, 21) Source(10, 6) + SourceIndex(0) +4 >Emitted(5, 55) Source(10, 19) + SourceIndex(0) +5 >Emitted(5, 57) Source(10, 21) + SourceIndex(0) +6 >Emitted(5, 71) Source(10, 38) + SourceIndex(0) +7 >Emitted(5, 73) Source(10, 21) + SourceIndex(0) +8 >Emitted(5, 111) Source(10, 38) + SourceIndex(0) +9 >Emitted(5, 113) Source(10, 40) + SourceIndex(0) +10>Emitted(5, 127) Source(10, 59) + SourceIndex(0) +11>Emitted(5, 129) Source(10, 40) + SourceIndex(0) +12>Emitted(5, 169) Source(10, 59) + SourceIndex(0) +13>Emitted(5, 170) Source(10, 70) + SourceIndex(0) +--- +>>>var _f = [3, "edging", "Trimming edges"][0], numberC2 = _f === void 0 ? -1 : _f; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >numberC2 = -1 +3 > +4 > numberC2 = -1 +5 > ] = [3, "edging", "Trimming edges"]; +1 >Emitted(6, 1) Source(12, 6) + SourceIndex(0) +2 >Emitted(6, 44) Source(12, 19) + SourceIndex(0) +3 >Emitted(6, 46) Source(12, 6) + SourceIndex(0) +4 >Emitted(6, 80) Source(12, 19) + SourceIndex(0) +5 >Emitted(6, 81) Source(12, 55) + SourceIndex(0) +--- +>>>var _g = [3, "edging", "Trimming edges"], _h = _g[0], numberC = _h === void 0 ? -1 : _h, _j = _g[1], nameC = _j === void 0 ? "noName" : _j, _k = _g[2], skillC = _k === void 0 ? "noSkill" : _k; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^ +1-> + > +2 > +3 > let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"] +4 > +5 > numberC = -1 +6 > +7 > numberC = -1 +8 > , +9 > nameC = "noName" +10> +11> nameC = "noName" +12> , +13> skillC = "noSkill" +14> +15> skillC = "noSkill" +16> ] = [3, "edging", "Trimming edges"]; +1->Emitted(7, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(7, 41) Source(13, 91) + SourceIndex(0) +4 >Emitted(7, 43) Source(13, 6) + SourceIndex(0) +5 >Emitted(7, 53) Source(13, 18) + SourceIndex(0) +6 >Emitted(7, 55) Source(13, 6) + SourceIndex(0) +7 >Emitted(7, 88) Source(13, 18) + SourceIndex(0) +8 >Emitted(7, 90) Source(13, 20) + SourceIndex(0) +9 >Emitted(7, 100) Source(13, 36) + SourceIndex(0) +10>Emitted(7, 102) Source(13, 20) + SourceIndex(0) +11>Emitted(7, 139) Source(13, 36) + SourceIndex(0) +12>Emitted(7, 141) Source(13, 38) + SourceIndex(0) +13>Emitted(7, 151) Source(13, 56) + SourceIndex(0) +14>Emitted(7, 153) Source(13, 38) + SourceIndex(0) +15>Emitted(7, 192) Source(13, 56) + SourceIndex(0) +16>Emitted(7, 193) Source(13, 92) + SourceIndex(0) +--- +>>>var _l = robotA[0], numberA3 = _l === void 0 ? -1 : _l, robotAInfo = robotA.slice(1); +1 > +2 >^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1 > + > + >let [ +2 >numberA3 = -1 +3 > +4 > numberA3 = -1 +5 > , +6 > ...robotAInfo +7 > ] = robotA; +1 >Emitted(8, 1) Source(15, 6) + SourceIndex(0) +2 >Emitted(8, 19) Source(15, 19) + SourceIndex(0) +3 >Emitted(8, 21) Source(15, 6) + SourceIndex(0) +4 >Emitted(8, 55) Source(15, 19) + SourceIndex(0) +5 >Emitted(8, 57) Source(15, 21) + SourceIndex(0) +6 >Emitted(8, 85) Source(15, 34) + SourceIndex(0) +7 >Emitted(8, 86) Source(15, 45) + SourceIndex(0) +--- +>>>if (nameA == nameA2) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameA2 +8 > ) +9 > +10> { +1 >Emitted(9, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(9, 3) Source(17, 3) + SourceIndex(0) +3 >Emitted(9, 4) Source(17, 4) + SourceIndex(0) +4 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) +5 >Emitted(9, 10) Source(17, 10) + SourceIndex(0) +6 >Emitted(9, 14) Source(17, 14) + SourceIndex(0) +7 >Emitted(9, 20) Source(17, 20) + SourceIndex(0) +8 >Emitted(9, 21) Source(17, 21) + SourceIndex(0) +9 >Emitted(9, 22) Source(17, 22) + SourceIndex(0) +10>Emitted(9, 23) Source(17, 23) + SourceIndex(0) +--- +>>> console.log(skillA2); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA2 +7 > ) +8 > ; +1->Emitted(10, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(10, 24) Source(18, 24) + SourceIndex(0) +7 >Emitted(10, 25) Source(18, 25) + SourceIndex(0) +8 >Emitted(10, 26) Source(18, 26) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.symbols new file mode 100644 index 00000000000..1800b3bd03c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 2, 1)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 5, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 2, 1)) + +let [, nameA = "noName"] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 7, 6)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) + +let [numberB = -1] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 8, 5)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 5, 3)) + +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; +>numberA2 : Symbol(numberA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 5)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 19)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 38)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +>numberC2 : Symbol(numberC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 11, 5)) + +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; +>numberC : Symbol(numberC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 12, 5)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 12, 18)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 12, 36)) + +let [numberA3 = -1, ...robotAInfo] = robotA; +>numberA3 : Symbol(numberA3, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 14, 5)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 14, 19)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 4, 3)) + +if (nameA == nameA2) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 7, 6)) +>nameA2 : Symbol(nameA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 19)) + + console.log(skillA2); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 0, 22)) +>skillA2 : Symbol(skillA2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts, 9, 38)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types new file mode 100644 index 00000000000..2dad459725e --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types @@ -0,0 +1,90 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +let [, nameA = "noName"] = robotA; +> : undefined +>nameA : string +>"noName" : string +>robotA : [number, string, string] + +let [numberB = -1] = robotB; +>numberB : number +>-1 : number +>1 : number +>robotB : [number, string, string] + +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; +>numberA2 : number +>-1 : number +>1 : number +>nameA2 : string +>"noName" : string +>skillA2 : string +>"noSkill" : string +>robotA : [number, string, string] + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +>numberC2 : number +>-1 : number +>1 : number +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; +>numberC : number +>-1 : number +>1 : number +>nameC : string +>"noName" : string +>skillC : string +>"noSkill" : string +>[3, "edging", "Trimming edges"] : [number, string, string] +>3 : number +>"edging" : string +>"Trimming edges" : string + +let [numberA3 = -1, ...robotAInfo] = robotA; +>numberA3 : number +>-1 : number +>1 : number +>robotAInfo : (number | string)[] +>robotA : [number, string, string] + +if (nameA == nameA2) { +>nameA == nameA2 : boolean +>nameA : string +>nameA2 : string + + console.log(skillA2); +>console.log(skillA2) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA2 : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js new file mode 100644 index 00000000000..b20e0be4fe0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js @@ -0,0 +1,31 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts] +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, string[]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +let [nameMB = "noName" ] = multiRobotB; +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js] +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var _a = multiRobotA[1], skillA = _a === void 0 ? ["noSkill", "noSkill"] : _a; +var _b = multiRobotB[0], nameMB = _b === void 0 ? "noName" : _b; +var _c = multiRobotA[0], nameMA = _c === void 0 ? "noName" : _c, _d = multiRobotA[1], _e = _d === void 0 ? ["noSkill", "noSkill"] : _d, _f = _e[0], primarySkillA = _f === void 0 ? "noSkill" : _f, _g = _e[1], secondarySkillA = _g === void 0 ? "noSkill" : _g; +var _h = ["roomba", ["vaccum", "mopping"]][0], nameMC = _h === void 0 ? "noName" : _h; +var _j = ["roomba", ["vaccum", "mopping"]], _k = _j[0], nameMC2 = _k === void 0 ? "noName" : _k, _l = _j[1], _m = _l === void 0 ? ["noSkill", "noSkill"] : _l, _o = _m[0], primarySkillC = _o === void 0 ? "noSkill" : _o, _p = _m[1], secondarySkillC = _p === void 0 ? "noSkill" : _p; +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map new file mode 100644 index 00000000000..11ca67c19ad --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,uBAA+B,EAA/B,oDAA+B,CAAgB;AACjD,uBAAiB,EAAjB,sCAAiB,CAAiB;AAClC,uBAAiB,EAAjB,sCAAiB,EAAE,mBAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAA0C;AAEpH,6CAAiB,EAAjB,sCAAiB,CAAuC;AAC7D,IAAA,sCAA+I,EAA1I,UAAkB,EAAlB,uCAAkB,EAAE,UAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAgE;AAEhJ,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt new file mode 100644 index 00000000000..30f2ee65592 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt @@ -0,0 +1,377 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts +------------------------------------------------------------------- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >type MultiSkilledRobot = [string, string[]]; + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1 >Emitted(1, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(5, 5) + SourceIndex(0) +3 >Emitted(1, 16) Source(5, 16) + SourceIndex(0) +4 >Emitted(1, 19) Source(5, 38) + SourceIndex(0) +5 >Emitted(1, 20) Source(5, 39) + SourceIndex(0) +6 >Emitted(1, 27) Source(5, 46) + SourceIndex(0) +7 >Emitted(1, 29) Source(5, 48) + SourceIndex(0) +8 >Emitted(1, 30) Source(5, 49) + SourceIndex(0) +9 >Emitted(1, 38) Source(5, 57) + SourceIndex(0) +10>Emitted(1, 40) Source(5, 59) + SourceIndex(0) +11>Emitted(1, 42) Source(5, 61) + SourceIndex(0) +12>Emitted(1, 43) Source(5, 62) + SourceIndex(0) +13>Emitted(1, 44) Source(5, 63) + SourceIndex(0) +14>Emitted(1, 45) Source(5, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(2, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(6, 5) + SourceIndex(0) +3 >Emitted(2, 16) Source(6, 16) + SourceIndex(0) +4 >Emitted(2, 19) Source(6, 38) + SourceIndex(0) +5 >Emitted(2, 20) Source(6, 39) + SourceIndex(0) +6 >Emitted(2, 29) Source(6, 48) + SourceIndex(0) +7 >Emitted(2, 31) Source(6, 50) + SourceIndex(0) +8 >Emitted(2, 32) Source(6, 51) + SourceIndex(0) +9 >Emitted(2, 42) Source(6, 61) + SourceIndex(0) +10>Emitted(2, 44) Source(6, 63) + SourceIndex(0) +11>Emitted(2, 52) Source(6, 71) + SourceIndex(0) +12>Emitted(2, 53) Source(6, 72) + SourceIndex(0) +13>Emitted(2, 54) Source(6, 73) + SourceIndex(0) +14>Emitted(2, 55) Source(6, 74) + SourceIndex(0) +--- +>>>var _a = multiRobotA[1], skillA = _a === void 0 ? ["noSkill", "noSkill"] : _a; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + > + >let [, +2 >skillA = ["noSkill", "noSkill"] +3 > +4 > skillA = ["noSkill", "noSkill"] +5 > ] = multiRobotA; +1->Emitted(3, 1) Source(8, 8) + SourceIndex(0) +2 >Emitted(3, 24) Source(8, 39) + SourceIndex(0) +3 >Emitted(3, 26) Source(8, 8) + SourceIndex(0) +4 >Emitted(3, 78) Source(8, 39) + SourceIndex(0) +5 >Emitted(3, 79) Source(8, 55) + SourceIndex(0) +--- +>>>var _b = multiRobotB[0], nameMB = _b === void 0 ? "noName" : _b; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >let [ +2 >nameMB = "noName" +3 > +4 > nameMB = "noName" +5 > ] = multiRobotB; +1 >Emitted(4, 1) Source(9, 6) + SourceIndex(0) +2 >Emitted(4, 24) Source(9, 23) + SourceIndex(0) +3 >Emitted(4, 26) Source(9, 6) + SourceIndex(0) +4 >Emitted(4, 64) Source(9, 23) + SourceIndex(0) +5 >Emitted(4, 65) Source(9, 40) + SourceIndex(0) +--- +>>>var _c = multiRobotA[0], nameMA = _c === void 0 ? "noName" : _c, _d = multiRobotA[1], _e = _d === void 0 ? ["noSkill", "noSkill"] : _d, _f = _e[0], primarySkillA = _f === void 0 ? "noSkill" : _f, _g = _e[1], secondarySkillA = _g === void 0 ? "noSkill" : _g; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^ +1-> + >let [ +2 >nameMA = "noName" +3 > +4 > nameMA = "noName" +5 > , +6 > [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"] +7 > +8 > [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"] +9 > +10> primarySkillA = "noSkill" +11> +12> primarySkillA = "noSkill" +13> , +14> secondarySkillA = "noSkill" +15> +16> secondarySkillA = "noSkill" +17> ] = ["noSkill", "noSkill"]] = multiRobotA; +1->Emitted(5, 1) Source(10, 6) + SourceIndex(0) +2 >Emitted(5, 24) Source(10, 23) + SourceIndex(0) +3 >Emitted(5, 26) Source(10, 6) + SourceIndex(0) +4 >Emitted(5, 64) Source(10, 23) + SourceIndex(0) +5 >Emitted(5, 66) Source(10, 25) + SourceIndex(0) +6 >Emitted(5, 85) Source(10, 106) + SourceIndex(0) +7 >Emitted(5, 87) Source(10, 25) + SourceIndex(0) +8 >Emitted(5, 135) Source(10, 106) + SourceIndex(0) +9 >Emitted(5, 137) Source(10, 26) + SourceIndex(0) +10>Emitted(5, 147) Source(10, 51) + SourceIndex(0) +11>Emitted(5, 149) Source(10, 26) + SourceIndex(0) +12>Emitted(5, 195) Source(10, 51) + SourceIndex(0) +13>Emitted(5, 197) Source(10, 53) + SourceIndex(0) +14>Emitted(5, 207) Source(10, 80) + SourceIndex(0) +15>Emitted(5, 209) Source(10, 53) + SourceIndex(0) +16>Emitted(5, 257) Source(10, 80) + SourceIndex(0) +17>Emitted(5, 258) Source(10, 122) + SourceIndex(0) +--- +>>>var _h = ["roomba", ["vaccum", "mopping"]][0], nameMC = _h === void 0 ? "noName" : _h; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >let [ +2 >nameMC = "noName" +3 > +4 > nameMC = "noName" +5 > ] = ["roomba", ["vaccum", "mopping"]]; +1 >Emitted(6, 1) Source(12, 6) + SourceIndex(0) +2 >Emitted(6, 46) Source(12, 23) + SourceIndex(0) +3 >Emitted(6, 48) Source(12, 6) + SourceIndex(0) +4 >Emitted(6, 86) Source(12, 23) + SourceIndex(0) +5 >Emitted(6, 87) Source(12, 62) + SourceIndex(0) +--- +>>>var _j = ["roomba", ["vaccum", "mopping"]], _k = _j[0], nameMC2 = _k === void 0 ? "noName" : _k, _l = _j[1], _m = _l === void 0 ? ["noSkill", "noSkill"] : _l, _o = _m[0], primarySkillC = _o === void 0 ? "noSkill" : _o, _p = _m[1], secondarySkillC = _p === void 0 ? "noSkill" : _p; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^ +1-> + > +2 > +3 > let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]] +4 > +5 > nameMC2 = "noName" +6 > +7 > nameMC2 = "noName" +8 > , +9 > [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"] +10> +11> [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"] +12> +13> primarySkillC = "noSkill" +14> +15> primarySkillC = "noSkill" +16> , +17> secondarySkillC = "noSkill" +18> +19> secondarySkillC = "noSkill" +20> ] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(7, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(7, 43) Source(13, 144) + SourceIndex(0) +4 >Emitted(7, 45) Source(13, 6) + SourceIndex(0) +5 >Emitted(7, 55) Source(13, 24) + SourceIndex(0) +6 >Emitted(7, 57) Source(13, 6) + SourceIndex(0) +7 >Emitted(7, 96) Source(13, 24) + SourceIndex(0) +8 >Emitted(7, 98) Source(13, 26) + SourceIndex(0) +9 >Emitted(7, 108) Source(13, 107) + SourceIndex(0) +10>Emitted(7, 110) Source(13, 26) + SourceIndex(0) +11>Emitted(7, 158) Source(13, 107) + SourceIndex(0) +12>Emitted(7, 160) Source(13, 27) + SourceIndex(0) +13>Emitted(7, 170) Source(13, 52) + SourceIndex(0) +14>Emitted(7, 172) Source(13, 27) + SourceIndex(0) +15>Emitted(7, 218) Source(13, 52) + SourceIndex(0) +16>Emitted(7, 220) Source(13, 54) + SourceIndex(0) +17>Emitted(7, 230) Source(13, 81) + SourceIndex(0) +18>Emitted(7, 232) Source(13, 54) + SourceIndex(0) +19>Emitted(7, 280) Source(13, 81) + SourceIndex(0) +20>Emitted(7, 281) Source(13, 145) + SourceIndex(0) +--- +>>>if (nameMB == nameMA) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^^ +6 > ^^^^ +7 > ^^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameMB +6 > == +7 > nameMA +8 > ) +9 > +10> { +1 >Emitted(8, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(8, 3) Source(15, 3) + SourceIndex(0) +3 >Emitted(8, 4) Source(15, 4) + SourceIndex(0) +4 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +5 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +6 >Emitted(8, 15) Source(15, 15) + SourceIndex(0) +7 >Emitted(8, 21) Source(15, 21) + SourceIndex(0) +8 >Emitted(8, 22) Source(15, 22) + SourceIndex(0) +9 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +10>Emitted(8, 24) Source(15, 24) + SourceIndex(0) +--- +>>> console.log(skillA[0] + skillA[1]); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ +11> ^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillA +7 > [ +8 > 0 +9 > ] +10> + +11> skillA +12> [ +13> 1 +14> ] +15> ) +16> ; +1->Emitted(9, 5) Source(16, 5) + SourceIndex(0) +2 >Emitted(9, 12) Source(16, 12) + SourceIndex(0) +3 >Emitted(9, 13) Source(16, 13) + SourceIndex(0) +4 >Emitted(9, 16) Source(16, 16) + SourceIndex(0) +5 >Emitted(9, 17) Source(16, 17) + SourceIndex(0) +6 >Emitted(9, 23) Source(16, 23) + SourceIndex(0) +7 >Emitted(9, 24) Source(16, 24) + SourceIndex(0) +8 >Emitted(9, 25) Source(16, 25) + SourceIndex(0) +9 >Emitted(9, 26) Source(16, 26) + SourceIndex(0) +10>Emitted(9, 29) Source(16, 29) + SourceIndex(0) +11>Emitted(9, 35) Source(16, 35) + SourceIndex(0) +12>Emitted(9, 36) Source(16, 36) + SourceIndex(0) +13>Emitted(9, 37) Source(16, 37) + SourceIndex(0) +14>Emitted(9, 38) Source(16, 38) + SourceIndex(0) +15>Emitted(9, 39) Source(16, 39) + SourceIndex(0) +16>Emitted(9, 40) Source(16, 40) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(17, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.symbols new file mode 100644 index 00000000000..76be77a8095 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 1, 8)) +} +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 4, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 2, 1)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 5, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 2, 1)) + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 7, 6)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 4, 3)) + +let [nameMB = "noName" ] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 8, 5)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 5, 3)) + +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 5)) +>primarySkillA : Symbol(primarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 25)) +>secondarySkillA : Symbol(secondarySkillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 51)) +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 4, 3)) + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : Symbol(nameMC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 11, 5)) + +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : Symbol(nameMC2, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 12, 5)) +>primarySkillC : Symbol(primarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 12, 26)) +>secondarySkillC : Symbol(secondarySkillC, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 12, 52)) + +if (nameMB == nameMA) { +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 8, 5)) +>nameMA : Symbol(nameMA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 9, 5)) + + console.log(skillA[0] + skillA[1]); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 0, 22)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 7, 6)) +>skillA : Symbol(skillA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts, 7, 6)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types new file mode 100644 index 00000000000..12215507d4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types @@ -0,0 +1,97 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : [string, string[]] + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["mower", ["mowing", ""]] : [string, string[]] +>"mower" : string +>["mowing", ""] : string[] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +> : undefined +>skillA : string[] +>["noSkill", "noSkill"] : string[] +>"noSkill" : string +>"noSkill" : string +>multiRobotA : [string, string[]] + +let [nameMB = "noName" ] = multiRobotB; +>nameMB : string +>"noName" : string +>multiRobotB : [string, string[]] + +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; +>nameMA : string +>"noName" : string +>primarySkillA : string +>"noSkill" : string +>secondarySkillA : string +>"noSkill" : string +>["noSkill", "noSkill"] : [string, string] +>"noSkill" : string +>"noSkill" : string +>multiRobotA : [string, string[]] + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +>nameMC : string +>"noName" : string +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; +>nameMC2 : string +>"noName" : string +>primarySkillC : string +>"noSkill" : string +>secondarySkillC : string +>"noSkill" : string +>["noSkill", "noSkill"] : [string, string] +>"noSkill" : string +>"noSkill" : string +>["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>"roomba" : string +>["vaccum", "mopping"] : [string, string] +>"vaccum" : string +>"mopping" : string + +if (nameMB == nameMA) { +>nameMB == nameMA : boolean +>nameMB : string +>nameMA : string + + console.log(skillA[0] + skillA[1]); +>console.log(skillA[0] + skillA[1]) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillA[0] + skillA[1] : string +>skillA[0] : string +>skillA : string[] +>0 : number +>skillA[1] : string +>skillA : string[] +>1 : number +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js new file mode 100644 index 00000000000..deb2680000f --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js @@ -0,0 +1,97 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts] +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | string[])[]; + +[, nameA = "helloNoName"] = robotA; +[, nameB = "helloNoName"] = getRobotB(); +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +[, multiSkillB = []] = multiRobotB; +[, multiSkillB = []] = getMultiRobotB(); +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; + +[numberB = -1] = robotB; +[numberB = -1] = getRobotB(); +[numberB = -1] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName"] = multiRobotB; +[nameMB = "helloNoName"] = getMultiRobotB(); +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, ...robotAInfo] = robotB; +[numberB = -1, ...robotAInfo] = getRobotB(); +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} + +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js] +var robotA = [1, "mower", "mowing"]; +var robotB = [2, "trimmer", "trimming"]; +var multiRobotA = ["mower", ["mowing", ""]]; +var multiRobotB = ["trimmer", ["trimming", "edging"]]; +var nameA, numberB, nameB, skillB; +var robotAInfo; +var multiSkillB, nameMB, primarySkillB, secondarySkillB; +var multiRobotAInfo; +_a = robotA[1], nameA = _a === void 0 ? "helloNoName" : _a; +_b = getRobotB(), _c = _b[1], nameB = _c === void 0 ? "helloNoName" : _c; +_d = [2, "trimmer", "trimming"], _e = _d[1], nameB = _e === void 0 ? "helloNoName" : _e; +_f = multiRobotB[1], multiSkillB = _f === void 0 ? [] : _f; +_g = getMultiRobotB(), _h = _g[1], multiSkillB = _h === void 0 ? [] : _h; +_j = ["roomba", ["vaccum", "mopping"]], _k = _j[1], multiSkillB = _k === void 0 ? [] : _k; +_l = robotB[0], numberB = _l === void 0 ? -1 : _l; +_m = getRobotB()[0], numberB = _m === void 0 ? -1 : _m; +_o = [2, "trimmer", "trimming"][0], numberB = _o === void 0 ? -1 : _o; +_p = multiRobotB[0], nameMB = _p === void 0 ? "helloNoName" : _p; +_q = getMultiRobotB()[0], nameMB = _q === void 0 ? "helloNoName" : _q; +_r = ["trimmer", ["trimming", "edging"]][0], nameMB = _r === void 0 ? "helloNoName" : _r; +_s = robotB[0], numberB = _s === void 0 ? -1 : _s, _t = robotB[1], nameB = _t === void 0 ? "helloNoName" : _t, _u = robotB[2], skillB = _u === void 0 ? "noSkill" : _u; +_v = getRobotB(), _w = _v[0], numberB = _w === void 0 ? -1 : _w, _x = _v[1], nameB = _x === void 0 ? "helloNoName" : _x, _y = _v[2], skillB = _y === void 0 ? "noSkill" : _y; +_z = [2, "trimmer", "trimming"], _0 = _z[0], numberB = _0 === void 0 ? -1 : _0, _1 = _z[1], nameB = _1 === void 0 ? "helloNoName" : _1, _2 = _z[2], skillB = _2 === void 0 ? "noSkill" : _2; +_3 = multiRobotB[0], nameMB = _3 === void 0 ? "helloNoName" : _3, _4 = multiRobotB[1], _5 = _4 === void 0 ? [] : _4, _6 = _5[0], primarySkillB = _6 === void 0 ? "noSkill" : _6, _7 = _5[1], secondarySkillB = _7 === void 0 ? "noSkill" : _7; +_8 = getMultiRobotB(), _9 = _8[0], nameMB = _9 === void 0 ? "helloNoName" : _9, _10 = _8[1], _11 = _10 === void 0 ? [] : _10, _12 = _11[0], primarySkillB = _12 === void 0 ? "noSkill" : _12, _13 = _11[1], secondarySkillB = _13 === void 0 ? "noSkill" : _13; +_14 = ["trimmer", ["trimming", "edging"]], _15 = _14[0], nameMB = _15 === void 0 ? "helloNoName" : _15, _16 = _14[1], _17 = _16 === void 0 ? [] : _16, _18 = _17[0], primarySkillB = _18 === void 0 ? "noSkill" : _18, _19 = _17[1], secondarySkillB = _19 === void 0 ? "noSkill" : _19; +_20 = robotB[0], numberB = _20 === void 0 ? -1 : _20, robotAInfo = robotB.slice(1); +_21 = getRobotB(), _22 = _21[0], numberB = _22 === void 0 ? -1 : _22, robotAInfo = _21.slice(1); +_23 = [2, "trimmer", "trimming"], _24 = _23[0], numberB = _24 === void 0 ? -1 : _24, robotAInfo = _23.slice(1); +if (nameA == nameB) { + console.log(skillB); +} +function getRobotB() { + return robotB; +} +function getMultiRobotB() { + return multiRobotB; +} +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24; +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map new file mode 100644 index 00000000000..1b7453826e4 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAAqB,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAC1F,IAAI,eAAsC,CAAC;AAExC,cAAqB,EAArB,0CAAqB,CAAW;AACnC,gBAAuC,EAApC,UAAqB,EAArB,0CAAqB,CAAgB;AACxC,+BAAsD,EAAnD,UAAqB,EAArB,0CAAqB,CAA+B;AACpD,mBAAgB,EAAhB,qCAAgB,CAAgB;AACnC,qBAAuC,EAApC,UAAgB,EAAhB,qCAAgB,CAAqB;AACxC,sCAAwD,EAArD,UAAgB,EAAhB,qCAAgB,CAAsC;AAExD,cAAY,EAAZ,iCAAY,CAAW;AACvB,mBAAY,EAAZ,iCAAY,CAAgB;AAC5B,kCAAY,EAAZ,iCAAY,CAA+B;AAC3C,mBAAsB,EAAtB,2CAAsB,CAAgB;AACtC,wBAAsB,EAAtB,2CAAsB,CAAqB;AAC3C,2CAAsB,EAAtB,2CAAsB,CAAwC;AAE9D,cAAY,EAAZ,iCAAY,EAAE,cAAqB,EAArB,0CAAqB,EAAE,cAAkB,EAAlB,uCAAkB,CAAW;AACnE,gBAAuE,EAAtE,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAAgB;AACxE,+BAAsF,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAA+B;AACtF,mBAAsB,EAAtB,2CAAsB,EAAE,mBAA6D,EAA7D,4BAA6D,EAA5D,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAsB;AACtG,qBAA0G,EAAzG,UAAsB,EAAtB,2CAAsB,EAAE,WAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CAA2B;AAC3G,yCACuC,EADtC,YAAsB,EAAtB,6CAAsB,EAAE,YAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CACxC;AAEvC,eAAY,EAAZ,mCAAY,EAAE,4BAAa,CAAW;AACvC,iBAA2C,EAA1C,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAgB;AAC5C,gCAAiE,EAAhE,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAsC;AAElE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt new file mode 100644 index 00000000000..c9784dc30a3 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt @@ -0,0 +1,1090 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js +mapUrl: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js +sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts +------------------------------------------------------------------- +>>>var robotA = [1, "mower", "mowing"]; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1 >declare var console: { + > log(msg: any): void; + >} + >type Robot = [number, string, string]; + >type MultiSkilledRobot = [string, string[]]; + > + > +2 >var +3 > robotA +4 > : Robot = +5 > [ +6 > 1 +7 > , +8 > "mower" +9 > , +10> "mowing" +11> ] +12> ; +1 >Emitted(1, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(7, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(7, 21) + SourceIndex(0) +5 >Emitted(1, 15) Source(7, 22) + SourceIndex(0) +6 >Emitted(1, 16) Source(7, 23) + SourceIndex(0) +7 >Emitted(1, 18) Source(7, 25) + SourceIndex(0) +8 >Emitted(1, 25) Source(7, 32) + SourceIndex(0) +9 >Emitted(1, 27) Source(7, 34) + SourceIndex(0) +10>Emitted(1, 35) Source(7, 42) + SourceIndex(0) +11>Emitted(1, 36) Source(7, 43) + SourceIndex(0) +12>Emitted(1, 37) Source(7, 44) + SourceIndex(0) +--- +>>>var robotB = [2, "trimmer", "trimming"]; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^ +12> ^ +13> ^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > [ +6 > 2 +7 > , +8 > "trimmer" +9 > , +10> "trimming" +11> ] +12> ; +1->Emitted(2, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(8, 21) + SourceIndex(0) +5 >Emitted(2, 15) Source(8, 22) + SourceIndex(0) +6 >Emitted(2, 16) Source(8, 23) + SourceIndex(0) +7 >Emitted(2, 18) Source(8, 25) + SourceIndex(0) +8 >Emitted(2, 27) Source(8, 34) + SourceIndex(0) +9 >Emitted(2, 29) Source(8, 36) + SourceIndex(0) +10>Emitted(2, 39) Source(8, 46) + SourceIndex(0) +11>Emitted(2, 40) Source(8, 47) + SourceIndex(0) +12>Emitted(2, 41) Source(8, 48) + SourceIndex(0) +--- +>>>var multiRobotA = ["mower", ["mowing", ""]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^ +10> ^^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >var +3 > multiRobotA +4 > : MultiSkilledRobot = +5 > [ +6 > "mower" +7 > , +8 > [ +9 > "mowing" +10> , +11> "" +12> ] +13> ] +14> ; +1->Emitted(3, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(3, 16) Source(9, 16) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 38) + SourceIndex(0) +5 >Emitted(3, 20) Source(9, 39) + SourceIndex(0) +6 >Emitted(3, 27) Source(9, 46) + SourceIndex(0) +7 >Emitted(3, 29) Source(9, 48) + SourceIndex(0) +8 >Emitted(3, 30) Source(9, 49) + SourceIndex(0) +9 >Emitted(3, 38) Source(9, 57) + SourceIndex(0) +10>Emitted(3, 40) Source(9, 59) + SourceIndex(0) +11>Emitted(3, 42) Source(9, 61) + SourceIndex(0) +12>Emitted(3, 43) Source(9, 62) + SourceIndex(0) +13>Emitted(3, 44) Source(9, 63) + SourceIndex(0) +14>Emitted(3, 45) Source(9, 64) + SourceIndex(0) +--- +>>>var multiRobotB = ["trimmer", ["trimming", "edging"]]; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^ +12> ^ +13> ^ +14> ^ +1-> + > +2 >var +3 > multiRobotB +4 > : MultiSkilledRobot = +5 > [ +6 > "trimmer" +7 > , +8 > [ +9 > "trimming" +10> , +11> "edging" +12> ] +13> ] +14> ; +1->Emitted(4, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(4, 16) Source(10, 16) + SourceIndex(0) +4 >Emitted(4, 19) Source(10, 38) + SourceIndex(0) +5 >Emitted(4, 20) Source(10, 39) + SourceIndex(0) +6 >Emitted(4, 29) Source(10, 48) + SourceIndex(0) +7 >Emitted(4, 31) Source(10, 50) + SourceIndex(0) +8 >Emitted(4, 32) Source(10, 51) + SourceIndex(0) +9 >Emitted(4, 42) Source(10, 61) + SourceIndex(0) +10>Emitted(4, 44) Source(10, 63) + SourceIndex(0) +11>Emitted(4, 52) Source(10, 71) + SourceIndex(0) +12>Emitted(4, 53) Source(10, 72) + SourceIndex(0) +13>Emitted(4, 54) Source(10, 73) + SourceIndex(0) +14>Emitted(4, 55) Source(10, 74) + SourceIndex(0) +--- +>>>var nameA, numberB, nameB, skillB; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^ +1 > + > + > +2 >let +3 > nameA: string +4 > , +5 > numberB: number +6 > , +7 > nameB: string +8 > , +9 > skillB: string +10> ; +1 >Emitted(5, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(5, 10) Source(12, 18) + SourceIndex(0) +4 >Emitted(5, 12) Source(12, 20) + SourceIndex(0) +5 >Emitted(5, 19) Source(12, 35) + SourceIndex(0) +6 >Emitted(5, 21) Source(12, 37) + SourceIndex(0) +7 >Emitted(5, 26) Source(12, 50) + SourceIndex(0) +8 >Emitted(5, 28) Source(12, 52) + SourceIndex(0) +9 >Emitted(5, 34) Source(12, 66) + SourceIndex(0) +10>Emitted(5, 35) Source(12, 67) + SourceIndex(0) +--- +>>>var robotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > robotAInfo: (number | string)[] +4 > ; +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 5) + SourceIndex(0) +3 >Emitted(6, 15) Source(13, 36) + SourceIndex(0) +4 >Emitted(6, 16) Source(13, 37) + SourceIndex(0) +--- +>>>var multiSkillB, nameMB, primarySkillB, secondarySkillB; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^ +1-> + > + > +2 >let +3 > multiSkillB: string[] +4 > , +5 > nameMB: string +6 > , +7 > primarySkillB: string +8 > , +9 > secondarySkillB: string +10> ; +1->Emitted(7, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(7, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(7, 16) Source(15, 26) + SourceIndex(0) +4 >Emitted(7, 18) Source(15, 28) + SourceIndex(0) +5 >Emitted(7, 24) Source(15, 42) + SourceIndex(0) +6 >Emitted(7, 26) Source(15, 44) + SourceIndex(0) +7 >Emitted(7, 39) Source(15, 65) + SourceIndex(0) +8 >Emitted(7, 41) Source(15, 67) + SourceIndex(0) +9 >Emitted(7, 56) Source(15, 90) + SourceIndex(0) +10>Emitted(7, 57) Source(15, 91) + SourceIndex(0) +--- +>>>var multiRobotAInfo; +1 > +2 >^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >let +3 > multiRobotAInfo: (string | string[])[] +4 > ; +1 >Emitted(8, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(8, 5) Source(16, 5) + SourceIndex(0) +3 >Emitted(8, 20) Source(16, 43) + SourceIndex(0) +4 >Emitted(8, 21) Source(16, 44) + SourceIndex(0) +--- +>>>_a = robotA[1], nameA = _a === void 0 ? "helloNoName" : _a; +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^-> +1-> + > + >[, +2 >nameA = "helloNoName" +3 > +4 > nameA = "helloNoName" +5 > ] = robotA; +1->Emitted(9, 1) Source(18, 4) + SourceIndex(0) +2 >Emitted(9, 15) Source(18, 25) + SourceIndex(0) +3 >Emitted(9, 17) Source(18, 4) + SourceIndex(0) +4 >Emitted(9, 59) Source(18, 25) + SourceIndex(0) +5 >Emitted(9, 60) Source(18, 36) + SourceIndex(0) +--- +>>>_b = getRobotB(), _c = _b[1], nameB = _c === void 0 ? "helloNoName" : _c; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, nameB = "helloNoName"] = getRobotB() +3 > +4 > nameB = "helloNoName" +5 > +6 > nameB = "helloNoName" +7 > ] = getRobotB(); +1->Emitted(10, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(10, 17) Source(19, 40) + SourceIndex(0) +3 >Emitted(10, 19) Source(19, 4) + SourceIndex(0) +4 >Emitted(10, 29) Source(19, 25) + SourceIndex(0) +5 >Emitted(10, 31) Source(19, 4) + SourceIndex(0) +6 >Emitted(10, 73) Source(19, 25) + SourceIndex(0) +7 >Emitted(10, 74) Source(19, 41) + SourceIndex(0) +--- +>>>_d = [2, "trimmer", "trimming"], _e = _d[1], nameB = _e === void 0 ? "helloNoName" : _e; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + > +2 >[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] +3 > +4 > nameB = "helloNoName" +5 > +6 > nameB = "helloNoName" +7 > ] = [2, "trimmer", "trimming"]; +1->Emitted(11, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(11, 32) Source(20, 55) + SourceIndex(0) +3 >Emitted(11, 34) Source(20, 4) + SourceIndex(0) +4 >Emitted(11, 44) Source(20, 25) + SourceIndex(0) +5 >Emitted(11, 46) Source(20, 4) + SourceIndex(0) +6 >Emitted(11, 88) Source(20, 25) + SourceIndex(0) +7 >Emitted(11, 89) Source(20, 56) + SourceIndex(0) +--- +>>>_f = multiRobotB[1], multiSkillB = _f === void 0 ? [] : _f; +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^-> +1 > + >[, +2 >multiSkillB = [] +3 > +4 > multiSkillB = [] +5 > ] = multiRobotB; +1 >Emitted(12, 1) Source(21, 4) + SourceIndex(0) +2 >Emitted(12, 20) Source(21, 20) + SourceIndex(0) +3 >Emitted(12, 22) Source(21, 4) + SourceIndex(0) +4 >Emitted(12, 59) Source(21, 20) + SourceIndex(0) +5 >Emitted(12, 60) Source(21, 36) + SourceIndex(0) +--- +>>>_g = getMultiRobotB(), _h = _g[1], multiSkillB = _h === void 0 ? [] : _h; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[, multiSkillB = []] = getMultiRobotB() +3 > +4 > multiSkillB = [] +5 > +6 > multiSkillB = [] +7 > ] = getMultiRobotB(); +1->Emitted(13, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(13, 22) Source(22, 40) + SourceIndex(0) +3 >Emitted(13, 24) Source(22, 4) + SourceIndex(0) +4 >Emitted(13, 34) Source(22, 20) + SourceIndex(0) +5 >Emitted(13, 36) Source(22, 4) + SourceIndex(0) +6 >Emitted(13, 73) Source(22, 20) + SourceIndex(0) +7 >Emitted(13, 74) Source(22, 41) + SourceIndex(0) +--- +>>>_j = ["roomba", ["vaccum", "mopping"]], _k = _j[1], multiSkillB = _k === void 0 ? [] : _k; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +1-> + > +2 >[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]] +3 > +4 > multiSkillB = [] +5 > +6 > multiSkillB = [] +7 > ] = ["roomba", ["vaccum", "mopping"]]; +1->Emitted(14, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(14, 39) Source(23, 57) + SourceIndex(0) +3 >Emitted(14, 41) Source(23, 4) + SourceIndex(0) +4 >Emitted(14, 51) Source(23, 20) + SourceIndex(0) +5 >Emitted(14, 53) Source(23, 4) + SourceIndex(0) +6 >Emitted(14, 90) Source(23, 20) + SourceIndex(0) +7 >Emitted(14, 91) Source(23, 58) + SourceIndex(0) +--- +>>>_l = robotB[0], numberB = _l === void 0 ? -1 : _l; +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^-> +1 > + > + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = robotB; +1 >Emitted(15, 1) Source(25, 2) + SourceIndex(0) +2 >Emitted(15, 15) Source(25, 14) + SourceIndex(0) +3 >Emitted(15, 17) Source(25, 2) + SourceIndex(0) +4 >Emitted(15, 50) Source(25, 14) + SourceIndex(0) +5 >Emitted(15, 51) Source(25, 25) + SourceIndex(0) +--- +>>>_m = getRobotB()[0], numberB = _m === void 0 ? -1 : _m; +1-> +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = getRobotB(); +1->Emitted(16, 1) Source(26, 2) + SourceIndex(0) +2 >Emitted(16, 20) Source(26, 14) + SourceIndex(0) +3 >Emitted(16, 22) Source(26, 2) + SourceIndex(0) +4 >Emitted(16, 55) Source(26, 14) + SourceIndex(0) +5 >Emitted(16, 56) Source(26, 30) + SourceIndex(0) +--- +>>>_o = [2, "trimmer", "trimming"][0], numberB = _o === void 0 ? -1 : _o; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +1-> + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > ] = [2, "trimmer", "trimming"]; +1->Emitted(17, 1) Source(27, 2) + SourceIndex(0) +2 >Emitted(17, 35) Source(27, 14) + SourceIndex(0) +3 >Emitted(17, 37) Source(27, 2) + SourceIndex(0) +4 >Emitted(17, 70) Source(27, 14) + SourceIndex(0) +5 >Emitted(17, 71) Source(27, 45) + SourceIndex(0) +--- +>>>_p = multiRobotB[0], nameMB = _p === void 0 ? "helloNoName" : _p; +1 > +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^-> +1 > + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > ] = multiRobotB; +1 >Emitted(18, 1) Source(28, 2) + SourceIndex(0) +2 >Emitted(18, 20) Source(28, 24) + SourceIndex(0) +3 >Emitted(18, 22) Source(28, 2) + SourceIndex(0) +4 >Emitted(18, 65) Source(28, 24) + SourceIndex(0) +5 >Emitted(18, 66) Source(28, 40) + SourceIndex(0) +--- +>>>_q = getMultiRobotB()[0], nameMB = _q === void 0 ? "helloNoName" : _q; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > ] = getMultiRobotB(); +1->Emitted(19, 1) Source(29, 2) + SourceIndex(0) +2 >Emitted(19, 25) Source(29, 24) + SourceIndex(0) +3 >Emitted(19, 27) Source(29, 2) + SourceIndex(0) +4 >Emitted(19, 70) Source(29, 24) + SourceIndex(0) +5 >Emitted(19, 71) Source(29, 45) + SourceIndex(0) +--- +>>>_r = ["trimmer", ["trimming", "edging"]][0], nameMB = _r === void 0 ? "helloNoName" : _r; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > ] = ["trimmer", ["trimming", "edging"]]; +1->Emitted(20, 1) Source(30, 2) + SourceIndex(0) +2 >Emitted(20, 44) Source(30, 24) + SourceIndex(0) +3 >Emitted(20, 46) Source(30, 2) + SourceIndex(0) +4 >Emitted(20, 89) Source(30, 24) + SourceIndex(0) +5 >Emitted(20, 90) Source(30, 64) + SourceIndex(0) +--- +>>>_s = robotB[0], numberB = _s === void 0 ? -1 : _s, _t = robotB[1], nameB = _t === void 0 ? "helloNoName" : _t, _u = robotB[2], skillB = _u === void 0 ? "noSkill" : _u; +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^^-> +1-> + > + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > , +6 > nameB = "helloNoName" +7 > +8 > nameB = "helloNoName" +9 > , +10> skillB = "noSkill" +11> +12> skillB = "noSkill" +13> ] = robotB; +1->Emitted(21, 1) Source(32, 2) + SourceIndex(0) +2 >Emitted(21, 15) Source(32, 14) + SourceIndex(0) +3 >Emitted(21, 17) Source(32, 2) + SourceIndex(0) +4 >Emitted(21, 50) Source(32, 14) + SourceIndex(0) +5 >Emitted(21, 52) Source(32, 16) + SourceIndex(0) +6 >Emitted(21, 66) Source(32, 37) + SourceIndex(0) +7 >Emitted(21, 68) Source(32, 16) + SourceIndex(0) +8 >Emitted(21, 110) Source(32, 37) + SourceIndex(0) +9 >Emitted(21, 112) Source(32, 39) + SourceIndex(0) +10>Emitted(21, 126) Source(32, 57) + SourceIndex(0) +11>Emitted(21, 128) Source(32, 39) + SourceIndex(0) +12>Emitted(21, 167) Source(32, 57) + SourceIndex(0) +13>Emitted(21, 168) Source(32, 68) + SourceIndex(0) +--- +>>>_v = getRobotB(), _w = _v[0], numberB = _w === void 0 ? -1 : _w, _x = _v[1], nameB = _x === void 0 ? "helloNoName" : _x, _y = _v[2], skillB = _y === void 0 ? "noSkill" : _y; +1-> +2 >^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^ +16> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB() +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > nameB = "helloNoName" +9 > +10> nameB = "helloNoName" +11> , +12> skillB = "noSkill" +13> +14> skillB = "noSkill" +15> ] = getRobotB(); +1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(22, 17) Source(33, 72) + SourceIndex(0) +3 >Emitted(22, 19) Source(33, 2) + SourceIndex(0) +4 >Emitted(22, 29) Source(33, 14) + SourceIndex(0) +5 >Emitted(22, 31) Source(33, 2) + SourceIndex(0) +6 >Emitted(22, 64) Source(33, 14) + SourceIndex(0) +7 >Emitted(22, 66) Source(33, 16) + SourceIndex(0) +8 >Emitted(22, 76) Source(33, 37) + SourceIndex(0) +9 >Emitted(22, 78) Source(33, 16) + SourceIndex(0) +10>Emitted(22, 120) Source(33, 37) + SourceIndex(0) +11>Emitted(22, 122) Source(33, 39) + SourceIndex(0) +12>Emitted(22, 132) Source(33, 57) + SourceIndex(0) +13>Emitted(22, 134) Source(33, 39) + SourceIndex(0) +14>Emitted(22, 173) Source(33, 57) + SourceIndex(0) +15>Emitted(22, 174) Source(33, 73) + SourceIndex(0) +--- +>>>_z = [2, "trimmer", "trimming"], _0 = _z[0], numberB = _0 === void 0 ? -1 : _0, _1 = _z[1], nameB = _1 === void 0 ? "helloNoName" : _1, _2 = _z[2], skillB = _2 === void 0 ? "noSkill" : _2; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > nameB = "helloNoName" +9 > +10> nameB = "helloNoName" +11> , +12> skillB = "noSkill" +13> +14> skillB = "noSkill" +15> ] = [2, "trimmer", "trimming"]; +1->Emitted(23, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(23, 32) Source(34, 87) + SourceIndex(0) +3 >Emitted(23, 34) Source(34, 2) + SourceIndex(0) +4 >Emitted(23, 44) Source(34, 14) + SourceIndex(0) +5 >Emitted(23, 46) Source(34, 2) + SourceIndex(0) +6 >Emitted(23, 79) Source(34, 14) + SourceIndex(0) +7 >Emitted(23, 81) Source(34, 16) + SourceIndex(0) +8 >Emitted(23, 91) Source(34, 37) + SourceIndex(0) +9 >Emitted(23, 93) Source(34, 16) + SourceIndex(0) +10>Emitted(23, 135) Source(34, 37) + SourceIndex(0) +11>Emitted(23, 137) Source(34, 39) + SourceIndex(0) +12>Emitted(23, 147) Source(34, 57) + SourceIndex(0) +13>Emitted(23, 149) Source(34, 39) + SourceIndex(0) +14>Emitted(23, 188) Source(34, 57) + SourceIndex(0) +15>Emitted(23, 189) Source(34, 88) + SourceIndex(0) +--- +>>>_3 = multiRobotB[0], nameMB = _3 === void 0 ? "helloNoName" : _3, _4 = multiRobotB[1], _5 = _4 === void 0 ? [] : _4, _6 = _5[0], primarySkillB = _6 === void 0 ? "noSkill" : _6, _7 = _5[1], secondarySkillB = _7 === void 0 ? "noSkill" : _7; +1-> +2 >^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^ +18> ^^^^^^^^^^^^^^^^^^-> +1-> + >[ +2 >nameMB = "helloNoName" +3 > +4 > nameMB = "helloNoName" +5 > , +6 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +7 > +8 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +9 > +10> primarySkillB = "noSkill" +11> +12> primarySkillB = "noSkill" +13> , +14> secondarySkillB = "noSkill" +15> +16> secondarySkillB = "noSkill" +17> ] = []] = multiRobotB; +1->Emitted(24, 1) Source(35, 2) + SourceIndex(0) +2 >Emitted(24, 20) Source(35, 24) + SourceIndex(0) +3 >Emitted(24, 22) Source(35, 2) + SourceIndex(0) +4 >Emitted(24, 65) Source(35, 24) + SourceIndex(0) +5 >Emitted(24, 67) Source(35, 26) + SourceIndex(0) +6 >Emitted(24, 86) Source(35, 87) + SourceIndex(0) +7 >Emitted(24, 88) Source(35, 26) + SourceIndex(0) +8 >Emitted(24, 116) Source(35, 87) + SourceIndex(0) +9 >Emitted(24, 118) Source(35, 27) + SourceIndex(0) +10>Emitted(24, 128) Source(35, 52) + SourceIndex(0) +11>Emitted(24, 130) Source(35, 27) + SourceIndex(0) +12>Emitted(24, 176) Source(35, 52) + SourceIndex(0) +13>Emitted(24, 178) Source(35, 54) + SourceIndex(0) +14>Emitted(24, 188) Source(35, 81) + SourceIndex(0) +15>Emitted(24, 190) Source(35, 54) + SourceIndex(0) +16>Emitted(24, 238) Source(35, 81) + SourceIndex(0) +17>Emitted(24, 239) Source(35, 103) + SourceIndex(0) +--- +>>>_8 = getMultiRobotB(), _9 = _8[0], nameMB = _9 === void 0 ? "helloNoName" : _9, _10 = _8[1], _11 = _10 === void 0 ? [] : _10, _12 = _11[0], primarySkillB = _12 === void 0 ? "noSkill" : _12, _13 = _11[1], secondarySkillB = _13 === void 0 ? "noSkill" : _13; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() +3 > +4 > nameMB = "helloNoName" +5 > +6 > nameMB = "helloNoName" +7 > , +8 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +9 > +10> [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +11> +12> primarySkillB = "noSkill" +13> +14> primarySkillB = "noSkill" +15> , +16> secondarySkillB = "noSkill" +17> +18> secondarySkillB = "noSkill" +19> ] = []] = getMultiRobotB(); +1->Emitted(25, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(25, 22) Source(36, 107) + SourceIndex(0) +3 >Emitted(25, 24) Source(36, 2) + SourceIndex(0) +4 >Emitted(25, 34) Source(36, 24) + SourceIndex(0) +5 >Emitted(25, 36) Source(36, 2) + SourceIndex(0) +6 >Emitted(25, 79) Source(36, 24) + SourceIndex(0) +7 >Emitted(25, 81) Source(36, 26) + SourceIndex(0) +8 >Emitted(25, 92) Source(36, 87) + SourceIndex(0) +9 >Emitted(25, 94) Source(36, 26) + SourceIndex(0) +10>Emitted(25, 125) Source(36, 87) + SourceIndex(0) +11>Emitted(25, 127) Source(36, 27) + SourceIndex(0) +12>Emitted(25, 139) Source(36, 52) + SourceIndex(0) +13>Emitted(25, 141) Source(36, 27) + SourceIndex(0) +14>Emitted(25, 189) Source(36, 52) + SourceIndex(0) +15>Emitted(25, 191) Source(36, 54) + SourceIndex(0) +16>Emitted(25, 203) Source(36, 81) + SourceIndex(0) +17>Emitted(25, 205) Source(36, 54) + SourceIndex(0) +18>Emitted(25, 255) Source(36, 81) + SourceIndex(0) +19>Emitted(25, 256) Source(36, 108) + SourceIndex(0) +--- +>>>_14 = ["trimmer", ["trimming", "edging"]], _15 = _14[0], nameMB = _15 === void 0 ? "helloNoName" : _15, _16 = _14[1], _17 = _16 === void 0 ? [] : _16, _18 = _17[0], primarySkillB = _18 === void 0 ? "noSkill" : _18, _19 = _17[1], secondarySkillB = _19 === void 0 ? "noSkill" : _19; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^ +1-> + > +2 >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + > ["trimmer", ["trimming", "edging"]] +3 > +4 > nameMB = "helloNoName" +5 > +6 > nameMB = "helloNoName" +7 > , +8 > [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +9 > +10> [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] +11> +12> primarySkillB = "noSkill" +13> +14> primarySkillB = "noSkill" +15> , +16> secondarySkillB = "noSkill" +17> +18> secondarySkillB = "noSkill" +19> ] = []] = + > ["trimmer", ["trimming", "edging"]]; +1->Emitted(26, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(26, 42) Source(38, 40) + SourceIndex(0) +3 >Emitted(26, 44) Source(37, 2) + SourceIndex(0) +4 >Emitted(26, 56) Source(37, 24) + SourceIndex(0) +5 >Emitted(26, 58) Source(37, 2) + SourceIndex(0) +6 >Emitted(26, 103) Source(37, 24) + SourceIndex(0) +7 >Emitted(26, 105) Source(37, 26) + SourceIndex(0) +8 >Emitted(26, 117) Source(37, 87) + SourceIndex(0) +9 >Emitted(26, 119) Source(37, 26) + SourceIndex(0) +10>Emitted(26, 150) Source(37, 87) + SourceIndex(0) +11>Emitted(26, 152) Source(37, 27) + SourceIndex(0) +12>Emitted(26, 164) Source(37, 52) + SourceIndex(0) +13>Emitted(26, 166) Source(37, 27) + SourceIndex(0) +14>Emitted(26, 214) Source(37, 52) + SourceIndex(0) +15>Emitted(26, 216) Source(37, 54) + SourceIndex(0) +16>Emitted(26, 228) Source(37, 81) + SourceIndex(0) +17>Emitted(26, 230) Source(37, 54) + SourceIndex(0) +18>Emitted(26, 280) Source(37, 81) + SourceIndex(0) +19>Emitted(26, 281) Source(38, 41) + SourceIndex(0) +--- +>>>_20 = robotB[0], numberB = _20 === void 0 ? -1 : _20, robotAInfo = robotB.slice(1); +1 > +2 >^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^-> +1 > + > + >[ +2 >numberB = -1 +3 > +4 > numberB = -1 +5 > , +6 > ...robotAInfo +7 > ] = robotB; +1 >Emitted(27, 1) Source(40, 2) + SourceIndex(0) +2 >Emitted(27, 16) Source(40, 14) + SourceIndex(0) +3 >Emitted(27, 18) Source(40, 2) + SourceIndex(0) +4 >Emitted(27, 53) Source(40, 14) + SourceIndex(0) +5 >Emitted(27, 55) Source(40, 16) + SourceIndex(0) +6 >Emitted(27, 83) Source(40, 29) + SourceIndex(0) +7 >Emitted(27, 84) Source(40, 40) + SourceIndex(0) +--- +>>>_21 = getRobotB(), _22 = _21[0], numberB = _22 === void 0 ? -1 : _22, robotAInfo = _21.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^-> +1-> + > +2 >[numberB = -1, ...robotAInfo] = getRobotB() +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > ...robotAInfo +9 > ] = getRobotB(); +1->Emitted(28, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(28, 18) Source(41, 44) + SourceIndex(0) +3 >Emitted(28, 20) Source(41, 2) + SourceIndex(0) +4 >Emitted(28, 32) Source(41, 14) + SourceIndex(0) +5 >Emitted(28, 34) Source(41, 2) + SourceIndex(0) +6 >Emitted(28, 69) Source(41, 14) + SourceIndex(0) +7 >Emitted(28, 71) Source(41, 16) + SourceIndex(0) +8 >Emitted(28, 96) Source(41, 29) + SourceIndex(0) +9 >Emitted(28, 97) Source(41, 45) + SourceIndex(0) +--- +>>>_23 = [2, "trimmer", "trimming"], _24 = _23[0], numberB = _24 === void 0 ? -1 : _24, robotAInfo = _23.slice(1); +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +1-> + > +2 >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > , +8 > ...robotAInfo +9 > ] = [2, "trimmer", "trimming"]; +1->Emitted(29, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(29, 33) Source(42, 66) + SourceIndex(0) +3 >Emitted(29, 35) Source(42, 2) + SourceIndex(0) +4 >Emitted(29, 47) Source(42, 14) + SourceIndex(0) +5 >Emitted(29, 49) Source(42, 2) + SourceIndex(0) +6 >Emitted(29, 84) Source(42, 14) + SourceIndex(0) +7 >Emitted(29, 86) Source(42, 16) + SourceIndex(0) +8 >Emitted(29, 111) Source(42, 29) + SourceIndex(0) +9 >Emitted(29, 112) Source(42, 67) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 3) Source(44, 3) + SourceIndex(0) +3 >Emitted(30, 4) Source(44, 4) + SourceIndex(0) +4 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) +5 >Emitted(30, 10) Source(44, 10) + SourceIndex(0) +6 >Emitted(30, 14) Source(44, 14) + SourceIndex(0) +7 >Emitted(30, 19) Source(44, 19) + SourceIndex(0) +8 >Emitted(30, 20) Source(44, 20) + SourceIndex(0) +9 >Emitted(30, 21) Source(44, 21) + SourceIndex(0) +10>Emitted(30, 22) Source(44, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(31, 5) Source(45, 5) + SourceIndex(0) +2 >Emitted(31, 12) Source(45, 12) + SourceIndex(0) +3 >Emitted(31, 13) Source(45, 13) + SourceIndex(0) +4 >Emitted(31, 16) Source(45, 16) + SourceIndex(0) +5 >Emitted(31, 17) Source(45, 17) + SourceIndex(0) +6 >Emitted(31, 23) Source(45, 23) + SourceIndex(0) +7 >Emitted(31, 24) Source(45, 24) + SourceIndex(0) +8 >Emitted(31, 25) Source(45, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(32, 1) Source(46, 1) + SourceIndex(0) +2 >Emitted(32, 2) Source(46, 2) + SourceIndex(0) +--- +>>>function getRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(33, 1) Source(48, 1) + SourceIndex(0) +--- +>>> return robotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +1->function getRobotB() { + > +2 > return +3 > +4 > robotB +5 > ; +1->Emitted(34, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(34, 11) Source(49, 11) + SourceIndex(0) +3 >Emitted(34, 12) Source(49, 12) + SourceIndex(0) +4 >Emitted(34, 18) Source(49, 18) + SourceIndex(0) +5 >Emitted(34, 19) Source(49, 19) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(35, 1) Source(50, 1) + SourceIndex(0) +2 >Emitted(35, 2) Source(50, 2) + SourceIndex(0) +--- +>>>function getMultiRobotB() { +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(36, 1) Source(52, 1) + SourceIndex(0) +--- +>>> return multiRobotB; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^ +5 > ^ +1->function getMultiRobotB() { + > +2 > return +3 > +4 > multiRobotB +5 > ; +1->Emitted(37, 5) Source(53, 5) + SourceIndex(0) +2 >Emitted(37, 11) Source(53, 11) + SourceIndex(0) +3 >Emitted(37, 12) Source(53, 12) + SourceIndex(0) +4 >Emitted(37, 23) Source(53, 23) + SourceIndex(0) +5 >Emitted(37, 24) Source(53, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(38, 1) Source(54, 1) + SourceIndex(0) +2 >Emitted(38, 2) Source(54, 2) + SourceIndex(0) +--- +>>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24; +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.symbols new file mode 100644 index 00000000000..c4d6b52fc4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.symbols @@ -0,0 +1,167 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 11)) + + log(msg: any): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 1, 8)) +} +type Robot = [number, string, string]; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 3, 38)) + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 6, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : Symbol(multiRobotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 8, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 3, 38)) + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) +>MultiSkilledRobot : Symbol(MultiSkilledRobot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 3, 38)) + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 3)) +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) + +let robotAInfo: (number | string)[]; +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) + +let multiRobotAInfo: (string | string[])[]; +>multiRobotAInfo : Symbol(multiRobotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 15, 3)) + +[, nameA = "helloNoName"] = robotA; +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 3)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 6, 3)) + +[, nameB = "helloNoName"] = getRobotB(); +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) + +[, multiSkillB = []] = multiRobotB; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) + +[, multiSkillB = []] = getMultiRobotB(); +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; +>multiSkillB : Symbol(multiSkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 3)) + +[numberB = -1] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) + +[numberB = -1] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[numberB = -1] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) + +[nameMB = "helloNoName"] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) + +[nameMB = "helloNoName"] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = +>nameMB : Symbol(nameMB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 26)) +>primarySkillB : Symbol(primarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 42)) +>secondarySkillB : Symbol(secondarySkillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 14, 65)) + + ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, ...robotAInfo] = robotB; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) + +[numberB = -1, ...robotAInfo] = getRobotB(); +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; +>numberB : Symbol(numberB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 18)) +>robotAInfo : Symbol(robotAInfo, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 12, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 2, 1)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 3)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 35)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 0, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 11, 50)) +} + +function getRobotB() { +>getRobotB : Symbol(getRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 45, 1)) + + return robotB; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 7, 3)) +} + +function getMultiRobotB() { +>getMultiRobotB : Symbol(getMultiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 49, 1)) + + return multiRobotB; +>multiRobotB : Symbol(multiRobotB, Decl(sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts, 9, 3)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types new file mode 100644 index 00000000000..7edf6c63e4a --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types @@ -0,0 +1,361 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts === +declare var console: { +>console : { log(msg: any): void; } + + log(msg: any): void; +>log : (msg: any) => void +>msg : any +} +type Robot = [number, string, string]; +>Robot : [number, string, string] + +type MultiSkilledRobot = [string, string[]]; +>MultiSkilledRobot : [string, string[]] + +var robotA: Robot = [1, "mower", "mowing"]; +>robotA : [number, string, string] +>Robot : [number, string, string] +>[1, "mower", "mowing"] : [number, string, string] +>1 : number +>"mower" : string +>"mowing" : string + +var robotB: Robot = [2, "trimmer", "trimming"]; +>robotB : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +>multiRobotA : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["mower", ["mowing", ""]] : [string, string[]] +>"mower" : string +>["mowing", ""] : string[] +>"mowing" : string +>"" : string + +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +>multiRobotB : [string, string[]] +>MultiSkilledRobot : [string, string[]] +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +let nameA: string, numberB: number, nameB: string, skillB: string; +>nameA : string +>numberB : number +>nameB : string +>skillB : string + +let robotAInfo: (number | string)[]; +>robotAInfo : (number | string)[] + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +>multiSkillB : string[] +>nameMB : string +>primarySkillB : string +>secondarySkillB : string + +let multiRobotAInfo: (string | string[])[]; +>multiRobotAInfo : (string | string[])[] + +[, nameA = "helloNoName"] = robotA; +>[, nameA = "helloNoName"] = robotA : [number, string, string] +>[, nameA = "helloNoName"] : [undefined, string] +> : undefined +>nameA = "helloNoName" : string +>nameA : string +>"helloNoName" : string +>robotA : [number, string, string] + +[, nameB = "helloNoName"] = getRobotB(); +>[, nameB = "helloNoName"] = getRobotB() : [number, string, string] +>[, nameB = "helloNoName"] : [undefined, string] +> : undefined +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +>[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameB = "helloNoName"] : [undefined, string] +> : undefined +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[, multiSkillB = []] = multiRobotB; +>[, multiSkillB = []] = multiRobotB : [string, string[]] +>[, multiSkillB = []] : [undefined, undefined[]] +> : undefined +>multiSkillB = [] : undefined[] +>multiSkillB : string[] +>[] : undefined[] +>multiRobotB : [string, string[]] + +[, multiSkillB = []] = getMultiRobotB(); +>[, multiSkillB = []] = getMultiRobotB() : [string, string[]] +>[, multiSkillB = []] : [undefined, undefined[]] +> : undefined +>multiSkillB = [] : undefined[] +>multiSkillB : string[] +>[] : undefined[] +>getMultiRobotB() : [string, string[]] +>getMultiRobotB : () => [string, string[]] + +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; +>[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]] : [string, string[]] +>[, multiSkillB = []] : [undefined, undefined[]] +> : undefined +>multiSkillB = [] : undefined[] +>multiSkillB : string[] +>[] : undefined[] +>["roomba", ["vaccum", "mopping"]] : [string, string[]] +>"roomba" : string +>["vaccum", "mopping"] : string[] +>"vaccum" : string +>"mopping" : string + +[numberB = -1] = robotB; +>[numberB = -1] = robotB : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>robotB : [number, string, string] + +[numberB = -1] = getRobotB(); +>[numberB = -1] = getRobotB() : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB = -1] = [2, "trimmer", "trimming"]; +>[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1] : [number] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB = "helloNoName"] = multiRobotB; +>[nameMB = "helloNoName"] = multiRobotB : [string, string[]] +>[nameMB = "helloNoName"] : [string] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>multiRobotB : [string, string[]] + +[nameMB = "helloNoName"] = getMultiRobotB(); +>[nameMB = "helloNoName"] = getMultiRobotB() : [string, string[]] +>[nameMB = "helloNoName"] : [string] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>getMultiRobotB() : [string, string[]] +>getMultiRobotB : () => [string, string[]] + +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; +>[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameMB = "helloNoName"] : [string] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>["trimmer", ["trimming", "edging"]] : [string, string[]] +>"trimmer" : string +>["trimming", "edging"] : string[] +>"trimming" : string +>"edging" : string + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB : [number, string, string] +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>skillB = "noSkill" : string +>skillB : string +>"noSkill" : string +>robotB : [number, string, string] + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB() : [number, string, string] +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>skillB = "noSkill" : string +>skillB : string +>"noSkill" : string +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>nameB = "helloNoName" : string +>nameB : string +>"helloNoName" : string +>skillB = "noSkill" : string +>skillB : string +>"noSkill" : string +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB : [string, string[]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] +>primarySkillB = "noSkill" : string +>primarySkillB : string +>"noSkill" : string +>secondarySkillB = "noSkill" : string +>secondarySkillB : string +>"noSkill" : string +>[] : [string, string] +>multiRobotB : [string, string[]] + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() : [string, string[]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] +>primarySkillB = "noSkill" : string +>primarySkillB : string +>"noSkill" : string +>secondarySkillB = "noSkill" : string +>secondarySkillB : string +>"noSkill" : string +>[] : [string, string] +>getMultiRobotB() : [string, string[]] +>getMultiRobotB : () => [string, string[]] + +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] +>nameMB = "helloNoName" : string +>nameMB : string +>"helloNoName" : string +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] +>primarySkillB = "noSkill" : string +>primarySkillB : string +>"noSkill" : string +>secondarySkillB = "noSkill" : string +>secondarySkillB : string +>"noSkill" : string +>[] : [string, string] + + ["trimmer", ["trimming", "edging"]]; +>["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>"trimmer" : string +>["trimming", "edging"] : [string, string] +>"trimming" : string +>"edging" : string + +[numberB = -1, ...robotAInfo] = robotB; +>[numberB = -1, ...robotAInfo] = robotB : [number, string, string] +>[numberB = -1, ...robotAInfo] : (number | string)[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>robotB : [number, string, string] + +[numberB = -1, ...robotAInfo] = getRobotB(); +>[numberB = -1, ...robotAInfo] = getRobotB() : [number, string, string] +>[numberB = -1, ...robotAInfo] : (number | string)[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>getRobotB() : [number, string, string] +>getRobotB : () => [number, string, string] + +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; +>[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1, ...robotAInfo] : (number | string)[] +>numberB = -1 : number +>numberB : number +>-1 : number +>1 : number +>...robotAInfo : number | string +>robotAInfo : (number | string)[] +>[2, "trimmer", "trimming"] : [number, string, string] +>Robot : [number, string, string] +>[2, "trimmer", "trimming"] : [number, string, string] +>2 : number +>"trimmer" : string +>"trimming" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: any) => void +>console : { log(msg: any): void; } +>log : (msg: any) => void +>skillB : string +} + +function getRobotB() { +>getRobotB : () => [number, string, string] + + return robotB; +>robotB : [number, string, string] +} + +function getMultiRobotB() { +>getMultiRobotB : () => [string, string[]] + + return multiRobotB; +>multiRobotB : [string, string[]] +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js new file mode 100644 index 00000000000..64dea954ae7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js @@ -0,0 +1,35 @@ +//// [sourceMapValidationDestructuringVariableStatementDefaultValues.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA = "" } = robotA; +var { name: nameB = "", skill: skillB = "" } = robotB; +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatementDefaultValues.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +var robotB = { name: "trimmer", skill: "trimming" }; +var _a = robotA.name, nameA = _a === void 0 ? "" : _a; +var _b = robotB.name, nameB = _b === void 0 ? "" : _b, _c = robotB.skill, skillB = _c === void 0 ? "" : _c; +var _d = { name: "Edger", skill: "cutting edges" }, _e = _d.name, nameC = _e === void 0 ? "" : _e, _f = _d.skill, skillC = _f === void 0 ? "" : _f; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map new file mode 100644 index 00000000000..d85d9d2d669 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementDefaultValues.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,oBAAwB,EAAxB,uCAAwB,CAAY;AACpC,oBAAwB,EAAxB,uCAAwB,EAAE,iBAAoC,EAApC,kDAAoC,CAAY;AAChF,IAAA,8CAAkH,EAA5G,YAAwB,EAAxB,uCAAwB,EAAE,aAAoC,EAApC,kDAAoC,CAA+C;AACnH,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..12e5526e77c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt @@ -0,0 +1,344 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementDefaultValues.js +mapUrl: sourceMapValidationDestructuringVariableStatementDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.js +sourceFile:sourceMapValidationDestructuringVariableStatementDefaultValues.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^-> +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skill: "trimming" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^^^^^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skill +11> : +12> "trimming" +13> } +14> ; +1->Emitted(3, 1) Source(10, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(10, 5) + SourceIndex(0) +3 >Emitted(3, 11) Source(10, 11) + SourceIndex(0) +4 >Emitted(3, 14) Source(10, 21) + SourceIndex(0) +5 >Emitted(3, 16) Source(10, 23) + SourceIndex(0) +6 >Emitted(3, 20) Source(10, 27) + SourceIndex(0) +7 >Emitted(3, 22) Source(10, 29) + SourceIndex(0) +8 >Emitted(3, 31) Source(10, 38) + SourceIndex(0) +9 >Emitted(3, 33) Source(10, 40) + SourceIndex(0) +10>Emitted(3, 38) Source(10, 45) + SourceIndex(0) +11>Emitted(3, 40) Source(10, 47) + SourceIndex(0) +12>Emitted(3, 50) Source(10, 57) + SourceIndex(0) +13>Emitted(3, 52) Source(10, 59) + SourceIndex(0) +14>Emitted(3, 53) Source(10, 60) + SourceIndex(0) +--- +>>>var _a = robotA.name, nameA = _a === void 0 ? "" : _a; +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameA = "" +3 > +4 > name: nameA = "" +5 > } = robotA; +1->Emitted(4, 1) Source(11, 7) + SourceIndex(0) +2 >Emitted(4, 21) Source(11, 31) + SourceIndex(0) +3 >Emitted(4, 23) Source(11, 7) + SourceIndex(0) +4 >Emitted(4, 62) Source(11, 31) + SourceIndex(0) +5 >Emitted(4, 63) Source(11, 43) + SourceIndex(0) +--- +>>>var _b = robotB.name, nameB = _b === void 0 ? "" : _b, _c = robotB.skill, skillB = _c === void 0 ? "" : _c; +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB = "" +3 > +4 > name: nameB = "" +5 > , +6 > skill: skillB = "" +7 > +8 > skill: skillB = "" +9 > } = robotB; +1->Emitted(5, 1) Source(12, 7) + SourceIndex(0) +2 >Emitted(5, 21) Source(12, 31) + SourceIndex(0) +3 >Emitted(5, 23) Source(12, 7) + SourceIndex(0) +4 >Emitted(5, 62) Source(12, 31) + SourceIndex(0) +5 >Emitted(5, 64) Source(12, 33) + SourceIndex(0) +6 >Emitted(5, 81) Source(12, 69) + SourceIndex(0) +7 >Emitted(5, 83) Source(12, 33) + SourceIndex(0) +8 >Emitted(5, 133) Source(12, 69) + SourceIndex(0) +9 >Emitted(5, 134) Source(12, 81) + SourceIndex(0) +--- +>>>var _d = { name: "Edger", skill: "cutting edges" }, _e = _d.name, nameC = _e === void 0 ? "" : _e, _f = _d.skill, skillC = _f === void 0 ? "" : _f; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^ +1-> + > +2 > +3 > var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" } +4 > +5 > name: nameC = "" +6 > +7 > name: nameC = "" +8 > , +9 > skill: skillC = "" +10> +11> skill: skillC = "" +12> } = { name: "Edger", skill: "cutting edges" }; +1->Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 5) Source(13, 1) + SourceIndex(0) +3 >Emitted(6, 51) Source(13, 115) + SourceIndex(0) +4 >Emitted(6, 53) Source(13, 7) + SourceIndex(0) +5 >Emitted(6, 65) Source(13, 31) + SourceIndex(0) +6 >Emitted(6, 67) Source(13, 7) + SourceIndex(0) +7 >Emitted(6, 106) Source(13, 31) + SourceIndex(0) +8 >Emitted(6, 108) Source(13, 33) + SourceIndex(0) +9 >Emitted(6, 121) Source(13, 69) + SourceIndex(0) +10>Emitted(6, 123) Source(13, 33) + SourceIndex(0) +11>Emitted(6, 173) Source(13, 69) + SourceIndex(0) +12>Emitted(6, 174) Source(13, 116) + SourceIndex(0) +--- +>>>if (nameA == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^^-> +1 > + > +2 >if +3 > +4 > ( +5 > nameA +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 3) Source(14, 3) + SourceIndex(0) +3 >Emitted(7, 4) Source(14, 4) + SourceIndex(0) +4 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +5 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) +6 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) +7 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) +8 >Emitted(7, 20) Source(14, 20) + SourceIndex(0) +9 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) +10>Emitted(7, 22) Source(14, 22) + SourceIndex(0) +--- +>>> console.log(skillB); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > skillB +7 > ) +8 > ; +1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(8, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(8, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +7 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +8 >Emitted(8, 25) Source(15, 25) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(10, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(10, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(10, 6) Source(17, 6) + SourceIndex(0) +4 >Emitted(10, 7) Source(17, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(11, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(11, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(11, 22) Source(18, 22) + SourceIndex(0) +7 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +8 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.symbols new file mode 100644 index 00000000000..1fc07bf4a17 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.symbols @@ -0,0 +1,69 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 36)) + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 38)) + +var { name: nameA = "" } = robotA; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 10, 5)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 8, 3)) + +var { name: nameB = "", skill: skillB = "" } = robotB; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 5)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 31)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 9, 3)) + +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 74)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 5)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 89)) +>skillC : Symbol(skillC, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 31)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 74)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 89)) + +if (nameA == nameB) { +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 10, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 5)) + + console.log(skillB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 11, 31)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 4, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementDefaultValues.ts, 12, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types new file mode 100644 index 00000000000..0ad3330e867 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types @@ -0,0 +1,87 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>name : string +>"trimmer" : string +>skill : string +>"trimming" : string + +var { name: nameA = "" } = robotA; +>name : any +>nameA : string +>"" : string +>robotA : Robot + +var { name: nameB = "", skill: skillB = "" } = robotB; +>name : any +>nameB : string +>"" : string +>skill : any +>skillB : string +>"" : string +>robotB : Robot + +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +>name : any +>nameC : string +>"" : string +>skill : any +>skillC : string +>"" : string +>{ name: "Edger", skill: "cutting edges" } : { name?: string; skill?: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +if (nameA == nameB) { +>nameA == nameB : boolean +>nameA : string +>nameB : string + + console.log(skillB); +>console.log(skillB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>skillB : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js new file mode 100644 index 00000000000..4988514324b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js @@ -0,0 +1,38 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +var _a = robotA.skills, primaryA = _a.primary, secondaryA = _a.secondary; +var nameB = robotB.name, _b = robotB.skills, primaryB = _b.primary, secondaryB = _b.secondary; +var _c = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, nameC = _c.name, _d = _c.skills, primaryB = _d.primary, secondaryB = _d.secondary; +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map new file mode 100644 index 00000000000..cd7a9813374 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAExF,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AAChE,uBAAW,EAAE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AACnF,IAAA,mFAA0J,EAApJ,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAsF;AAE3J,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..4d0845e1a75 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt @@ -0,0 +1,380 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +23> ^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary: string; + > secondary: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^ +22> ^ +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "trimming" +16> , +17> secondary +18> : +19> "edging" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(12, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(12, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(12, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(12, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(12, 29) + SourceIndex(0) +8 >Emitted(2, 31) Source(12, 38) + SourceIndex(0) +9 >Emitted(2, 33) Source(12, 40) + SourceIndex(0) +10>Emitted(2, 39) Source(12, 46) + SourceIndex(0) +11>Emitted(2, 41) Source(12, 48) + SourceIndex(0) +12>Emitted(2, 43) Source(12, 50) + SourceIndex(0) +13>Emitted(2, 50) Source(12, 57) + SourceIndex(0) +14>Emitted(2, 52) Source(12, 59) + SourceIndex(0) +15>Emitted(2, 62) Source(12, 69) + SourceIndex(0) +16>Emitted(2, 64) Source(12, 71) + SourceIndex(0) +17>Emitted(2, 73) Source(12, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(12, 82) + SourceIndex(0) +19>Emitted(2, 83) Source(12, 90) + SourceIndex(0) +20>Emitted(2, 85) Source(12, 92) + SourceIndex(0) +21>Emitted(2, 87) Source(12, 94) + SourceIndex(0) +22>Emitted(2, 88) Source(12, 95) + SourceIndex(0) +--- +>>>var _a = robotA.skills, primaryA = _a.primary, secondaryA = _a.secondary; +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + >var { +2 >skills: { primary: primaryA, secondary: secondaryA } +3 > +4 > primary: primaryA +5 > , +6 > secondary: secondaryA +7 > } } = robotA; +1 >Emitted(3, 1) Source(14, 7) + SourceIndex(0) +2 >Emitted(3, 23) Source(14, 59) + SourceIndex(0) +3 >Emitted(3, 25) Source(14, 17) + SourceIndex(0) +4 >Emitted(3, 46) Source(14, 34) + SourceIndex(0) +5 >Emitted(3, 48) Source(14, 36) + SourceIndex(0) +6 >Emitted(3, 73) Source(14, 57) + SourceIndex(0) +7 >Emitted(3, 74) Source(14, 71) + SourceIndex(0) +--- +>>>var nameB = robotB.name, _b = robotB.skills, primaryB = _b.primary, secondaryB = _b.secondary; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { +2 >name: nameB +3 > , +4 > skills: { primary: primaryB, secondary: secondaryB } +5 > +6 > primary: primaryB +7 > , +8 > secondary: secondaryB +9 > } } = robotB; +1->Emitted(4, 1) Source(15, 7) + SourceIndex(0) +2 >Emitted(4, 24) Source(15, 18) + SourceIndex(0) +3 >Emitted(4, 26) Source(15, 20) + SourceIndex(0) +4 >Emitted(4, 44) Source(15, 72) + SourceIndex(0) +5 >Emitted(4, 46) Source(15, 30) + SourceIndex(0) +6 >Emitted(4, 67) Source(15, 47) + SourceIndex(0) +7 >Emitted(4, 69) Source(15, 49) + SourceIndex(0) +8 >Emitted(4, 94) Source(15, 70) + SourceIndex(0) +9 >Emitted(4, 95) Source(15, 84) + SourceIndex(0) +--- +>>>var _c = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, nameC = _c.name, _d = _c.skills, primaryB = _d.primary, secondaryB = _d.secondary; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^ +1-> + > +2 > +3 > var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } +4 > +5 > name: nameC +6 > , +7 > skills: { primary: primaryB, secondary: secondaryB } +8 > +9 > primary: primaryB +10> , +11> secondary: secondaryB +12> } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +1->Emitted(5, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(16, 1) + SourceIndex(0) +3 >Emitted(5, 88) Source(16, 155) + SourceIndex(0) +4 >Emitted(5, 90) Source(16, 7) + SourceIndex(0) +5 >Emitted(5, 105) Source(16, 18) + SourceIndex(0) +6 >Emitted(5, 107) Source(16, 20) + SourceIndex(0) +7 >Emitted(5, 121) Source(16, 72) + SourceIndex(0) +8 >Emitted(5, 123) Source(16, 30) + SourceIndex(0) +9 >Emitted(5, 144) Source(16, 47) + SourceIndex(0) +10>Emitted(5, 146) Source(16, 49) + SourceIndex(0) +11>Emitted(5, 171) Source(16, 70) + SourceIndex(0) +12>Emitted(5, 172) Source(16, 156) + SourceIndex(0) +--- +>>>if (nameB == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameB +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(6, 1) Source(18, 1) + SourceIndex(0) +2 >Emitted(6, 3) Source(18, 3) + SourceIndex(0) +3 >Emitted(6, 4) Source(18, 4) + SourceIndex(0) +4 >Emitted(6, 5) Source(18, 5) + SourceIndex(0) +5 >Emitted(6, 10) Source(18, 10) + SourceIndex(0) +6 >Emitted(6, 14) Source(18, 14) + SourceIndex(0) +7 >Emitted(6, 19) Source(18, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(18, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(18, 21) + SourceIndex(0) +10>Emitted(6, 22) Source(18, 22) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(7, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(7, 12) Source(19, 12) + SourceIndex(0) +3 >Emitted(7, 13) Source(19, 13) + SourceIndex(0) +4 >Emitted(7, 16) Source(19, 16) + SourceIndex(0) +5 >Emitted(7, 17) Source(19, 17) + SourceIndex(0) +6 >Emitted(7, 22) Source(19, 22) + SourceIndex(0) +7 >Emitted(7, 23) Source(19, 23) + SourceIndex(0) +8 >Emitted(7, 24) Source(19, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(20, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(9, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(9, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(9, 7) Source(21, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(10, 5) Source(22, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(22, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(22, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(22, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(22, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(22, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(22, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(23, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(23, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.symbols new file mode 100644 index 00000000000..09b66f24ad8 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 4, 17)) + + primary: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 5, 13)) + + secondary: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 6, 24)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 65)) + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 38)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 48)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 69)) + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 13, 15)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 6, 24)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 13, 34)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 10, 3)) + +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 3, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 5)) +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 4, 17)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 28), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 28)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 6, 24)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 47), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 47)) +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 11, 3)) + +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 77)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 5)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 92)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 102)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 28), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 28)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 121)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 47), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 47)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 77)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 92)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 102)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 121)) + +if (nameB == nameB) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 14, 5)) + + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 5)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts, 15, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types new file mode 100644 index 00000000000..1101b01b1a7 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types @@ -0,0 +1,107 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary: string; secondary: string; } + + primary: string; +>primary : string + + secondary: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +>skills : any +>primary : any +>primaryA : string +>secondary : any +>secondaryA : string +>robotA : Robot + +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +>name : any +>nameB : string +>skills : any +>primary : any +>primaryB : string +>secondary : any +>secondaryB : string +>robotB : Robot + +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>name : any +>nameC : string +>skills : any +>primary : any +>primaryB : string +>secondary : any +>secondaryB : string +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +if (nameB == nameB) { +>nameB == nameB : boolean +>nameB : string +>nameB : string + + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js new file mode 100644 index 00000000000..694f1d9d30c --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js @@ -0,0 +1,55 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts] +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { + skills: { + primary: primaryA = "noSkill", + secondary: secondaryA = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotA; +var { + name: nameB = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotB; +var { + name: nameC = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} + +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js] +var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +var _a = robotA.skills, _b = _a === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _a, _c = _b.primary, primaryA = _c === void 0 ? "noSkill" : _c, _d = _b.secondary, secondaryA = _d === void 0 ? "noSkill" : _d; +var _e = robotB.name, nameB = _e === void 0 ? "noNameSpecified" : _e, _f = robotB.skills, _g = _f === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _f, _h = _g.primary, primaryB = _h === void 0 ? "noSkill" : _h, _j = _g.secondary, secondaryB = _j === void 0 ? "noSkill" : _j; +var _k = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, _l = _k.name, nameC = _l === void 0 ? "noNameSpecified" : _l, _m = _k.skills, _o = _m === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _m, _p = _o.primary, primaryB = _p === void 0 ? "noSkill" : _p, _q = _o.secondary, secondaryB = _q === void 0 ? "noSkill" : _q; +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} +//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map new file mode 100644 index 00000000000..9ad442f4698 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map] +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAG1F,sBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AAEP,oBAA+B,EAA/B,8CAA+B,EAC/B,kBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AACX,IAAA,mFAMyF,EALrF,YAA+B,EAA/B,8CAA+B,EAC/B,cAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAEiD;AAE1F,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt new file mode 100644 index 00000000000..5e007440890 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt @@ -0,0 +1,484 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js +mapUrl: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map +sourceRoot: +sources: sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js +sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts +------------------------------------------------------------------- +>>>var robotA = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +1 > +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^ +20> ^^ +21> ^^ +22> ^ +23> ^^^^^^^-> +1 >declare var console: { + > log(msg: string): void; + >} + >interface Robot { + > name: string; + > skills: { + > primary?: string; + > secondary?: string; + > }; + >} + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "mowing" +16> , +17> secondary +18> : +19> "none" +20> } +21> } +22> ; +1 >Emitted(1, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(11, 5) + SourceIndex(0) +3 >Emitted(1, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(1, 14) Source(11, 21) + SourceIndex(0) +5 >Emitted(1, 16) Source(11, 23) + SourceIndex(0) +6 >Emitted(1, 20) Source(11, 27) + SourceIndex(0) +7 >Emitted(1, 22) Source(11, 29) + SourceIndex(0) +8 >Emitted(1, 29) Source(11, 36) + SourceIndex(0) +9 >Emitted(1, 31) Source(11, 38) + SourceIndex(0) +10>Emitted(1, 37) Source(11, 44) + SourceIndex(0) +11>Emitted(1, 39) Source(11, 46) + SourceIndex(0) +12>Emitted(1, 41) Source(11, 48) + SourceIndex(0) +13>Emitted(1, 48) Source(11, 55) + SourceIndex(0) +14>Emitted(1, 50) Source(11, 57) + SourceIndex(0) +15>Emitted(1, 58) Source(11, 65) + SourceIndex(0) +16>Emitted(1, 60) Source(11, 67) + SourceIndex(0) +17>Emitted(1, 69) Source(11, 76) + SourceIndex(0) +18>Emitted(1, 71) Source(11, 78) + SourceIndex(0) +19>Emitted(1, 77) Source(11, 84) + SourceIndex(0) +20>Emitted(1, 79) Source(11, 86) + SourceIndex(0) +21>Emitted(1, 81) Source(11, 88) + SourceIndex(0) +22>Emitted(1, 82) Source(11, 89) + SourceIndex(0) +--- +>>>var robotB = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^^^ +9 > ^^ +10> ^^^^^^ +11> ^^ +12> ^^ +13> ^^^^^^^ +14> ^^ +15> ^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^ +18> ^^ +19> ^^^^^^^^ +20> ^^ +21> ^^ +22> ^ +23> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >var +3 > robotB +4 > : Robot = +5 > { +6 > name +7 > : +8 > "trimmer" +9 > , +10> skills +11> : +12> { +13> primary +14> : +15> "trimming" +16> , +17> secondary +18> : +19> "edging" +20> } +21> } +22> ; +1->Emitted(2, 1) Source(12, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(12, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(12, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(12, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(12, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(12, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(12, 29) + SourceIndex(0) +8 >Emitted(2, 31) Source(12, 38) + SourceIndex(0) +9 >Emitted(2, 33) Source(12, 40) + SourceIndex(0) +10>Emitted(2, 39) Source(12, 46) + SourceIndex(0) +11>Emitted(2, 41) Source(12, 48) + SourceIndex(0) +12>Emitted(2, 43) Source(12, 50) + SourceIndex(0) +13>Emitted(2, 50) Source(12, 57) + SourceIndex(0) +14>Emitted(2, 52) Source(12, 59) + SourceIndex(0) +15>Emitted(2, 62) Source(12, 69) + SourceIndex(0) +16>Emitted(2, 64) Source(12, 71) + SourceIndex(0) +17>Emitted(2, 73) Source(12, 80) + SourceIndex(0) +18>Emitted(2, 75) Source(12, 82) + SourceIndex(0) +19>Emitted(2, 83) Source(12, 90) + SourceIndex(0) +20>Emitted(2, 85) Source(12, 92) + SourceIndex(0) +21>Emitted(2, 87) Source(12, 94) + SourceIndex(0) +22>Emitted(2, 88) Source(12, 95) + SourceIndex(0) +--- +>>>var _a = robotA.skills, _b = _a === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _a, _c = _b.primary, primaryA = _c === void 0 ? "noSkill" : _c, _d = _b.secondary, secondaryA = _d === void 0 ? "noSkill" : _d; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + >var { + > +2 >skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +3 > +4 > skills: { + > primary: primaryA = "noSkill", + > secondary: secondaryA = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +5 > +6 > primary: primaryA = "noSkill" +7 > +8 > primary: primaryA = "noSkill" +9 > , + > +10> secondary: secondaryA = "noSkill" +11> +12> secondary: secondaryA = "noSkill" +13> + > } = { primary: "noSkill", secondary: "noSkill" } + > } = robotA; +1->Emitted(3, 1) Source(15, 5) + SourceIndex(0) +2 >Emitted(3, 23) Source(18, 53) + SourceIndex(0) +3 >Emitted(3, 25) Source(15, 5) + SourceIndex(0) +4 >Emitted(3, 95) Source(18, 53) + SourceIndex(0) +5 >Emitted(3, 97) Source(16, 9) + SourceIndex(0) +6 >Emitted(3, 112) Source(16, 38) + SourceIndex(0) +7 >Emitted(3, 114) Source(16, 9) + SourceIndex(0) +8 >Emitted(3, 155) Source(16, 38) + SourceIndex(0) +9 >Emitted(3, 157) Source(17, 9) + SourceIndex(0) +10>Emitted(3, 174) Source(17, 42) + SourceIndex(0) +11>Emitted(3, 176) Source(17, 9) + SourceIndex(0) +12>Emitted(3, 219) Source(17, 42) + SourceIndex(0) +13>Emitted(3, 220) Source(19, 12) + SourceIndex(0) +--- +>>>var _e = robotB.name, nameB = _e === void 0 ? "noNameSpecified" : _e, _f = robotB.skills, _g = _f === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _f, _h = _g.primary, primaryB = _h === void 0 ? "noSkill" : _h, _j = _g.secondary, secondaryB = _j === void 0 ? "noSkill" : _j; +1-> +2 >^^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + >var { + > +2 >name: nameB = "noNameSpecified" +3 > +4 > name: nameB = "noNameSpecified" +5 > , + > +6 > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +7 > +8 > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +9 > +10> primary: primaryB = "noSkill" +11> +12> primary: primaryB = "noSkill" +13> , + > +14> secondary: secondaryB = "noSkill" +15> +16> secondary: secondaryB = "noSkill" +17> + > } = { primary: "noSkill", secondary: "noSkill" } + > } = robotB; +1->Emitted(4, 1) Source(21, 5) + SourceIndex(0) +2 >Emitted(4, 21) Source(21, 36) + SourceIndex(0) +3 >Emitted(4, 23) Source(21, 5) + SourceIndex(0) +4 >Emitted(4, 69) Source(21, 36) + SourceIndex(0) +5 >Emitted(4, 71) Source(22, 5) + SourceIndex(0) +6 >Emitted(4, 89) Source(25, 53) + SourceIndex(0) +7 >Emitted(4, 91) Source(22, 5) + SourceIndex(0) +8 >Emitted(4, 161) Source(25, 53) + SourceIndex(0) +9 >Emitted(4, 163) Source(23, 9) + SourceIndex(0) +10>Emitted(4, 178) Source(23, 38) + SourceIndex(0) +11>Emitted(4, 180) Source(23, 9) + SourceIndex(0) +12>Emitted(4, 221) Source(23, 38) + SourceIndex(0) +13>Emitted(4, 223) Source(24, 9) + SourceIndex(0) +14>Emitted(4, 240) Source(24, 42) + SourceIndex(0) +15>Emitted(4, 242) Source(24, 9) + SourceIndex(0) +16>Emitted(4, 285) Source(24, 42) + SourceIndex(0) +17>Emitted(4, 286) Source(26, 12) + SourceIndex(0) +--- +>>>var _k = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }, _l = _k.name, nameC = _l === void 0 ? "noNameSpecified" : _l, _m = _k.skills, _o = _m === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _m, _p = _o.primary, primaryB = _p === void 0 ? "noSkill" : _p, _q = _o.secondary, secondaryB = _q === void 0 ? "noSkill" : _q; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^ +1-> + > +2 > +3 > var { + > name: nameC = "noNameSpecified", + > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } + > } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } +4 > +5 > name: nameC = "noNameSpecified" +6 > +7 > name: nameC = "noNameSpecified" +8 > , + > +9 > skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +10> +11> skills: { + > primary: primaryB = "noSkill", + > secondary: secondaryB = "noSkill" + > } = { primary: "noSkill", secondary: "noSkill" } +12> +13> primary: primaryB = "noSkill" +14> +15> primary: primaryB = "noSkill" +16> , + > +17> secondary: secondaryB = "noSkill" +18> +19> secondary: secondaryB = "noSkill" +20> + > } = { primary: "noSkill", secondary: "noSkill" } + > } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +1->Emitted(5, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(5, 5) Source(27, 1) + SourceIndex(0) +3 >Emitted(5, 88) Source(33, 90) + SourceIndex(0) +4 >Emitted(5, 90) Source(28, 5) + SourceIndex(0) +5 >Emitted(5, 102) Source(28, 36) + SourceIndex(0) +6 >Emitted(5, 104) Source(28, 5) + SourceIndex(0) +7 >Emitted(5, 150) Source(28, 36) + SourceIndex(0) +8 >Emitted(5, 152) Source(29, 5) + SourceIndex(0) +9 >Emitted(5, 166) Source(32, 53) + SourceIndex(0) +10>Emitted(5, 168) Source(29, 5) + SourceIndex(0) +11>Emitted(5, 238) Source(32, 53) + SourceIndex(0) +12>Emitted(5, 240) Source(30, 9) + SourceIndex(0) +13>Emitted(5, 255) Source(30, 38) + SourceIndex(0) +14>Emitted(5, 257) Source(30, 9) + SourceIndex(0) +15>Emitted(5, 298) Source(30, 38) + SourceIndex(0) +16>Emitted(5, 300) Source(31, 9) + SourceIndex(0) +17>Emitted(5, 317) Source(31, 42) + SourceIndex(0) +18>Emitted(5, 319) Source(31, 9) + SourceIndex(0) +19>Emitted(5, 362) Source(31, 42) + SourceIndex(0) +20>Emitted(5, 363) Source(33, 91) + SourceIndex(0) +--- +>>>if (nameB == nameB) { +1 > +2 >^^ +3 > ^ +4 > ^ +5 > ^^^^^ +6 > ^^^^ +7 > ^^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^^^-> +1 > + > + > +2 >if +3 > +4 > ( +5 > nameB +6 > == +7 > nameB +8 > ) +9 > +10> { +1 >Emitted(6, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(6, 3) Source(35, 3) + SourceIndex(0) +3 >Emitted(6, 4) Source(35, 4) + SourceIndex(0) +4 >Emitted(6, 5) Source(35, 5) + SourceIndex(0) +5 >Emitted(6, 10) Source(35, 10) + SourceIndex(0) +6 >Emitted(6, 14) Source(35, 14) + SourceIndex(0) +7 >Emitted(6, 19) Source(35, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(35, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(35, 21) + SourceIndex(0) +10>Emitted(6, 22) Source(35, 22) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(7, 5) Source(36, 5) + SourceIndex(0) +2 >Emitted(7, 12) Source(36, 12) + SourceIndex(0) +3 >Emitted(7, 13) Source(36, 13) + SourceIndex(0) +4 >Emitted(7, 16) Source(36, 16) + SourceIndex(0) +5 >Emitted(7, 17) Source(36, 17) + SourceIndex(0) +6 >Emitted(7, 22) Source(36, 22) + SourceIndex(0) +7 >Emitted(7, 23) Source(36, 23) + SourceIndex(0) +8 >Emitted(7, 24) Source(36, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^-> +1 > + > +2 >} +1 >Emitted(8, 1) Source(37, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(37, 2) + SourceIndex(0) +--- +>>>else { +1-> +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >else +3 > +4 > { +1->Emitted(9, 1) Source(38, 1) + SourceIndex(0) +2 >Emitted(9, 5) Source(38, 5) + SourceIndex(0) +3 >Emitted(9, 6) Source(38, 6) + SourceIndex(0) +4 >Emitted(9, 7) Source(38, 7) + SourceIndex(0) +--- +>>> console.log(nameC); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1-> + > +2 > console +3 > . +4 > log +5 > ( +6 > nameC +7 > ) +8 > ; +1->Emitted(10, 5) Source(39, 5) + SourceIndex(0) +2 >Emitted(10, 12) Source(39, 12) + SourceIndex(0) +3 >Emitted(10, 13) Source(39, 13) + SourceIndex(0) +4 >Emitted(10, 16) Source(39, 16) + SourceIndex(0) +5 >Emitted(10, 17) Source(39, 17) + SourceIndex(0) +6 >Emitted(10, 22) Source(39, 22) + SourceIndex(0) +7 >Emitted(10, 23) Source(39, 23) + SourceIndex(0) +8 >Emitted(10, 24) Source(39, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(11, 1) Source(40, 1) + SourceIndex(0) +2 >Emitted(11, 2) Source(40, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.symbols b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.symbols new file mode 100644 index 00000000000..a9a3a91f824 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.symbols @@ -0,0 +1,127 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts === +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 1, 8)) +} +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 3, 17)) + + skills: { +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary?: string; +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) + + secondary?: string; +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 36)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 46)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 65)) + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 21)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 38)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 48)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 69)) + +var { + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary: primaryA = "noSkill", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) +>primaryA : Symbol(primaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 14, 13)) + + secondary: secondaryA = "noSkill" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) +>secondaryA : Symbol(secondaryA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 15, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 17, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 17, 29)) + +} = robotA; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 10, 3)) + +var { + name: nameB = "noNameSpecified", +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 3, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 19, 5)) + + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary: primaryB = "noSkill", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 21, 13), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 28, 13)) + + secondary: secondaryB = "noSkill" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 22, 38), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 29, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 24, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 24, 29)) + +} = robotB; +>robotB : Symbol(robotB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 11, 3)) + +var { + name: nameC = "noNameSpecified", +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 3, 17)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 26, 5)) + + skills: { +>skills : Symbol(Robot.skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 4, 17)) + + primary: primaryB = "noSkill", +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 5, 13)) +>primaryB : Symbol(primaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 21, 13), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 28, 13)) + + secondary: secondaryB = "noSkill" +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 6, 25)) +>secondaryB : Symbol(secondaryB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 22, 38), Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 29, 38)) + + } = { primary: "noSkill", secondary: "noSkill" } +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 31, 9)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 31, 29)) + +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 2, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 12)) +>skills : Symbol(skills, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 27)) +>primary : Symbol(primary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 37)) +>secondary : Symbol(secondary, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 32, 56)) + +if (nameB == nameB) { +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 19, 5)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 19, 5)) + + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 26, 5)) +} +else { + console.log(nameC); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 0, 22)) +>nameC : Symbol(nameC, Decl(sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts, 26, 5)) +} diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types new file mode 100644 index 00000000000..e3fdec19339 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types @@ -0,0 +1,163 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts === +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skills: { +>skills : { primary?: string; secondary?: string; } + + primary?: string; +>primary : string + + secondary?: string; +>secondary : string + + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"mower" : string +>skills : { primary: string; secondary: string; } +>{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>primary : string +>"mowing" : string +>secondary : string +>"none" : string + +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +>robotB : Robot +>Robot : Robot +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"trimmer" : string +>skills : { primary: string; secondary: string; } +>{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>primary : string +>"trimming" : string +>secondary : string +>"edging" : string + +var { + skills: { +>skills : any + + primary: primaryA = "noSkill", +>primary : any +>primaryA : string +>"noSkill" : string + + secondary: secondaryA = "noSkill" +>secondary : any +>secondaryA : string +>"noSkill" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} = robotA; +>robotA : Robot + +var { + name: nameB = "noNameSpecified", +>name : any +>nameB : string +>"noNameSpecified" : string + + skills: { +>skills : any + + primary: primaryB = "noSkill", +>primary : any +>primaryB : string +>"noSkill" : string + + secondary: secondaryB = "noSkill" +>secondary : any +>secondaryB : string +>"noSkill" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} = robotB; +>robotB : Robot + +var { + name: nameC = "noNameSpecified", +>name : any +>nameC : string +>"noNameSpecified" : string + + skills: { +>skills : any + + primary: primaryB = "noSkill", +>primary : any +>primaryB : string +>"noSkill" : string + + secondary: secondaryB = "noSkill" +>secondary : any +>secondaryB : string +>"noSkill" : string + + } = { primary: "noSkill", secondary: "noSkill" } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>primary : string +>"noSkill" : string +>secondary : string +>"noSkill" : string + +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : Robot +>Robot : Robot +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>name : string +>"Edger" : string +>skills : { primary: string; secondary: string; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>primary : string +>"edging" : string +>secondary : string +>"branch trimming" : string + +if (nameB == nameB) { +>nameB == nameB : boolean +>nameB : string +>nameB : string + + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} +else { + console.log(nameC); +>console.log(nameC) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameC : string +} diff --git a/tests/baselines/reference/sourceMapValidationFor.js.map b/tests/baselines/reference/sourceMapValidationFor.js.map index 15d038297c7..5d6491ae1e5 100644 --- a/tests/baselines/reference/sourceMapValidationFor.js.map +++ b/tests/baselines/reference/sourceMapValidationFor.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationFor.js.map] -{"version":3,"file":"sourceMapValidationFor.js","sourceRoot":"","sources":["sourceMapValidationFor.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EACvB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAI,CAAC;IACvB,CAAC,EAAE,CAAC;IACJ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACT,QAAQ,CAAC;IACb,CAAC;AACL,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAClB,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAChB,CAAC;AACD,CAAC;AACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC;IACN,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IACL,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationFor.js","sourceRoot":"","sources":["sourceMapValidationFor.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EACvB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAI,CAAC;IACvB,CAAC,EAAE,CAAC;IACJ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACT,QAAQ,CAAC;IACb,CAAC;AACL,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAClB,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAChB,CAAC;AACD,CAAC;AACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC;IACN,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IACL,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt index 609f9548a6b..583e60d75cf 100644 --- a/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt @@ -13,56 +13,53 @@ sourceFile:sourceMapValidationFor.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^ -14> ^^ -15> ^ -16> ^^ -17> ^^ -18> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ +17> ^ 1 > 2 >for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> 10 -14> ; -15> i -16> ++ -17> ) -18> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 10 +13> ; +14> i +15> ++ +16> ) +17> { 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) -6 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -7 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) -9 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -10>Emitted(1, 17) Source(1, 17) + SourceIndex(0) -11>Emitted(1, 18) Source(1, 18) + SourceIndex(0) -12>Emitted(1, 21) Source(1, 21) + SourceIndex(0) -13>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -14>Emitted(1, 25) Source(1, 25) + SourceIndex(0) -15>Emitted(1, 26) Source(1, 26) + SourceIndex(0) -16>Emitted(1, 28) Source(1, 28) + SourceIndex(0) -17>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -18>Emitted(1, 31) Source(1, 31) + SourceIndex(0) +5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +8 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +9 >Emitted(1, 17) Source(1, 17) + SourceIndex(0) +10>Emitted(1, 18) Source(1, 18) + SourceIndex(0) +11>Emitted(1, 21) Source(1, 21) + SourceIndex(0) +12>Emitted(1, 23) Source(1, 23) + SourceIndex(0) +13>Emitted(1, 25) Source(1, 25) + SourceIndex(0) +14>Emitted(1, 26) Source(1, 26) + SourceIndex(0) +15>Emitted(1, 28) Source(1, 28) + SourceIndex(0) +16>Emitted(1, 30) Source(1, 30) + SourceIndex(0) +17>Emitted(1, 31) Source(1, 31) + SourceIndex(0) --- >>> WScript.Echo("i: " + i); 1 >^^^^ @@ -208,48 +205,45 @@ sourceFile:sourceMapValidationFor.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^ -14> ^^^ -15> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^ +13> ^^^ +14> ^ 1-> > 2 >for 3 > 4 > ( -5 > var -6 > -7 > j -8 > = -9 > 0 -10> ; -11> j -12> < -13> 10 -14> ; ) -15> { +5 > var +6 > j +7 > = +8 > 0 +9 > ; +10> j +11> < +12> 10 +13> ; ) +14> { 1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) 2 >Emitted(7, 4) Source(8, 4) + SourceIndex(0) 3 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) 4 >Emitted(7, 6) Source(8, 6) + SourceIndex(0) -5 >Emitted(7, 9) Source(8, 9) + SourceIndex(0) -6 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) -7 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) -8 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) -9 >Emitted(7, 15) Source(8, 15) + SourceIndex(0) -10>Emitted(7, 17) Source(8, 17) + SourceIndex(0) -11>Emitted(7, 18) Source(8, 18) + SourceIndex(0) -12>Emitted(7, 21) Source(8, 21) + SourceIndex(0) -13>Emitted(7, 23) Source(8, 23) + SourceIndex(0) -14>Emitted(7, 26) Source(8, 27) + SourceIndex(0) -15>Emitted(7, 27) Source(8, 28) + SourceIndex(0) +5 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +6 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) +7 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +8 >Emitted(7, 15) Source(8, 15) + SourceIndex(0) +9 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +10>Emitted(7, 18) Source(8, 18) + SourceIndex(0) +11>Emitted(7, 21) Source(8, 21) + SourceIndex(0) +12>Emitted(7, 23) Source(8, 23) + SourceIndex(0) +13>Emitted(7, 26) Source(8, 27) + SourceIndex(0) +14>Emitted(7, 27) Source(8, 28) + SourceIndex(0) --- >>> j++; 1 >^^^^ @@ -405,45 +399,42 @@ sourceFile:sourceMapValidationFor.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^^ -14> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^^ +13> ^ 1-> > 2 >for 3 > 4 > ( -5 > var -6 > -7 > k -8 > = -9 > 0 -10> ;; -11> k -12> ++ -13> ) -14> { +5 > var +6 > k +7 > = +8 > 0 +9 > ;; +10> k +11> ++ +12> ) +13> { 1->Emitted(16, 1) Source(18, 1) + SourceIndex(0) 2 >Emitted(16, 4) Source(18, 4) + SourceIndex(0) 3 >Emitted(16, 5) Source(18, 5) + SourceIndex(0) 4 >Emitted(16, 6) Source(18, 6) + SourceIndex(0) -5 >Emitted(16, 9) Source(18, 9) + SourceIndex(0) -6 >Emitted(16, 10) Source(18, 10) + SourceIndex(0) -7 >Emitted(16, 11) Source(18, 11) + SourceIndex(0) -8 >Emitted(16, 14) Source(18, 14) + SourceIndex(0) -9 >Emitted(16, 15) Source(18, 15) + SourceIndex(0) -10>Emitted(16, 18) Source(18, 18) + SourceIndex(0) -11>Emitted(16, 19) Source(18, 19) + SourceIndex(0) -12>Emitted(16, 21) Source(18, 21) + SourceIndex(0) -13>Emitted(16, 23) Source(18, 23) + SourceIndex(0) -14>Emitted(16, 24) Source(18, 24) + SourceIndex(0) +5 >Emitted(16, 10) Source(18, 10) + SourceIndex(0) +6 >Emitted(16, 11) Source(18, 11) + SourceIndex(0) +7 >Emitted(16, 14) Source(18, 14) + SourceIndex(0) +8 >Emitted(16, 15) Source(18, 15) + SourceIndex(0) +9 >Emitted(16, 18) Source(18, 18) + SourceIndex(0) +10>Emitted(16, 19) Source(18, 19) + SourceIndex(0) +11>Emitted(16, 21) Source(18, 21) + SourceIndex(0) +12>Emitted(16, 23) Source(18, 23) + SourceIndex(0) +13>Emitted(16, 24) Source(18, 24) + SourceIndex(0) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMapValidationForIn.js.map b/tests/baselines/reference/sourceMapValidationForIn.js.map index 2c12dd5cdc1..2281e36f605 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.js.map +++ b/tests/baselines/reference/sourceMapValidationForIn.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationForIn.js.map] -{"version":3,"file":"sourceMapValidationForIn.js","sourceRoot":"","sources":["sourceMapValidationForIn.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,MAAM,CAAC,CACtB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CACjB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationForIn.js","sourceRoot":"","sources":["sourceMapValidationForIn.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,CACtB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CACjB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt index ae7e34c025c..e84bb2323c4 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt @@ -13,38 +13,35 @@ sourceFile:sourceMapValidationForIn.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ +5 > ^^^^ +6 > ^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ 1 > 2 >for 3 > 4 > ( -5 > var -6 > -7 > x -8 > in -9 > String -10> ) -11> -12> { +5 > var +6 > x +7 > in +8 > String +9 > ) +10> +11> { 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) 3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) -6 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -7 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -8 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -9 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) -10>Emitted(1, 22) Source(1, 22) + SourceIndex(0) -11>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -12>Emitted(1, 24) Source(1, 24) + SourceIndex(0) +5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +8 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) +9 >Emitted(1, 22) Source(1, 22) + SourceIndex(0) +10>Emitted(1, 23) Source(1, 23) + SourceIndex(0) +11>Emitted(1, 24) Source(1, 24) + SourceIndex(0) --- >>> WScript.Echo(x); 1 >^^^^ @@ -159,40 +156,37 @@ sourceFile:sourceMapValidationForIn.ts 2 >^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^^ -8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ +5 > ^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^^^^^ +9 > ^ +10> ^ +11> ^ 1-> > 2 >for 3 > 4 > ( -5 > var -6 > -7 > x2 -8 > in -9 > String -10> ) -11> +5 > var +6 > x2 +7 > in +8 > String +9 > ) +10> > -12> { +11> { 1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) 2 >Emitted(7, 4) Source(7, 4) + SourceIndex(0) 3 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) 4 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) -5 >Emitted(7, 9) Source(7, 9) + SourceIndex(0) -6 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) -7 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) -8 >Emitted(7, 16) Source(7, 16) + SourceIndex(0) -9 >Emitted(7, 22) Source(7, 22) + SourceIndex(0) -10>Emitted(7, 23) Source(7, 23) + SourceIndex(0) -11>Emitted(7, 24) Source(8, 1) + SourceIndex(0) -12>Emitted(7, 25) Source(8, 2) + SourceIndex(0) +5 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) +6 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) +7 >Emitted(7, 16) Source(7, 16) + SourceIndex(0) +8 >Emitted(7, 22) Source(7, 22) + SourceIndex(0) +9 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) +10>Emitted(7, 24) Source(8, 1) + SourceIndex(0) +11>Emitted(7, 25) Source(8, 2) + SourceIndex(0) --- >>> WScript.Echo(x2); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationStatements.js.map b/tests/baselines/reference/sourceMapValidationStatements.js.map index b4b5c48fc22..464ab4dc002 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js.map +++ b/tests/baselines/reference/sourceMapValidationStatements.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationStatements.js.map] -{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":[],"mappings":"AAAA;IACI,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,CAAC,IAAI,CAAC,CAAC;QACP,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACT,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,CAAC,IAAI,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;IACR,CAAC;IACD,IAAI,CAAC,GAAG;QACJ,CAAC;QACD,CAAC;QACD,CAAC;KACJ,CAAC;IACF,IAAI,GAAG,GAAG;QACN,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,OAAO;KACb,CAAC;IACF,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACD,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;IACnB,CAAE;IAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACb,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAClB,CAAC;IACL,CAAC;IACD,IAAI,CAAC;QACD,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAE;IAAA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACV,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;YAAS,CAAC;QACP,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,GAAG,EAAE,CAAC;QACR,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,SAAS,CAAC;YACN,CAAC,IAAI,CAAC,CAAC;YACP,CAAC,GAAG,EAAE,CAAC;YACP,KAAK,CAAC;QAEV,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;QACZ,CAAC,EAAE,CAAC;IACR,CAAC;IACD,GAAG,CAAC;QACA,CAAC,EAAE,CAAC;IACR,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAC;IACf,CAAC,GAAG,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,KAAK,CAAC,CAAC;IACR,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,CAAC;AACX,CAAC;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":[],"mappings":"AAAA;IACI,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,CAAC,IAAI,CAAC,CAAC;QACP,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACT,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,CAAC,IAAI,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;IACR,CAAC;IACD,IAAI,CAAC,GAAG;QACJ,CAAC;QACD,CAAC;QACD,CAAC;KACJ,CAAC;IACF,IAAI,GAAG,GAAG;QACN,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,OAAO;KACb,CAAC;IACF,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACD,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;IACnB,CAAE;IAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACb,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAClB,CAAC;IACL,CAAC;IACD,IAAI,CAAC;QACD,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAE;IAAA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACV,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;YAAS,CAAC;QACP,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,GAAG,EAAE,CAAC;QACR,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,SAAS,CAAC;YACN,CAAC,IAAI,CAAC,CAAC;YACP,CAAC,GAAG,EAAE,CAAC;YACP,KAAK,CAAC;QAEV,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;QACZ,CAAC,EAAE,CAAC;IACR,CAAC;IACD,GAAG,CAAC;QACA,CAAC,EAAE,CAAC;IACR,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAC;IACf,CAAC,GAAG,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,KAAK,CAAC,CAAC;IACR,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,CAAC;AACX,CAAC;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt index 41212b9b3db..ed7c9395d2f 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt @@ -57,57 +57,54 @@ sourceFile:sourceMapValidationStatements.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^^ -13> ^^ -14> ^^ -15> ^ -16> ^^ -17> ^^ -18> ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ +17> ^ 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > i -8 > = -9 > 0 -10> ; -11> i -12> < -13> 10 -14> ; -15> i -16> ++ -17> ) -18> { +5 > var +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 10 +13> ; +14> i +15> ++ +16> ) +17> { 1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) 2 >Emitted(4, 8) Source(4, 8) + SourceIndex(0) 3 >Emitted(4, 9) Source(4, 9) + SourceIndex(0) 4 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) -5 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) -6 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) -7 >Emitted(4, 15) Source(4, 15) + SourceIndex(0) -8 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) -9 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) -10>Emitted(4, 21) Source(4, 21) + SourceIndex(0) -11>Emitted(4, 22) Source(4, 22) + SourceIndex(0) -12>Emitted(4, 25) Source(4, 25) + SourceIndex(0) -13>Emitted(4, 27) Source(4, 27) + SourceIndex(0) -14>Emitted(4, 29) Source(4, 29) + SourceIndex(0) -15>Emitted(4, 30) Source(4, 30) + SourceIndex(0) -16>Emitted(4, 32) Source(4, 32) + SourceIndex(0) -17>Emitted(4, 34) Source(4, 34) + SourceIndex(0) -18>Emitted(4, 35) Source(4, 35) + SourceIndex(0) +5 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) +6 >Emitted(4, 15) Source(4, 15) + SourceIndex(0) +7 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) +8 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) +9 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) +10>Emitted(4, 22) Source(4, 22) + SourceIndex(0) +11>Emitted(4, 25) Source(4, 25) + SourceIndex(0) +12>Emitted(4, 27) Source(4, 27) + SourceIndex(0) +13>Emitted(4, 29) Source(4, 29) + SourceIndex(0) +14>Emitted(4, 30) Source(4, 30) + SourceIndex(0) +15>Emitted(4, 32) Source(4, 32) + SourceIndex(0) +16>Emitted(4, 34) Source(4, 34) + SourceIndex(0) +17>Emitted(4, 35) Source(4, 35) + SourceIndex(0) --- >>> x += i; 1 >^^^^^^^^ @@ -390,39 +387,36 @@ sourceFile:sourceMapValidationStatements.ts 2 > ^^^ 3 > ^ 4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^^ -9 > ^ -10> ^ -11> ^ -12> ^ +5 > ^^^^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^ +10> ^ +11> ^ 1-> > 2 > for 3 > 4 > ( -5 > var -6 > -7 > j -8 > in -9 > a -10> ) -11> -12> { +5 > var +6 > j +7 > in +8 > a +9 > ) +10> +11> { 1->Emitted(24, 5) Source(23, 5) + SourceIndex(0) 2 >Emitted(24, 8) Source(23, 8) + SourceIndex(0) 3 >Emitted(24, 9) Source(23, 9) + SourceIndex(0) 4 >Emitted(24, 10) Source(23, 10) + SourceIndex(0) -5 >Emitted(24, 13) Source(23, 13) + SourceIndex(0) -6 >Emitted(24, 14) Source(23, 14) + SourceIndex(0) -7 >Emitted(24, 15) Source(23, 15) + SourceIndex(0) -8 >Emitted(24, 19) Source(23, 19) + SourceIndex(0) -9 >Emitted(24, 20) Source(23, 20) + SourceIndex(0) -10>Emitted(24, 21) Source(23, 21) + SourceIndex(0) -11>Emitted(24, 22) Source(23, 22) + SourceIndex(0) -12>Emitted(24, 23) Source(23, 23) + SourceIndex(0) +5 >Emitted(24, 14) Source(23, 14) + SourceIndex(0) +6 >Emitted(24, 15) Source(23, 15) + SourceIndex(0) +7 >Emitted(24, 19) Source(23, 19) + SourceIndex(0) +8 >Emitted(24, 20) Source(23, 20) + SourceIndex(0) +9 >Emitted(24, 21) Source(23, 21) + SourceIndex(0) +10>Emitted(24, 22) Source(23, 22) + SourceIndex(0) +11>Emitted(24, 23) Source(23, 23) + SourceIndex(0) --- >>> obj.z = a[j]; 1 >^^^^^^^^ diff --git a/tests/baselines/reference/staticClassMemberError.errors.txt b/tests/baselines/reference/staticClassMemberError.errors.txt index 9483e3387b7..43a2cd6934d 100644 --- a/tests/baselines/reference/staticClassMemberError.errors.txt +++ b/tests/baselines/reference/staticClassMemberError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/staticClassMemberError.ts(4,3): error TS2304: Cannot find name 's'. +tests/cases/compiler/staticClassMemberError.ts(4,3): error TS2662: Cannot find name 's'. Did you mean the static member 'C.s'? tests/cases/compiler/staticClassMemberError.ts(9,10): error TS2300: Duplicate identifier 'Foo'. tests/cases/compiler/staticClassMemberError.ts(9,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/staticClassMemberError.ts(10,7): error TS2300: Duplicate identifier 'Foo'. @@ -10,7 +10,7 @@ tests/cases/compiler/staticClassMemberError.ts(10,7): error TS2300: Duplicate id public a() { s = 1; ~ -!!! error TS2304: Cannot find name 's'. +!!! error TS2662: Cannot find name 's'. Did you mean the static member 'C.s'? } } diff --git a/tests/baselines/reference/staticVisibility.errors.txt b/tests/baselines/reference/staticVisibility.errors.txt index dccad4a2e2b..a92cb7f88cd 100644 --- a/tests/baselines/reference/staticVisibility.errors.txt +++ b/tests/baselines/reference/staticVisibility.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/staticVisibility.ts(10,9): error TS2304: Cannot find name 's'. -tests/cases/compiler/staticVisibility.ts(13,9): error TS2304: Cannot find name 'b'. +tests/cases/compiler/staticVisibility.ts(10,9): error TS2662: Cannot find name 's'. Did you mean the static member 'C1.s'? +tests/cases/compiler/staticVisibility.ts(13,9): error TS2662: Cannot find name 'b'. Did you mean the static member 'C1.b'? tests/cases/compiler/staticVisibility.ts(18,9): error TS2304: Cannot find name 'v'. tests/cases/compiler/staticVisibility.ts(19,14): error TS2339: Property 'p' does not exist on type 'typeof C1'. tests/cases/compiler/staticVisibility.ts(31,12): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -19,12 +19,12 @@ tests/cases/compiler/staticVisibility.ts(33,29): error TS2304: Cannot find name s = 1; // should be error ~ -!!! error TS2304: Cannot find name 's'. +!!! error TS2662: Cannot find name 's'. Did you mean the static member 'C1.s'? C1.s = 1; // should be ok b(); // should be error ~ -!!! error TS2304: Cannot find name 'b'. +!!! error TS2662: Cannot find name 'b'. Did you mean the static member 'C1.b'? C1.b(); // should be ok } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt index 5dd39e0ad63..3f6de942d25 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt @@ -1,11 +1,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. @@ -29,7 +27,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Derived'. -!!! error TS2415: Property 'bar' is missing in type 'String'. [x: number]: string; // error } @@ -43,7 +40,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Base'. -!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~ !!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. !!! error TS2344: Property 'bar' is missing in type 'Base'. diff --git a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt index e292c0867a7..a5d4152b451 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(12,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Types of property 'bar' are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(22,7): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Types of property '2.0' are incompatible. Type 'string' is not assignable to type 'Base'. @@ -36,7 +35,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Types of property 'bar' are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Base'. -!!! error TS2415: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt index 3d46a6e5dc2..cdcc54c5ee9 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. Types of property 'bar' are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(27,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. Types of property '2.0' are incompatible. Type 'string' is not assignable to type 'Base'. @@ -41,7 +40,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'B' incorrectly extends interface 'A'. !!! error TS2430: Types of property 'bar' are incompatible. !!! error TS2430: Type 'string' is not assignable to type 'Base'. -!!! error TS2430: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt index 4aa889444e5..8d4328cdd2d 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt @@ -1,11 +1,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. @@ -29,7 +27,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Derived'. -!!! error TS2415: Property 'bar' is missing in type 'String'. [x: string]: string; // error } @@ -43,7 +40,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Base'. -!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~ !!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. !!! error TS2344: Property 'bar' is missing in type 'Base'. diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.js b/tests/baselines/reference/superSymbolIndexedAccess5.js index 5bc46dbaed5..3acd26d2974 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.js +++ b/tests/baselines/reference/superSymbolIndexedAccess5.js @@ -34,7 +34,7 @@ var Bar = (function (_super) { _super.apply(this, arguments); } Bar.prototype[symbol] = function () { - return _super.prototype[symbol](); + return _super.prototype[symbol].call(this); }; return Bar; }(Foo)); diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.js b/tests/baselines/reference/superSymbolIndexedAccess6.js index 417edd9c338..8b04075c411 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.js +++ b/tests/baselines/reference/superSymbolIndexedAccess6.js @@ -34,7 +34,7 @@ var Bar = (function (_super) { _super.apply(this, arguments); } Bar[symbol] = function () { - return _super[symbol](); + return _super[symbol].call(this); }; return Bar; }(Foo)); diff --git a/tests/baselines/reference/thisTypeAsConstraint.js b/tests/baselines/reference/thisTypeAsConstraint.js new file mode 100644 index 00000000000..b5a7113549d --- /dev/null +++ b/tests/baselines/reference/thisTypeAsConstraint.js @@ -0,0 +1,14 @@ +//// [thisTypeAsConstraint.ts] +class C { + public m() { + } +} + +//// [thisTypeAsConstraint.js] +var C = (function () { + function C() { + } + C.prototype.m = function () { + }; + return C; +}()); diff --git a/tests/baselines/reference/thisTypeAsConstraint.symbols b/tests/baselines/reference/thisTypeAsConstraint.symbols new file mode 100644 index 00000000000..020dd966cad --- /dev/null +++ b/tests/baselines/reference/thisTypeAsConstraint.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/thisTypeAsConstraint.ts === +class C { +>C : Symbol(C, Decl(thisTypeAsConstraint.ts, 0, 0)) + + public m() { +>m : Symbol(m, Decl(thisTypeAsConstraint.ts, 0, 9)) +>T : Symbol(T, Decl(thisTypeAsConstraint.ts, 1, 11)) + } +} diff --git a/tests/baselines/reference/thisTypeAsConstraint.types b/tests/baselines/reference/thisTypeAsConstraint.types new file mode 100644 index 00000000000..e55fb1f0cca --- /dev/null +++ b/tests/baselines/reference/thisTypeAsConstraint.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/thisTypeAsConstraint.ts === +class C { +>C : C + + public m() { +>m : () => void +>T : T + } +} diff --git a/tests/baselines/reference/tsxElementResolution13.symbols b/tests/baselines/reference/tsxElementResolution13.symbols index 94758b291ac..4b6a5b4f4e7 100644 --- a/tests/baselines/reference/tsxElementResolution13.symbols +++ b/tests/baselines/reference/tsxElementResolution13.symbols @@ -22,5 +22,6 @@ var obj1: Obj1; >Obj1 : Symbol(Obj1, Decl(file.tsx, 3, 1)) ; // Error +>obj1 : Symbol(unknown) >x : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution14.symbols b/tests/baselines/reference/tsxElementResolution14.symbols index 2400ef620eb..a605606b1ed 100644 --- a/tests/baselines/reference/tsxElementResolution14.symbols +++ b/tests/baselines/reference/tsxElementResolution14.symbols @@ -17,5 +17,6 @@ var obj1: Obj1; >Obj1 : Symbol(Obj1, Decl(file.tsx, 2, 1)) ; // OK +>obj1 : Symbol(unknown) >x : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution5.symbols b/tests/baselines/reference/tsxElementResolution5.symbols index 461ffd78aaa..e0fc1147083 100644 --- a/tests/baselines/reference/tsxElementResolution5.symbols +++ b/tests/baselines/reference/tsxElementResolution5.symbols @@ -8,5 +8,6 @@ declare module JSX { // OK, but implicit any
; +>div : Symbol(unknown) >n : Symbol(unknown) diff --git a/tests/baselines/reference/tsxElementResolution9.js b/tests/baselines/reference/tsxElementResolution9.js index bc65bb0bb02..5ad47730e4a 100644 --- a/tests/baselines/reference/tsxElementResolution9.js +++ b/tests/baselines/reference/tsxElementResolution9.js @@ -1,6 +1,6 @@ //// [file.tsx] declare module JSX { - interface Element { } + interface Element { something; } interface IntrinsicElements { } } diff --git a/tests/baselines/reference/tsxElementResolution9.symbols b/tests/baselines/reference/tsxElementResolution9.symbols index e38c64d0847..0aec19a8094 100644 --- a/tests/baselines/reference/tsxElementResolution9.symbols +++ b/tests/baselines/reference/tsxElementResolution9.symbols @@ -2,11 +2,12 @@ declare module JSX { >JSX : Symbol(JSX, Decl(file.tsx, 0, 0)) - interface Element { } + interface Element { something; } >Element : Symbol(Element, Decl(file.tsx, 0, 20)) +>something : Symbol(something, Decl(file.tsx, 1, 20)) interface IntrinsicElements { } ->IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 22)) +>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 1, 33)) } interface Obj1 { diff --git a/tests/baselines/reference/tsxElementResolution9.types b/tests/baselines/reference/tsxElementResolution9.types index dd84e6f07b5..b138aa0509e 100644 --- a/tests/baselines/reference/tsxElementResolution9.types +++ b/tests/baselines/reference/tsxElementResolution9.types @@ -2,8 +2,9 @@ declare module JSX { >JSX : any - interface Element { } + interface Element { something; } >Element : Element +>something : any interface IntrinsicElements { } >IntrinsicElements : IntrinsicElements diff --git a/tests/baselines/reference/tsxExternalModuleEmit1.symbols b/tests/baselines/reference/tsxExternalModuleEmit1.symbols index 5e8eb2fed4e..129edcca0d1 100644 --- a/tests/baselines/reference/tsxExternalModuleEmit1.symbols +++ b/tests/baselines/reference/tsxExternalModuleEmit1.symbols @@ -44,6 +44,8 @@ export class Button extends React.Component { >render : Symbol(render, Decl(button.tsx, 2, 55)) return ; +>button : Symbol(unknown) +>button : Symbol(unknown) } } diff --git a/tests/baselines/reference/tsxNoJsx.symbols b/tests/baselines/reference/tsxNoJsx.symbols index 6744c2edb10..4492e83cf10 100644 --- a/tests/baselines/reference/tsxNoJsx.symbols +++ b/tests/baselines/reference/tsxNoJsx.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/jsx/tsxNoJsx.tsx === -No type information for this code.; -No type information for this code. -No type information for this code. \ No newline at end of file +; +>nope : Symbol(unknown) + diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents3.js b/tests/baselines/reference/tsxStatelessFunctionComponents3.js new file mode 100644 index 00000000000..d58586dd1ee --- /dev/null +++ b/tests/baselines/reference/tsxStatelessFunctionComponents3.js @@ -0,0 +1,37 @@ +//// [file.tsx] + +import React = require('react'); + +const Foo = (props: any) =>
; +// Should be OK +const foo = ; + + +// Should be OK +var MainMenu: React.StatelessComponent<{}> = (props) => (
+

Main Menu

+
); + +var App: React.StatelessComponent<{ children }> = ({children}) => ( +
+ +
+); + +//// [file.jsx] +define(["require", "exports", 'react'], function (require, exports, React) { + "use strict"; + var Foo = function (props) { return
; }; + // Should be OK + var foo = ; + // Should be OK + var MainMenu = function (props) { return (
+

Main Menu

+
); }; + var App = function (_a) { + var children = _a.children; + return (
+ +
); + }; +}); diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents3.symbols b/tests/baselines/reference/tsxStatelessFunctionComponents3.symbols new file mode 100644 index 00000000000..4ce502c6a6a --- /dev/null +++ b/tests/baselines/reference/tsxStatelessFunctionComponents3.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/jsx/file.tsx === + +import React = require('react'); +>React : Symbol(React, Decl(file.tsx, 0, 0)) + +const Foo = (props: any) =>
; +>Foo : Symbol(Foo, Decl(file.tsx, 3, 5)) +>props : Symbol(props, Decl(file.tsx, 3, 13)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45)) + +// Should be OK +const foo = ; +>foo : Symbol(foo, Decl(file.tsx, 5, 5)) +>Foo : Symbol(Foo, Decl(file.tsx, 3, 5)) + + +// Should be OK +var MainMenu: React.StatelessComponent<{}> = (props) => (
+>MainMenu : Symbol(MainMenu, Decl(file.tsx, 9, 3)) +>React : Symbol(React, Decl(file.tsx, 0, 0)) +>StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 139, 5)) +>props : Symbol(props, Decl(file.tsx, 9, 46)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45)) + +

Main Menu

+>h3 : Symbol(JSX.IntrinsicElements.h3, Decl(react.d.ts, 939, 48)) +>h3 : Symbol(JSX.IntrinsicElements.h3, Decl(react.d.ts, 939, 48)) + +
); +>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45)) + +var App: React.StatelessComponent<{ children }> = ({children}) => ( +>App : Symbol(App, Decl(file.tsx, 13, 3)) +>React : Symbol(React, Decl(file.tsx, 0, 0)) +>StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 139, 5)) +>children : Symbol(children, Decl(file.tsx, 13, 35)) +>children : Symbol(children, Decl(file.tsx, 13, 52)) + +
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45)) + + +>MainMenu : Symbol(MainMenu, Decl(file.tsx, 9, 3)) + +
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45)) + +); diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents3.types b/tests/baselines/reference/tsxStatelessFunctionComponents3.types new file mode 100644 index 00000000000..6531ff737ba --- /dev/null +++ b/tests/baselines/reference/tsxStatelessFunctionComponents3.types @@ -0,0 +1,59 @@ +=== tests/cases/conformance/jsx/file.tsx === + +import React = require('react'); +>React : typeof React + +const Foo = (props: any) =>
; +>Foo : (props: any) => JSX.Element +>(props: any) =>
: (props: any) => JSX.Element +>props : any +>
: JSX.Element +>div : any + +// Should be OK +const foo = ; +>foo : JSX.Element +> : JSX.Element +>Foo : (props: any) => JSX.Element + + +// Should be OK +var MainMenu: React.StatelessComponent<{}> = (props) => (
+>MainMenu : React.StatelessComponent<{}> +>React : any +>StatelessComponent : React.StatelessComponent

+>(props) => (

Main Menu

) : (props: {}) => JSX.Element +>props : {} +>(

Main Menu

) : JSX.Element +>

Main Menu

: JSX.Element +>div : any + +

Main Menu

+>

Main Menu

: JSX.Element +>h3 : any +>h3 : any + +
); +>div : any + +var App: React.StatelessComponent<{ children }> = ({children}) => ( +>App : React.StatelessComponent<{ children: any; }> +>React : any +>StatelessComponent : React.StatelessComponent

+>children : any +>({children}) => (

) : ({children}: { children: any; }) => JSX.Element +>children : any +>(
) : JSX.Element + +
+>
: JSX.Element +>div : any + + +> : JSX.Element +>MainMenu : React.StatelessComponent<{}> + +
+>div : any + +); diff --git a/tests/baselines/reference/tsxTypeErrors.symbols b/tests/baselines/reference/tsxTypeErrors.symbols index 94399b95d1f..2b87e994477 100644 --- a/tests/baselines/reference/tsxTypeErrors.symbols +++ b/tests/baselines/reference/tsxTypeErrors.symbols @@ -3,11 +3,13 @@ // A built-in element (OK) var a1 =
; >a1 : Symbol(a1, Decl(tsxTypeErrors.tsx, 2, 3)) +>div : Symbol(unknown) >id : Symbol(unknown) // A built-in element with a mistyped property (error) var a2 = >a2 : Symbol(a2, Decl(tsxTypeErrors.tsx, 5, 3)) +>img : Symbol(unknown) >srce : Symbol(unknown) // A built-in element with a badly-typed attribute value (error) @@ -17,12 +19,14 @@ var thing = { oops: 100 }; var a3 =
>a3 : Symbol(a3, Decl(tsxTypeErrors.tsx, 9, 3)) +>div : Symbol(unknown) >id : Symbol(unknown) >thing : Symbol(thing, Decl(tsxTypeErrors.tsx, 8, 3)) // Mistyped html name (error) var e1 = >e1 : Symbol(e1, Decl(tsxTypeErrors.tsx, 12, 3)) +>imag : Symbol(unknown) >src : Symbol(unknown) // A custom type diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt index d7cf5e83b8f..1131b6e1a68 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. - Property 'toDateString' is missing in type 'String'. tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. @@ -10,7 +9,6 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: foo1(""); // should error ~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. diff --git a/tests/baselines/reference/typeAssertions.errors.txt b/tests/baselines/reference/typeAssertions.errors.txt index a2ad28801c8..c7401e4fcf9 100644 --- a/tests/baselines/reference/typeAssertions.errors.txt +++ b/tests/baselines/reference/typeAssertions.errors.txt @@ -7,9 +7,23 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(37,13): err Property 'q' is missing in type 'SomeDerived'. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(38,13): error TS2352: Neither type 'SomeBase' nor type 'SomeOther' is assignable to the other. Property 'q' is missing in type 'SomeBase'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,5): error TS2304: Cannot find name 'numOrStr'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,14): error TS1005: '>' expected. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,14): error TS2304: Cannot find name 'is'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,17): error TS1005: ')' expected. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,17): error TS2304: Cannot find name 'string'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(44,48): error TS1005: ';' expected. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(45,2): error TS2322: Type 'number | string' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,32): error TS2304: Cannot find name 'numOrStr'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,41): error TS1005: ')' expected. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,41): error TS2304: Cannot find name 'is'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS1005: ';' expected. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS2304: Cannot find name 'string'. +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): error TS1005: ';' expected. -==== tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts (5 errors) ==== +==== tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts (18 errors) ==== // Function call whose argument is a 1 arg generic function call with explicit type arguments function fn1(t: T) { } function fn2(t: any) { } @@ -64,5 +78,41 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(38,13): err !!! error TS2352: Property 'q' is missing in type 'SomeBase'. someOther = someOther; + // Type assertion cannot be a type-predicate type + var numOrStr: number | string; + var str: string; + if((numOrStr === undefined)) { // Error + ~~~~~~~~ +!!! error TS2304: Cannot find name 'numOrStr'. + ~~ +!!! error TS1005: '>' expected. + ~~ +!!! error TS2304: Cannot find name 'is'. + ~~~~~~ +!!! error TS1005: ')' expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. + ~ +!!! error TS1005: ';' expected. + str = numOrStr; // Error, no narrowing occurred + ~~~ +!!! error TS2322: Type 'number | string' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + } + + if((numOrStr === undefined) as numOrStr is string) { // Error + ~~~~~~~~ +!!! error TS2304: Cannot find name 'numOrStr'. + ~~ +!!! error TS1005: ')' expected. + ~~ +!!! error TS2304: Cannot find name 'is'. + ~~~~~~ +!!! error TS1005: ';' expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'string'. + ~ +!!! error TS1005: ';' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index b58a46c37f6..1d33fa927a7 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -39,6 +39,15 @@ someOther = someDerived; // Error someOther = someBase; // Error someOther = someOther; +// Type assertion cannot be a type-predicate type +var numOrStr: number | string; +var str: string; +if((numOrStr === undefined)) { // Error + str = numOrStr; // Error, no narrowing occurred +} + +if((numOrStr === undefined) as numOrStr is string) { // Error +} @@ -87,3 +96,16 @@ someDerived = someOther; // Error someOther = someDerived; // Error someOther = someBase; // Error someOther = someOther; +// Type assertion cannot be a type-predicate type +var numOrStr; +var str; +if (is) + string > (numOrStr === undefined); +{ + str = numOrStr; // Error, no narrowing occurred +} +if ((numOrStr === undefined)) + is; +string; +{ +} diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index e1fdf303870..9ecad007672 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -1,15 +1,21 @@ +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(2,7): error TS2300: Duplicate identifier 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(15,12): error TS2322: Type 'string' is not assignable to type 'x is A'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,55): error TS2304: Cannot find name 'x'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,57): error TS1144: '{' or ';' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,57): error TS2304: Cannot find name 'is'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,60): error TS1005: ';' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,62): error TS1005: ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(22,33): error TS2304: Cannot find name 'x'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(26,33): error TS1225: Cannot find parameter 'x'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(30,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(31,5): error TS1131: Property or signature expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(31,5): error TS7027: Unreachable code detected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(32,1): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(34,38): error TS1225: Cannot find parameter 'x'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(38,51): error TS2322: Type 'B' is not assignable to type 'A'. Property 'propA' is missing in type 'B'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(42,56): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(46,56): error TS2322: Type 'T[]' is not assignable to type 'string'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(50,1): error TS7027: Unreachable code detected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(60,7): error TS2339: Property 'propB' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(65,7): error TS2339: Property 'propB' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(70,7): error TS2339: Property 'propB' does not exist on type 'A'. @@ -23,27 +29,39 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(85,1): Type predicate 'p2 is A' is not assignable to 'p1 is A'. Parameter 'p2' is not in the same position as parameter 'p1'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(91,1): error TS2322: Type '(p1: any, p2: any, p3: any) => p1 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,9): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,16): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,9): error TS2304: Cannot find name 'b'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,11): error TS1005: '=' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,11): error TS2304: Cannot find name 'is'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,14): error TS1005: ',' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,14): error TS2300: Duplicate identifier 'A'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,16): error TS2304: Cannot find name 'b'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,18): error TS1005: '=' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,18): error TS2304: Cannot find name 'is'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,21): error TS1005: ',' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,20): error TS2304: Cannot find name 'b'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,22): error TS1144: '{' or ';' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,22): error TS2304: Cannot find name 'is'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,25): error TS1005: ';' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,27): error TS1005: ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2322: Type 'boolean' is not assignable to type 'D'. - Property 'm1' is missing in type 'Boolean'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(107,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(110,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(111,16): error TS2408: Setters cannot return a value. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(116,18): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,22): error TS1225: Cannot find parameter 'p1'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,22): error TS1228: A type predicate is only allowed in return type position for functions and methods. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,22): error TS2304: Cannot find name 'p1'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,25): error TS1005: ';' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,25): error TS2304: Cannot find name 'is'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,28): error TS1005: ';' expected. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(121,1): error TS1128: Declaration or statement expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(124,20): error TS1229: A type predicate cannot reference a rest parameter. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(129,34): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(133,34): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern. -==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (33 errors) ==== +==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (50 errors) ==== class A { + ~ +!!! error TS2300: Duplicate identifier 'A'. propA: number; } @@ -62,6 +80,16 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 } function hasTypeGuardTypeInsideTypeGuardType(x): x is x is A { + ~ +!!! error TS2304: Cannot find name 'x'. + ~~ +!!! error TS1144: '{' or ';' expected. + ~~ +!!! error TS2304: Cannot find name 'is'. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. return true; } @@ -83,6 +111,8 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 return true; ~~~~~~ !!! error TS1131: Property or signature expected. + ~~~~~~ +!!! error TS7027: Unreachable code detected. } ~ !!! error TS1128: Declaration or statement expected. @@ -113,8 +143,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 } let a: A; - ~~~ -!!! error TS7027: Unreachable code detected. let b: B; declare function isB(p1): p1 is B; @@ -181,14 +209,36 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 // Type predicates in non-return type positions var b1: b is A; - ~~~~~~ -!!! error TS1228: A type predicate is only allowed in return type position for functions and methods. + ~ +!!! error TS2304: Cannot find name 'b'. + ~~ +!!! error TS1005: '=' expected. + ~~ +!!! error TS2304: Cannot find name 'is'. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS2300: Duplicate identifier 'A'. function b2(a: b is A) {}; - ~~~~~~ -!!! error TS1228: A type predicate is only allowed in return type position for functions and methods. + ~ +!!! error TS2304: Cannot find name 'b'. + ~~ +!!! error TS1005: '=' expected. + ~~ +!!! error TS2304: Cannot find name 'is'. + ~ +!!! error TS1005: ',' expected. function b3(): A | b is A { - ~~~~~~ -!!! error TS1228: A type predicate is only allowed in return type position for functions and methods. + ~ +!!! error TS2304: Cannot find name 'b'. + ~~ +!!! error TS1144: '{' or ';' expected. + ~~ +!!! error TS2304: Cannot find name 'is'. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. return true; }; @@ -198,18 +248,13 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 return true; ~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'D'. -!!! error TS2322: Property 'm1' is missing in type 'Boolean'. ~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } get m1(p1: A): p1 is C { - ~~~~~~~ -!!! error TS1228: A type predicate is only allowed in return type position for functions and methods. return true; } set m2(p1: A): p1 is C { - ~~~~~~~ -!!! error TS1228: A type predicate is only allowed in return type position for functions and methods. return true; ~~~~ !!! error TS2408: Setters cannot return a value. @@ -218,17 +263,21 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 interface I1 { new (p1: A): p1 is C; - ~~~~~~~ -!!! error TS1228: A type predicate is only allowed in return type position for functions and methods. } interface I2 { [index: number]: p1 is C; ~~ -!!! error TS1225: Cannot find parameter 'p1'. - ~~~~~~~ -!!! error TS1228: A type predicate is only allowed in return type position for functions and methods. +!!! error TS2304: Cannot find name 'p1'. + ~~ +!!! error TS1005: ';' expected. + ~~ +!!! error TS2304: Cannot find name 'is'. + ~ +!!! error TS1005: ';' expected. } + ~ +!!! error TS1128: Declaration or statement expected. // Reference to rest parameter function b4(...a): a is A { diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index 5e69749e582..dcd8ffcb265 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -171,7 +171,9 @@ var C = (function (_super) { function hasANonBooleanReturnStatement(x) { return ''; } -function hasTypeGuardTypeInsideTypeGuardType(x) { +is; +A; +{ return true; } function hasMissingIsKeyword() { @@ -224,10 +226,14 @@ assign3 = function (p1, p2, p3) { return true; }; // Type predicates in non-return type positions -var b1; -function b2(a) { } +var b1 = is, A; +function b2(a, A) { + if (a === void 0) { a = is; } +} ; -function b3() { +is; +A; +{ return true; } ; @@ -252,6 +258,8 @@ var D = (function () { }); return D; }()); +is; +C; // Reference to rest parameter function b4() { var a = []; diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.js b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.js new file mode 100644 index 00000000000..0bd03890179 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.js @@ -0,0 +1,45 @@ +//// [typeGuardOfFormTypeOfPrimitiveSubtype.ts] +let a: {}; +let b: {toString(): string}; +if (typeof a === "number") { + let c: number = a; +} +if (typeof a === "string") { + let c: string = a; +} +if (typeof a === "boolean") { + let c: boolean = a; +} + +if (typeof b === "number") { + let c: number = b; +} +if (typeof b === "string") { + let c: string = b; +} +if (typeof b === "boolean") { + let c: boolean = b; +} + + +//// [typeGuardOfFormTypeOfPrimitiveSubtype.js] +var a; +var b; +if (typeof a === "number") { + var c = a; +} +if (typeof a === "string") { + var c = a; +} +if (typeof a === "boolean") { + var c = a; +} +if (typeof b === "number") { + var c = b; +} +if (typeof b === "string") { + var c = b; +} +if (typeof b === "boolean") { + var c = b; +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.symbols b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.symbols new file mode 100644 index 00000000000..da962b6060f --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfPrimitiveSubtype.ts === +let a: {}; +>a : Symbol(a, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 0, 3)) + +let b: {toString(): string}; +>b : Symbol(b, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 3)) +>toString : Symbol(toString, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 8)) + +if (typeof a === "number") { +>a : Symbol(a, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 0, 3)) + + let c: number = a; +>c : Symbol(c, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 3, 7)) +>a : Symbol(a, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 0, 3)) +} +if (typeof a === "string") { +>a : Symbol(a, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 0, 3)) + + let c: string = a; +>c : Symbol(c, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 6, 7)) +>a : Symbol(a, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 0, 3)) +} +if (typeof a === "boolean") { +>a : Symbol(a, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 0, 3)) + + let c: boolean = a; +>c : Symbol(c, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 9, 7)) +>a : Symbol(a, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 0, 3)) +} + +if (typeof b === "number") { +>b : Symbol(b, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 3)) + + let c: number = b; +>c : Symbol(c, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 13, 7)) +>b : Symbol(b, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 3)) +} +if (typeof b === "string") { +>b : Symbol(b, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 3)) + + let c: string = b; +>c : Symbol(c, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 16, 7)) +>b : Symbol(b, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 3)) +} +if (typeof b === "boolean") { +>b : Symbol(b, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 3)) + + let c: boolean = b; +>c : Symbol(c, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 19, 7)) +>b : Symbol(b, Decl(typeGuardOfFormTypeOfPrimitiveSubtype.ts, 1, 3)) +} + diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types new file mode 100644 index 00000000000..7e88ca5cb94 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types @@ -0,0 +1,70 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfPrimitiveSubtype.ts === +let a: {}; +>a : {} + +let b: {toString(): string}; +>b : { toString(): string; } +>toString : () => string + +if (typeof a === "number") { +>typeof a === "number" : boolean +>typeof a : string +>a : {} +>"number" : string + + let c: number = a; +>c : number +>a : number +} +if (typeof a === "string") { +>typeof a === "string" : boolean +>typeof a : string +>a : {} +>"string" : string + + let c: string = a; +>c : string +>a : string +} +if (typeof a === "boolean") { +>typeof a === "boolean" : boolean +>typeof a : string +>a : {} +>"boolean" : string + + let c: boolean = a; +>c : boolean +>a : boolean +} + +if (typeof b === "number") { +>typeof b === "number" : boolean +>typeof b : string +>b : { toString(): string; } +>"number" : string + + let c: number = b; +>c : number +>b : number +} +if (typeof b === "string") { +>typeof b === "string" : boolean +>typeof b : string +>b : { toString(): string; } +>"string" : string + + let c: string = b; +>c : string +>b : string +} +if (typeof b === "boolean") { +>typeof b === "boolean" : boolean +>typeof b : string +>b : { toString(): string; } +>"boolean" : string + + let c: boolean = b; +>c : boolean +>b : boolean +} + diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index 84c8be360bd..152a5b951e7 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -1,31 +1,19 @@ tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. - Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. - Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. - Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. - Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I'. - Property 'k' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]'. - Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. - Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. - Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. - Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not assignable to type 'number'. @@ -41,61 +29,49 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not as var x1:{ f(s:string):number;f(n:number):string; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. -!!! error TS2322: Property 'f' is missing in type 'Number'. var x2:{ f(s:string):number; } =3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. -!!! error TS2322: Property 'f' is missing in type 'Number'. var x3:{ (s:string):number;(n:number):string; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. -!!! error TS2322: Property 'z' is missing in type 'Number'. var x7:(s:string)=>boolean=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. -!!! error TS2322: Property 'z' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x9:I=3; ~~ !!! error TS2322: Type 'number' is not assignable to type 'I'. -!!! error TS2322: Property 'k' is missing in type 'Number'. var x10:I[][][][]=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type 'I[][][][]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. var x11:{z:I;x:boolean;}[][]=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. var x14:{ f(x:number):boolean; p; q; ():string; }=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. -!!! error TS2322: Property 'f' is missing in type 'Number'. var x15:number=C; ~~~ !!! error TS2322: Type 'typeof C' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeOfOnTypeArg.errors.txt b/tests/baselines/reference/typeOfOnTypeArg.errors.txt index 8562b7f134a..46b48983f21 100644 --- a/tests/baselines/reference/typeOfOnTypeArg.errors.txt +++ b/tests/baselines/reference/typeOfOnTypeArg.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. - Property '''' is missing in type 'Number'. ==== tests/cases/compiler/typeOfOnTypeArg.ts (1 errors) ==== @@ -12,5 +11,4 @@ tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'nu fill(32); ~~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. -!!! error TS2345: Property '''' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt index 282e942e0f7..0e148cb5689 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt @@ -10,7 +10,6 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTy tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(18,10): error TS2345: Argument of type 'string[]' is not assignable to parameter of type '{ length: any[]; }'. Types of property 'length' are incompatible. Type 'number' is not assignable to type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts (6 errors) ==== @@ -49,5 +48,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTy ~~~~ !!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type '{ length: any[]; }'. !!! error TS2345: Types of property 'length' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'any[]'. -!!! error TS2345: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2345: Type 'number' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/undefinedTypeAssignment1.errors.txt b/tests/baselines/reference/undefinedTypeAssignment1.errors.txt index b8dd74a58a8..61021a463ab 100644 --- a/tests/baselines/reference/undefinedTypeAssignment1.errors.txt +++ b/tests/baselines/reference/undefinedTypeAssignment1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/undefinedTypeAssignment1.ts(1,1): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'. +tests/cases/compiler/undefinedTypeAssignment1.ts(1,6): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'. ==== tests/cases/compiler/undefinedTypeAssignment1.ts (1 errors) ==== type undefined = string; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS2397: Declaration name conflicts with built-in global identifier 'undefined'. function p(undefined = "wat") { return undefined; diff --git a/tests/baselines/reference/unqualifiedCallToClassStatic1.errors.txt b/tests/baselines/reference/unqualifiedCallToClassStatic1.errors.txt index af9edd115e9..4152c182d45 100644 --- a/tests/baselines/reference/unqualifiedCallToClassStatic1.errors.txt +++ b/tests/baselines/reference/unqualifiedCallToClassStatic1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/unqualifiedCallToClassStatic1.ts(4,3): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/unqualifiedCallToClassStatic1.ts(4,3): error TS2662: Cannot find name 'foo'. Did you mean the static member 'Vector.foo'? ==== tests/cases/compiler/unqualifiedCallToClassStatic1.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/unqualifiedCallToClassStatic1.ts(4,3): error TS2304: Cannot // 'foo' cannot be called in an unqualified manner. foo(); ~~~ -!!! error TS2304: Cannot find name 'foo'. +!!! error TS2662: Cannot find name 'foo'. Did you mean the static member 'Vector.foo'? } } \ No newline at end of file diff --git a/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt b/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt index 328e080fbaa..9dd9a8d41a1 100644 --- a/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt +++ b/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt @@ -1,4 +1,4 @@ -lib.d.ts(29,18): error TS2300: Duplicate identifier 'eval'. +lib.d.ts(28,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'. diff --git a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt index 5afc7361a23..da97e05713b 100644 --- a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt +++ b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2322: Type 'number' is not assignable to type 'X'. - Property 'e' is missing in type 'Number'. tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2322: Type 'number' is not assignable to type 'X'. @@ -19,7 +18,6 @@ tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2322: Type 'n x.a.b.val = 5; // val -> X (This should be an error) ~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'X'. -!!! error TS2322: Property 'e' is missing in type 'Number'. x.a.b.a.val = 5; // val -> X (This should be an error) ~~~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'X'. \ No newline at end of file diff --git a/tests/cases/compiler/accessInstanceMemberFromStaticMethod01.ts b/tests/cases/compiler/accessInstanceMemberFromStaticMethod01.ts new file mode 100644 index 00000000000..cdca697f13f --- /dev/null +++ b/tests/cases/compiler/accessInstanceMemberFromStaticMethod01.ts @@ -0,0 +1,7 @@ +class C { + static foo: string; + + bar() { + let k = foo; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/accessStaticMemberFromInstanceMethod01.ts b/tests/cases/compiler/accessStaticMemberFromInstanceMethod01.ts new file mode 100644 index 00000000000..654ae39aacd --- /dev/null +++ b/tests/cases/compiler/accessStaticMemberFromInstanceMethod01.ts @@ -0,0 +1,7 @@ +class C { + foo: string; + + static bar() { + let k = foo; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/asyncFunctionsAcrossFiles.ts b/tests/cases/compiler/asyncFunctionsAcrossFiles.ts new file mode 100644 index 00000000000..c5f6a220fd8 --- /dev/null +++ b/tests/cases/compiler/asyncFunctionsAcrossFiles.ts @@ -0,0 +1,15 @@ +// @target: es6 +// @filename: a.ts +import { b } from './b'; +export const a = { + f: async () => { + await b.f(); + } +}; +// @filename: b.ts +import { a } from './a'; +export const b = { + f: async () => { + await a.f(); + } +}; \ No newline at end of file diff --git a/tests/cases/compiler/capturedLetConstInLoop11.ts b/tests/cases/compiler/capturedLetConstInLoop11.ts new file mode 100644 index 00000000000..bda0cec9d69 --- /dev/null +++ b/tests/cases/compiler/capturedLetConstInLoop11.ts @@ -0,0 +1,13 @@ +for (;;) { + let x = 1; + () => x; +} + +function foo() { + for (;;) { + const a = 0; + switch(a) { + case 0: return () => a; + } + } +} \ No newline at end of file diff --git a/tests/cases/compiler/capturedLetConstInLoop11_ES6.ts b/tests/cases/compiler/capturedLetConstInLoop11_ES6.ts new file mode 100644 index 00000000000..24005ed4833 --- /dev/null +++ b/tests/cases/compiler/capturedLetConstInLoop11_ES6.ts @@ -0,0 +1,14 @@ +// @target: ES6 +for (;;) { + let x = 1; + () => x; +} + +function foo() { + for (;;) { + const a = 0; + switch(a) { + case 0: return () => a; + } + } +} \ No newline at end of file diff --git a/tests/cases/compiler/classExtendsAcrossFiles.ts b/tests/cases/compiler/classExtendsAcrossFiles.ts new file mode 100644 index 00000000000..14e227647e7 --- /dev/null +++ b/tests/cases/compiler/classExtendsAcrossFiles.ts @@ -0,0 +1,20 @@ +// @target: es5 +// @module: commonjs +// @filename: a.ts +import { b } from './b'; +export const a = { + f: () => { + class A { } + class B extends A { } + b.f(); + } +}; +// @filename: b.ts +import { a } from './a'; +export const b = { + f: () => { + class A { } + class B extends A { } + a.f(); + } +}; \ No newline at end of file diff --git a/tests/cases/compiler/declarationEmit_UnknownImport.ts b/tests/cases/compiler/declarationEmit_UnknownImport.ts new file mode 100644 index 00000000000..9f6344322bc --- /dev/null +++ b/tests/cases/compiler/declarationEmit_UnknownImport.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @module: commonjs +// @declaration: true + +import Foo = SomeNonExistingName +export {Foo} \ No newline at end of file diff --git a/tests/cases/compiler/declarationEmit_UnknownImport2.ts b/tests/cases/compiler/declarationEmit_UnknownImport2.ts new file mode 100644 index 00000000000..035d1d860c5 --- /dev/null +++ b/tests/cases/compiler/declarationEmit_UnknownImport2.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @module: commonjs +// @declaration: true + +import Foo From './Foo'; // Syntax error +export default Foo \ No newline at end of file diff --git a/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts b/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts index fde615af41d..582940038c5 100644 --- a/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts +++ b/tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts @@ -92,6 +92,17 @@ function f18() { return "Okay, not type annotated."; } +function f19(): void | number { + // Okay; function return type is union containing void +} + +function f20(): any | number { + // Okay; function return type is union containing any +} + +function f21(): number | string { + // Not okay; union does not contain void or any +} class C { public get m1() { diff --git a/tests/cases/compiler/globalIsContextualKeyword.ts b/tests/cases/compiler/globalIsContextualKeyword.ts new file mode 100644 index 00000000000..ceae834a267 --- /dev/null +++ b/tests/cases/compiler/globalIsContextualKeyword.ts @@ -0,0 +1,16 @@ +function a() { + let global = 1; +} +function b() { + class global {} +} + +namespace global { +} + +function foo(global: number) { +} + +let obj = { + global: "123" +} \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationCollidingNamesInAugmentation1.ts b/tests/cases/compiler/moduleAugmentationCollidingNamesInAugmentation1.ts new file mode 100644 index 00000000000..7cbb78a333b --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationCollidingNamesInAugmentation1.ts @@ -0,0 +1,33 @@ +// @module: amd +// @declaration: true + +// @filename: map1.ts +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface I {x0} +} + +// @filename: map2.ts +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface I {x1} +} + + +// @filename: observable.ts +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +// @filename: main.ts +import { Observable } from "./observable" +import "./map1"; +import "./map2"; + +let x: Observable; diff --git a/tests/cases/compiler/moduleAugmentationDeclarationEmit1.ts b/tests/cases/compiler/moduleAugmentationDeclarationEmit1.ts new file mode 100644 index 00000000000..460cdfc53b6 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationDeclarationEmit1.ts @@ -0,0 +1,33 @@ +// @module: commonjs +// @declaration: true + +// @filename: map.ts +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: number; + } +} + +// @filename: observable.ts +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + let someValue: number; +} + + +// @filename: main.ts +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationDeclarationEmit2.ts b/tests/cases/compiler/moduleAugmentationDeclarationEmit2.ts new file mode 100644 index 00000000000..22cb4392675 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationDeclarationEmit2.ts @@ -0,0 +1,35 @@ +// @module: commonjs +// @declaration: true + +// @filename: map.ts +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: string; + } +} + +// @filename: observable.ts +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + export let someValue: number; +} + + +// @filename: main.ts +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); +let z1 = Observable.someValue.toFixed(); +let z2 = Observable.someAnotherValue.toLowerCase(); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationDisallowedExtensions.ts b/tests/cases/compiler/moduleAugmentationDisallowedExtensions.ts new file mode 100644 index 00000000000..b4b286db502 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationDisallowedExtensions.ts @@ -0,0 +1,46 @@ +// @module: commonjs + +// @filename: x0.ts +export let a = 1; + +// @filename: x.ts + +namespace N1 { + export let x = 1; +} + +declare module "./observable" { + var x: number; + let y: number; + const z: number; + let {x1, y1, z0: {n}, z1: {arr: [el1, el2, el3]}}: {x1: number, y1: string, z0: {n: number}, z1: {arr: number[]} } + interface A { x } + namespace N { + export class C {} + } + class Cls {} + function foo(): number; + type T = number; + import * as all from "./x0"; + import {a} from "./x0"; + export * from "./x0"; + export {a} from "./x0"; +} + +declare module "./test" { + export = N1; +} +export {} + +// @filename: observable.ts +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} +export var x = 1; + +// @filename: test.ts +export let b = 1; + +// @filename: main.ts +import { Observable } from "./observable" +import "./x"; diff --git a/tests/cases/compiler/moduleAugmentationExtendAmbientModule1.ts b/tests/cases/compiler/moduleAugmentationExtendAmbientModule1.ts new file mode 100644 index 00000000000..b8b144fcc14 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationExtendAmbientModule1.ts @@ -0,0 +1,34 @@ +// @module: commonjs + +// @filename: map.ts +import { Observable } from "observable" + +(Observable.prototype).map = function() { } + +declare module "observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: number; + } +} + +// @filename: observable.d.ts +declare module "observable" { + class Observable { + filter(pred: (e:T) => boolean): Observable; + } + namespace Observable { + let someValue: number; + } +} + +// @filename: main.ts + +/// +import { Observable } from "observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationExtendAmbientModule2.ts b/tests/cases/compiler/moduleAugmentationExtendAmbientModule2.ts new file mode 100644 index 00000000000..6e6614ce9f7 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationExtendAmbientModule2.ts @@ -0,0 +1,37 @@ +// @module: commonjs +// @declaration: true + +// @filename: map.ts +import { Observable } from "observable" + +(Observable.prototype).map = function() { } + +declare module "observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: string; + } +} + +// @filename: observable.d.ts +declare module "observable" { + class Observable { + filter(pred: (e:T) => boolean): Observable; + } + namespace Observable { + export let someValue: number; + } +} + +// @filename: main.ts + +/// +import { Observable } from "observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); +let z1 = Observable.someValue.toFixed(); +let z2 = Observable.someAnotherValue.toLowerCase(); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationExtendFileModule1.ts b/tests/cases/compiler/moduleAugmentationExtendFileModule1.ts new file mode 100644 index 00000000000..f87757b4871 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationExtendFileModule1.ts @@ -0,0 +1,32 @@ +// @module: commonjs + +// @filename: map.ts +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: number; + } +} + +// @filename: observable.ts +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + let someValue: number; +} + + +// @filename: main.ts +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationExtendFileModule2.ts b/tests/cases/compiler/moduleAugmentationExtendFileModule2.ts new file mode 100644 index 00000000000..454e5148790 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationExtendFileModule2.ts @@ -0,0 +1,34 @@ +// @module: commonjs + +// @filename: map.ts +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + namespace Observable { + let someAnotherValue: string; + } +} + +// @filename: observable.ts +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +export namespace Observable { + export let someValue: number; +} + + +// @filename: main.ts +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); +let z1 = Observable.someValue.toFixed(); +let z2 = Observable.someAnotherValue.toLowerCase(); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationGlobal1.ts b/tests/cases/compiler/moduleAugmentationGlobal1.ts new file mode 100644 index 00000000000..bef373ff139 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal1.ts @@ -0,0 +1,18 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {x: number;} + +// @filename: f2.ts +import {A} from "./f1"; + +// change the shape of Array +declare global { + interface Array { + getA(): A; + } +} + +let x = [1]; +let y = x.getA().x; diff --git a/tests/cases/compiler/moduleAugmentationGlobal2.ts b/tests/cases/compiler/moduleAugmentationGlobal2.ts new file mode 100644 index 00000000000..5a5c44f1109 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal2.ts @@ -0,0 +1,18 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {}; +// @filename: f2.ts + +// change the shape of Array +import {A} from "./f1"; + +declare global { + interface Array { + getCountAsString(): string; + } +} + +let x = [1]; +let y = x.getCountAsString().toLowerCase(); diff --git a/tests/cases/compiler/moduleAugmentationGlobal3.ts b/tests/cases/compiler/moduleAugmentationGlobal3.ts new file mode 100644 index 00000000000..5986b689c55 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal3.ts @@ -0,0 +1,21 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {}; +// @filename: f2.ts + +// change the shape of Array +import {A} from "./f1"; + +declare global { + interface Array { + getCountAsString(): string; + } +} + +// @filename: f3.ts +import "./f2"; + +let x = [1]; +let y = x.getCountAsString().toLowerCase(); diff --git a/tests/cases/compiler/moduleAugmentationGlobal4.ts b/tests/cases/compiler/moduleAugmentationGlobal4.ts new file mode 100644 index 00000000000..44ba2ba9c57 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal4.ts @@ -0,0 +1,18 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +declare global { + interface Something {x} +} +export {}; +// @filename: f2.ts + +declare global { + interface Something {y} +} +export {}; +// @filename: f3.ts +import "./f1"; +import "./f2"; + diff --git a/tests/cases/compiler/moduleAugmentationGlobal5.ts b/tests/cases/compiler/moduleAugmentationGlobal5.ts new file mode 100644 index 00000000000..6d2920fd55f --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal5.ts @@ -0,0 +1,21 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.d.ts +declare module "A" { + global { + interface Something {x} + } +} +// @filename: f2.d.ts +declare module "B" { + global { + interface Something {y} + } +} +// @filename: f3.ts +/// +/// +import "A"; +import "B"; + diff --git a/tests/cases/compiler/moduleAugmentationGlobal6.ts b/tests/cases/compiler/moduleAugmentationGlobal6.ts new file mode 100644 index 00000000000..37e5e33725b --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal6.ts @@ -0,0 +1,3 @@ +declare global { + interface Array { x } +} \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationGlobal6_1.ts b/tests/cases/compiler/moduleAugmentationGlobal6_1.ts new file mode 100644 index 00000000000..d255b7f8319 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal6_1.ts @@ -0,0 +1,3 @@ +global { + interface Array { x } +} \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationGlobal7.ts b/tests/cases/compiler/moduleAugmentationGlobal7.ts new file mode 100644 index 00000000000..66dd41c8bc9 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal7.ts @@ -0,0 +1,5 @@ +namespace A { + declare global { + interface Array { x } + } +} \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationGlobal7_1.ts b/tests/cases/compiler/moduleAugmentationGlobal7_1.ts new file mode 100644 index 00000000000..b7d99dfd413 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal7_1.ts @@ -0,0 +1,5 @@ +namespace A { + global { + interface Array { x } + } +} \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationGlobal8.ts b/tests/cases/compiler/moduleAugmentationGlobal8.ts new file mode 100644 index 00000000000..e28b07d6bfd --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal8.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @module: amd +namespace A { + declare global { + interface Array { x } + } +} +export {} diff --git a/tests/cases/compiler/moduleAugmentationGlobal8_1.ts b/tests/cases/compiler/moduleAugmentationGlobal8_1.ts new file mode 100644 index 00000000000..9031e4742b0 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationGlobal8_1.ts @@ -0,0 +1,8 @@ +// @target: es5 +// @module: amd +namespace A { + global { + interface Array { x } + } +} +export {} diff --git a/tests/cases/compiler/moduleAugmentationImportsAndExports1.ts b/tests/cases/compiler/moduleAugmentationImportsAndExports1.ts new file mode 100644 index 00000000000..165057cf025 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationImportsAndExports1.ts @@ -0,0 +1,28 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {} + +// @filename: f2.ts +export class B { + n: number; +} + +// @filename: f3.ts +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } +declare module "./f1" { + interface A { + foo(): B; + } +} + +// @filename: f4.ts +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationImportsAndExports2.ts b/tests/cases/compiler/moduleAugmentationImportsAndExports2.ts new file mode 100644 index 00000000000..8e76475c404 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationImportsAndExports2.ts @@ -0,0 +1,40 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {} + +// @filename: f2.ts +export class B { + n: number; +} + +// @filename: f3.ts +import {A} from "./f1"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a } + export interface Cls { a } +} + +declare module "./f1" { + import {B} from "./f2"; + export {B} from "./f2"; + import I = N.Ifc; + import C = N.Cls; + // should have explicit export + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +// @filename: f4.ts +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationImportsAndExports3.ts b/tests/cases/compiler/moduleAugmentationImportsAndExports3.ts new file mode 100644 index 00000000000..ea1d5e435da --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationImportsAndExports3.ts @@ -0,0 +1,38 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {} + +// @filename: f2.ts +export class B { + n: number; +} + +// @filename: f3.ts +import {A} from "./f1"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a } + export interface Cls { a } +} + +declare module "./f1" { + import {B} from "./f2"; + import I = N.Ifc; + import C = N.Cls; + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +// @filename: f4.ts +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationImportsAndExports4.ts b/tests/cases/compiler/moduleAugmentationImportsAndExports4.ts new file mode 100644 index 00000000000..3f3b9e19400 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationImportsAndExports4.ts @@ -0,0 +1,39 @@ +// @module: commonjs + +// @filename: f1.ts +export class A {} + +// @filename: f2.ts +export class B { + n: number; +} + +// @filename: f3.ts +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a: number; } + export interface Cls { b: number; } +} +import I = N.Ifc; +import C = N.Cls; + +declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +// @filename: f4.ts +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; +let c = a.bar().a; +let d = a.baz().b; \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationImportsAndExports5.ts b/tests/cases/compiler/moduleAugmentationImportsAndExports5.ts new file mode 100644 index 00000000000..8dbff8f7cc9 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationImportsAndExports5.ts @@ -0,0 +1,40 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {} + +// @filename: f2.ts +export class B { + n: number; +} + +// @filename: f3.ts +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } + +namespace N { + export interface Ifc { a: number; } + export interface Cls { b: number; } +} +import I = N.Ifc; +import C = N.Cls; + +declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +// @filename: f4.ts +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; +let c = a.bar().a; +let d = a.baz().b; \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationImportsAndExports6.ts b/tests/cases/compiler/moduleAugmentationImportsAndExports6.ts new file mode 100644 index 00000000000..e9e216cbbbe --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationImportsAndExports6.ts @@ -0,0 +1,40 @@ +// @module: commonjs +// @declaration: true + +// @filename: f1.ts +export class A {} + +// @filename: f2.ts +export class B { + n: number; +} + +// @filename: f3.ts +import {A} from "./f1"; +import {B} from "./f2"; + +A.prototype.foo = function () { return undefined; } + +export namespace N { + export interface Ifc { a: number; } + export interface Cls { b: number; } +} +import I = N.Ifc; +import C = N.Cls; + +declare module "./f1" { + interface A { + foo(): B; + bar(): I; + baz(): C; + } +} + +// @filename: f4.ts +import {A} from "./f1"; +import "./f3"; + +let a: A; +let b = a.foo().n; +let c = a.bar().a; +let d = a.baz().b; \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationInAmbientModule1.ts b/tests/cases/compiler/moduleAugmentationInAmbientModule1.ts new file mode 100644 index 00000000000..07b7ccb99ca --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationInAmbientModule1.ts @@ -0,0 +1,28 @@ +// @module: commonjs +// @declaration: true + +// @filename: O.d.ts + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +// @filename: main.ts +/// + +import {Observable} from "Observable"; +let x: Observable; +x.foo().x; diff --git a/tests/cases/compiler/moduleAugmentationInAmbientModule2.ts b/tests/cases/compiler/moduleAugmentationInAmbientModule2.ts new file mode 100644 index 00000000000..e2979478574 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationInAmbientModule2.ts @@ -0,0 +1,28 @@ +// @module: commonjs +// @declaration: true; +// @filename: O.d.ts + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +// @filename: main.ts +/// + +import {Observable} from "Observable"; +import "Map"; +let x: Observable; +x.foo().x; diff --git a/tests/cases/compiler/moduleAugmentationInAmbientModule3.ts b/tests/cases/compiler/moduleAugmentationInAmbientModule3.ts new file mode 100644 index 00000000000..bc233294ed4 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationInAmbientModule3.ts @@ -0,0 +1,38 @@ +// @module: commonjs +// @declaration: true; +// @filename: O.d.ts + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +declare module "Map" { + class Cls2 { x2: number } + module "Observable" { + interface Observable { + foo2(): Cls2; + } + } +} + +// @filename: main.ts +/// + +import {Observable} from "Observable"; +import "Map"; +let x: Observable; +x.foo().x; +x.foo2().x2; diff --git a/tests/cases/compiler/moduleAugmentationInAmbientModule4.ts b/tests/cases/compiler/moduleAugmentationInAmbientModule4.ts new file mode 100644 index 00000000000..59386ad3d08 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationInAmbientModule4.ts @@ -0,0 +1,40 @@ +// @module: commonjs +// @declaration: true; +// @filename: O.d.ts + +declare module "Observable" { + class Observable {} +} + +declare module "M" { + class Cls { x: number } +} + +declare module "Map" { + import { Cls } from "M"; + module "Observable" { + interface Observable { + foo(): Cls; + } + } +} + +// @filename: O2.d.ts +declare module "Map" { + class Cls2 { x2: number } + module "Observable" { + interface Observable { + foo2(): Cls2; + } + } +} + +// @filename: main.ts +/// +/// + +import {Observable} from "Observable"; +import "Map"; +let x: Observable; +x.foo().x; +x.foo2().x2; diff --git a/tests/cases/compiler/moduleAugmentationInAmbientModule5.ts b/tests/cases/compiler/moduleAugmentationInAmbientModule5.ts new file mode 100644 index 00000000000..5068ba396c3 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationInAmbientModule5.ts @@ -0,0 +1,23 @@ +// @module: commonjs +// @declaration: true + +// @filename: array.d.ts +declare module "A" { + class A { x: number; } +} + +declare module "array" { + import {A} from "A"; + global { + interface Array { + getA(): A; + } + } +} + +// @filename: f.ts +/// +import "array"; + +let x = [1]; +let y = x.getA().x; diff --git a/tests/cases/compiler/moduleAugmentationNoNewNames.ts b/tests/cases/compiler/moduleAugmentationNoNewNames.ts new file mode 100644 index 00000000000..2ab82ba5f0b --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationNoNewNames.ts @@ -0,0 +1,28 @@ +// @module: commonjs + +// @filename: map.ts +import { Observable } from "./observable" + +(Observable.prototype).map = function() { } + +declare module "./observable" { + interface Observable { + map(proj: (e:T) => U): Observable + } + class Bar {} + let y: number, z: string; + let {a: x, b: x1}: {a: number, b: number}; + module Z {} +} + +// @filename: observable.ts +export declare class Observable { + filter(pred: (e:T) => boolean): Observable; +} + +// @filename: main.ts +import { Observable } from "./observable" +import "./map"; + +let x: Observable; +let y = x.map(x => x + 1); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationsBundledOutput1.ts b/tests/cases/compiler/moduleAugmentationsBundledOutput1.ts new file mode 100644 index 00000000000..e633e355d80 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationsBundledOutput1.ts @@ -0,0 +1,57 @@ +// @target: es5 +// @module: amd +// @declaration: true +// @out: out.js + +// @filename: m1.ts +export class Cls { +} + +// @filename: m2.ts +import {Cls} from "./m1"; +(Cls.prototype).foo = function() { return 1; }; +(Cls.prototype).bar = function() { return "1"; }; + +declare module "./m1" { + interface Cls { + foo(): number; + } +} + +declare module "./m1" { + interface Cls { + bar(): string; + } +} + +// @filename: m3.ts +export class C1 { x: number } +export class C2 { x: string } + +// @filename: m4.ts +import {Cls} from "./m1"; +import {C1, C2} from "./m3"; +(Cls.prototype).baz1 = function() { return undefined }; +(Cls.prototype).baz2 = function() { return undefined }; + +declare module "./m1" { + interface Cls { + baz1(): C1; + } +} + +declare module "./m1" { + interface Cls { + baz2(): C2; + } +} + +// @filename: test.ts +import { Cls } from "./m1"; +import "m2"; +import "m4"; +let c: Cls; +c.foo().toExponential(); +c.bar().toLowerCase(); +c.baz1().x.toExponential(); +c.baz2().x.toLowerCase(); diff --git a/tests/cases/compiler/moduleAugmentationsImports1.ts b/tests/cases/compiler/moduleAugmentationsImports1.ts new file mode 100644 index 00000000000..ad029bdfc4a --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationsImports1.ts @@ -0,0 +1,44 @@ +// @module: amd +// @declaration: true +// @out: f.js + +// @filename: a.ts +export class A {} + +// @filename: b.ts +export class B {x: number;} + +// @filename: c.d.ts +declare module "C" { + class Cls {y: string; } +} + +// @filename: d.ts +/// + +import {A} from "./a"; +import {B} from "./b"; +import {Cls} from "C"; + +A.prototype.getB = function () { return undefined; } +A.prototype.getCls = function () { return undefined; } + +declare module "./a" { + interface A { + getB(): B; + } +} + +declare module "./a" { + interface A { + getCls(): Cls; + } +} + +// @filename: main.ts +import {A} from "./a"; +import "d"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationsImports2.ts b/tests/cases/compiler/moduleAugmentationsImports2.ts new file mode 100644 index 00000000000..bf5b4b1cd17 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationsImports2.ts @@ -0,0 +1,49 @@ +// @module: amd +// @declaration: true +// @out: f.js + +// @filename: a.ts +export class A {} + +// @filename: b.ts +export class B {x: number;} + +// @filename: c.d.ts +declare module "C" { + class Cls {y: string; } +} + +// @filename: d.ts +/// + +import {A} from "./a"; +import {B} from "./b"; + +A.prototype.getB = function () { return undefined; } + +declare module "./a" { + interface A { + getB(): B; + } +} + +// @filename: e.ts +import {A} from "./a"; +import {Cls} from "C"; + +A.prototype.getCls = function () { return undefined; } + +declare module "./a" { + interface A { + getCls(): Cls; + } +} + +// @filename: main.ts +import {A} from "./a"; +import "d"; +import "e"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationsImports3.ts b/tests/cases/compiler/moduleAugmentationsImports3.ts new file mode 100644 index 00000000000..92cc6c73a3c --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationsImports3.ts @@ -0,0 +1,48 @@ +// @module: amd +// @declaration: true +// @out: f.js + +// @filename: a.ts +export class A {} + +// @filename: b.ts +export class B {x: number;} + +// @filename: c.d.ts +declare module "C" { + class Cls {y: string; } +} + +// @filename: d.d.ts +declare module "D" { + import {A} from "a"; + import {B} from "b"; + module "a" { + interface A { + getB(): B; + } + } +} + +// @filename: e.ts +/// +import {A} from "./a"; +import {Cls} from "C"; + +A.prototype.getCls = function () { return undefined; } + +declare module "./a" { + interface A { + getCls(): Cls; + } +} + +// @filename: main.ts +/// +import {A} from "./a"; +import "D"; +import "e"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); \ No newline at end of file diff --git a/tests/cases/compiler/moduleAugmentationsImports4.ts b/tests/cases/compiler/moduleAugmentationsImports4.ts new file mode 100644 index 00000000000..5e48954c092 --- /dev/null +++ b/tests/cases/compiler/moduleAugmentationsImports4.ts @@ -0,0 +1,49 @@ +// @module: amd +// @declaration: true +// @out: f.js + +// @filename: a.ts +export class A {} + +// @filename: b.ts +export class B {x: number;} + +// @filename: c.d.ts +declare module "C" { + class Cls {y: string; } +} + +// @filename: d.d.ts +declare module "D" { + import {A} from "a"; + import {B} from "b"; + module "a" { + interface A { + getB(): B; + } + } +} + +// @filename: e.d.ts +/// +declare module "E" { + import {A} from "a"; + import {Cls} from "C"; + + module "a" { + interface A { + getCls(): Cls; + } + } +} + +// @filename: main.ts +/// +/// +import {A} from "./a"; +import "D"; +import "E"; + +let a: A; +let b = a.getB().x.toFixed(); +let c = a.getCls().y.toLowerCase(); \ No newline at end of file diff --git a/tests/cases/compiler/reExportGlobalDeclaration1.ts b/tests/cases/compiler/reExportGlobalDeclaration1.ts new file mode 100644 index 00000000000..9b3f0c030de --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration1.ts @@ -0,0 +1,19 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare var x: number; +declare var x1: number; +declare let {a, b}: {a: number, b: number}; + +// @filename: file2.ts +export {x, x as y}; +export {x1, x1 as y1}; + +export {a, a as a1}; +export {b, b as b1}; + + +export {x as z}; +export {x1 as z1}; +export {a as a2}; +export {b as b2}; diff --git a/tests/cases/compiler/reExportGlobalDeclaration2.ts b/tests/cases/compiler/reExportGlobalDeclaration2.ts new file mode 100644 index 00000000000..4dba4fd20fa --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration2.ts @@ -0,0 +1,16 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare interface I1 { + x: number +} + +declare interface I2 { + x: number +} + +// @filename: file2.ts +export {I1, I1 as II1}; +export {I2, I2 as II2}; +export {I1 as III1}; +export {I2 as III2}; \ No newline at end of file diff --git a/tests/cases/compiler/reExportGlobalDeclaration3.ts b/tests/cases/compiler/reExportGlobalDeclaration3.ts new file mode 100644 index 00000000000..dc188ac6fb5 --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration3.ts @@ -0,0 +1,16 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare namespace NS1 { + export var foo: number; +} + +declare namespace NS2 { + export var foo: number; +} + +// @filename: file2.ts +export {NS1, NS1 as NNS1}; +export {NS2, NS2 as NNS2}; +export {NS1 as NNNS1}; +export {NS2 as NNNS2}; \ No newline at end of file diff --git a/tests/cases/compiler/reExportGlobalDeclaration4.ts b/tests/cases/compiler/reExportGlobalDeclaration4.ts new file mode 100644 index 00000000000..7298aa682fe --- /dev/null +++ b/tests/cases/compiler/reExportGlobalDeclaration4.ts @@ -0,0 +1,16 @@ +// @module: commonjs + +// @filename: file1.d.ts +declare class Cls1 { + x: number +} +declare class Cls2 { + x: number +} + + +// @filename: file2.ts +export {Cls1, Cls1 as CCls1}; +export {Cls2, Cls2 as CCls2}; +export {Cls1 as CCCls1}; +export {Cls2 as CCCls2}; \ No newline at end of file diff --git a/tests/cases/compiler/reExportUndefined1.ts b/tests/cases/compiler/reExportUndefined1.ts new file mode 100644 index 00000000000..7d949ca1c28 --- /dev/null +++ b/tests/cases/compiler/reExportUndefined1.ts @@ -0,0 +1,4 @@ +// @module: commonjs + +// @filename: a.ts +export { undefined }; \ No newline at end of file diff --git a/tests/cases/compiler/reExportUndefined2.ts b/tests/cases/compiler/reExportUndefined2.ts new file mode 100644 index 00000000000..0d3e381fcfa --- /dev/null +++ b/tests/cases/compiler/reExportUndefined2.ts @@ -0,0 +1,10 @@ +// @module: commonjs + +// @filename: a.ts +var undefined; +export { undefined }; + +// @filename: b.ts +import { undefined } from "./a"; +declare function use(a: number); +use(undefined); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts new file mode 100644 index 00000000000..cd1ad012b25 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts @@ -0,0 +1,93 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts new file mode 100644 index 00000000000..597f40afe86 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts @@ -0,0 +1,99 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..36c3c8cb48c --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts @@ -0,0 +1,109 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for (let [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..4e0e5d053b3 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,115 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +function getRobot() { + return robotA; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +function getMultiRobot() { + return multiRobotA; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +let i: number; + +for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(primarySkillA); +} + +for ([numberB = -1] = robotA, i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { + console.log(numberB); +} +for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberB); +} +for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameB); +} +for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(nameA2); +} +for (let + [nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] + ] = multiRobotA, i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = getMultiRobot(), i = 0; i < 1; i++) { + console.log(nameMA); +} +for ([nameMA = "noName", + [ + primarySkillA = "primary", + secondarySkillA = "secondary" + ] = ["none", "none"] +] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts new file mode 100644 index 00000000000..7d5471db324 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts @@ -0,0 +1,67 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts new file mode 100644 index 00000000000..3e018b2a6d5 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts @@ -0,0 +1,111 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({ name: nameA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skill } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ name, skills: { primary, secondary } } = + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..22c9ecdf66d --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts @@ -0,0 +1,98 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..0240a82c40b --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts @@ -0,0 +1,175 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robot: Robot = { name: "mower", skill: "mowing" }; +let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +function getRobot() { + return robot; +} +function getMultiRobot() { + return multiRobot; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} + +for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = multiRobot, i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = getMultiRobot(), i = 0; i < 1; i++) { + console.log(primaryA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "none", secondary: "none" } +} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + i = 0; i < 1; i++) { + console.log(primaryA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts new file mode 100644 index 00000000000..f2fb461f443 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts @@ -0,0 +1,96 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA] of robots) { + console.log(nameA); +} +for (let [, nameA] of getRobots()) { + console.log(nameA); +} +for (let [, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB] of robots) { + console.log(numberB); +} +for (let [numberB] of getRobots()) { + console.log(numberB); +} +for (let [numberB] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB] of multiRobots) { + console.log(nameB); +} +for (let [nameB] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for (let [...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts new file mode 100644 index 00000000000..365a030f8e9 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts @@ -0,0 +1,101 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA] of robots) { + console.log(nameA); +} +for ([, nameA] of getRobots()) { + console.log(nameA); +} +for ([, nameA] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB] of robots) { + console.log(numberB); +} +for ([numberB] of getRobots()) { + console.log(numberB); +} +for ([numberB] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB] of multiRobots) { + console.log(nameB); +} +for ([nameB] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2, nameA2, skillA2] of robots) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of getRobots()) { + console.log(nameA2); +} +for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} +for ([...multiRobotAInfo] of multiRobots) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of getMultiRobots()) { + console.log(multiRobotAInfo); +} +for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { + console.log(multiRobotAInfo); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..a619fc1c42f --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts @@ -0,0 +1,105 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +for (let [, nameA = "noName"] of robots) { + console.log(nameA); +} +for (let [, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for (let [, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for (let [, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for (let [numberB = -1] of robots) { + console.log(numberB); +} +for (let [numberB = -1] of getRobots()) { + console.log(numberB); +} +for (let [numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for (let [nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for (let [nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for (let [nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for (let [numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..ac0c8774567 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,110 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +let robotA: Robot = [1, "mower", "mowing"]; +let robotB: Robot = [2, "trimmer", "trimming"]; +let robots = [robotA, robotB]; +function getRobots() { + return robots; +} + +let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +let multiRobots = [multiRobotA, multiRobotB]; +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primarySkillA: string, secondarySkillA: string; +let numberB: number, nameB: string; +let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; + +for ([, nameA = "noName"] of robots) { + console.log(nameA); +} +for ([, nameA = "noName"] of getRobots()) { + console.log(nameA); +} +for ([, nameA = "noName"] of [robotA, robotB]) { + console.log(nameA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(primarySkillA); +} +for ([, [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(primarySkillA); +} + +for ([numberB = -1] of robots) { + console.log(numberB); +} +for ([numberB = -1] of getRobots()) { + console.log(numberB); +} +for ([numberB = -1] of [robotA, robotB]) { + console.log(numberB); +} +for ([nameB = "noName"] of multiRobots) { + console.log(nameB); +} +for ([nameB = "noName"] of getMultiRobots()) { + console.log(nameB); +} +for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { + console.log(nameB); +} + +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { + console.log(nameA2); +} +for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { + console.log(nameA2); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of multiRobots) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of getMultiRobots()) { + console.log(nameMA); +} +for ([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { + console.log(nameMA); +} + +for ([numberA3 = -1, ...robotAInfo] of robots) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of getRobots()) { + console.log(numberA3); +} +for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { + console.log(numberA3); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts new file mode 100644 index 00000000000..df822f89bc0 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts @@ -0,0 +1,68 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA } of robots) { + console.log(nameA); +} +for (let {name: nameA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts new file mode 100644 index 00000000000..7f71e7d6bdd --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts @@ -0,0 +1,110 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA } of robots) { + console.log(nameA); +} +for ({name: nameA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} +for ({name } of robots) { + console.log(nameA); +} +for ({name } of getRobots()) { + console.log(nameA); +} +for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary, secondary } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA, skill: skillA } of robots) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of getRobots()) { + console.log(nameA); +} +for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { + console.log(nameA); +} +for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} +for ({name, skill } of robots) { + console.log(nameA); +} +for ({name, skill } of getRobots()) { + console.log(nameA); +} +for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of multiRobots) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of getMultiRobots()) { + console.log(nameA); +} +for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..d8f88189c01 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts @@ -0,0 +1,90 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +for (let {name: nameA = "noName" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for (let { + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..01d2f6133a3 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts @@ -0,0 +1,167 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +interface Robot { + name: string; + skill: string; +} + +interface MultiRobot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} + +let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; + +function getRobots() { + return robots; +} + +function getMultiRobots() { + return multiRobots; +} + +let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +let name: string, primary: string, secondary: string, skill: string; + +for ({name: nameA = "noName" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { + console.log(primaryA); +} +for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + { primary: "nosKill", secondary: "noSkill" } } of + [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + +for ({ name = "noName" } of robots) { + console.log(nameA); +} +for ({ name = "noName" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(primaryA); +} +for ({ + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(primaryA); +} + + +for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name: nameA = "noName", + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} + +for ({ name = "noName", skill = "noSkill" } of robots) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of getRobots()) { + console.log(nameA); +} +for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of multiRobots) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of getMultiRobots()) { + console.log(nameA); +} +for ({ + name = "noName", + skills: { + primary = "primary", + secondary = "secondary" + } = { primary: "noSkill", secondary: "noSkill" } +} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, + { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { + console.log(nameA); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..062acd823ac --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts @@ -0,0 +1,31 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { + console.log(primaryA); +} +function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { + console.log(secondaryB); +} +function foo3({ skills }: Robot) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..c9dd735e8b6 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts @@ -0,0 +1,44 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; + +function foo1( + { + skills: { + primary: primaryA = "primary", + secondary: secondaryA = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(primaryA); +} +function foo2( + { + name: nameC = "name", + skills: { + primary: primaryB = "primary", + secondary: secondaryB = "secondary" + } = { primary: "SomeSkill", secondary: "someSkill" } + }: Robot = robotA) { + console.log(secondaryB); +} +function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { + console.log(skills.primary); +} + +foo1(robotA); +foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo2(robotA); +foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); + +foo3(robotA); +foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts new file mode 100644 index 00000000000..0f52806dd16 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts @@ -0,0 +1,29 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA }: Robot) { + console.log(nameA); +} +function foo2({ name: nameB, skill: skillB }: Robot) { + console.log(nameB); +} +function foo3({ name }: Robot) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..6fc9c5a605e --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts @@ -0,0 +1,29 @@ +// @sourcemap: true +interface Robot { + name?: string; + skill?: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA = "" }: Robot = { }) { + console.log(nameA); +} +function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { + console.log(nameB); +} +function foo3({ name = "" }: Robot = {}) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts new file mode 100644 index 00000000000..731dc7f2657 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts @@ -0,0 +1,34 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA]: Robot) { + console.log(nameA); +} + +function foo2([numberB]: Robot) { + console.log(numberB); +} + +function foo3([numberA2, nameA2, skillA2]: Robot) { + console.log(nameA2); +} + +function foo4([numberA3, ...robotAInfo]: Robot) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts new file mode 100644 index 00000000000..07c2a24e70e --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts @@ -0,0 +1,34 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [string, [string, string]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA]: Robot) { + console.log(skillA); +} + +function foo2([nameMB]: Robot) { + console.log(nameMB); +} + +function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { + console.log(nameMA); +} + +function foo4([...multiRobotAInfo]: Robot) { + console.log(multiRobotAInfo); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); + +foo4(robotA); +foo4(["roomba", ["vaccum", "mopping"]]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..345d3965156 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts @@ -0,0 +1,34 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; + +function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { + console.log(nameA); +} + +function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { + console.log(numberB); +} + +function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { + console.log(nameA2); +} + +function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { + console.log(robotAInfo); +} + +foo1(robotA); +foo1([2, "trimmer", "trimming"]); + +foo2(robotA); +foo2([2, "trimmer", "trimming"]); + +foo3(robotA); +foo3([2, "trimmer", "trimming"]); + +foo4(robotA); +foo4([2, "trimmer", "trimming"]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..83f95c09c02 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,30 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [string, string[]]; +var robotA: Robot = ["trimmer", ["trimming", "edging"]]; + +function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { + console.log(skillA); +} + +function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { + console.log(nameMB); +} + +function foo3([nameMA = "noName", [ + primarySkillA = "primary", + secondarySkillA = "secondary" +] = ["noSkill", "noSkill"]]: Robot) { + console.log(nameMA); +} + +foo1(robotA); +foo1(["roomba", ["vaccum", "mopping"]]); + +foo2(robotA); +foo2(["roomba", ["vaccum", "mopping"]]); + +foo3(robotA); +foo3(["roomba", ["vaccum", "mopping"]]); \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts new file mode 100644 index 00000000000..88e49498f60 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA } = robotA; +var { name: nameB, skill: skillB } = robotB; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts new file mode 100644 index 00000000000..3697402bbcf --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts @@ -0,0 +1,28 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var a: string, { name: nameA } = robotA; +var b: string, { name: nameB, skill: skillB } = robotB; +var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; + +var { name: nameA } = robotA, a = hello; +var { name: nameB, skill: skillB } = robotB, b = " hello"; +var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; + +var a = hello, { name: nameA } = robotA, a1= "hello"; +var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts new file mode 100644 index 00000000000..3ac03143aa2 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts @@ -0,0 +1,21 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + + +let [, nameA] = robotA; +let [numberB] = robotB; +let [numberA2, nameA2, skillA2] = robotA; + +let [numberC2] = [3, "edging", "Trimming edges"]; +let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; + +let [numberA3, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts new file mode 100644 index 00000000000..27497f2c220 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, [string, string]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA] = multiRobotA; +let [nameMB] = multiRobotB; +let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; + +let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; + +let [...multiRobotAInfo] = multiRobotA; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts new file mode 100644 index 00000000000..78ed29c397b --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts @@ -0,0 +1,57 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, [string, string]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | [string, string])[]; + +[, nameA] = robotA; +[, nameB] = getRobotB(); +[, nameB] = [2, "trimmer", "trimming"]; +[, multiSkillB] = multiRobotB; +[, multiSkillB] = getMultiRobotB(); +[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; + +[numberB] = robotB; +[numberB] = getRobotB(); +[numberB] = [2, "trimmer", "trimming"]; +[nameMB] = multiRobotB; +[nameMB] = getMultiRobotB(); +[nameMB] = ["trimmer", ["trimming", "edging"]]; + +[numberB, nameB, skillB] = robotB; +[numberB, nameB, skillB] = getRobotB(); +[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; + +[numberB, ...robotAInfo] = robotB; +[numberB, ...robotAInfo] = getRobotB(); +[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +[...multiRobotAInfo] = multiRobotA; +[...multiRobotAInfo] = getMultiRobotB(); +[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..fb942310389 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type Robot = [number, string, string]; +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; + +let [, nameA = "noName"] = robotA; +let [numberB = -1] = robotB; +let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; + +let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; + +let [numberA3 = -1, ...robotAInfo] = robotA; + +if (nameA == nameA2) { + console.log(skillA2); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..4b4ef07d232 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,18 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +type MultiSkilledRobot = [string, string[]]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +let [nameMB = "noName" ] = multiRobotB; +let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; + +let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + +if (nameMB == nameMA) { + console.log(skillA[0] + skillA[1]); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts new file mode 100644 index 00000000000..253d96d4b35 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts @@ -0,0 +1,55 @@ +// @sourcemap: true +declare var console: { + log(msg: any): void; +} +type Robot = [number, string, string]; +type MultiSkilledRobot = [string, string[]]; + +var robotA: Robot = [1, "mower", "mowing"]; +var robotB: Robot = [2, "trimmer", "trimming"]; +var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; + +let nameA: string, numberB: number, nameB: string, skillB: string; +let robotAInfo: (number | string)[]; + +let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +let multiRobotAInfo: (string | string[])[]; + +[, nameA = "helloNoName"] = robotA; +[, nameB = "helloNoName"] = getRobotB(); +[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +[, multiSkillB = []] = multiRobotB; +[, multiSkillB = []] = getMultiRobotB(); +[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; + +[numberB = -1] = robotB; +[numberB = -1] = getRobotB(); +[numberB = -1] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName"] = multiRobotB; +[nameMB = "helloNoName"] = getMultiRobotB(); +[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = + ["trimmer", ["trimming", "edging"]]; + +[numberB = -1, ...robotAInfo] = robotB; +[numberB = -1, ...robotAInfo] = getRobotB(); +[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; + +if (nameA == nameB) { + console.log(skillB); +} + +function getRobotB() { + return robotB; +} + +function getMultiRobotB() { + return multiRobotB; +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts new file mode 100644 index 00000000000..b95e7e5464a --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts @@ -0,0 +1,20 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; +var robotB: Robot = { name: "trimmer", skill: "trimming" }; +var { name: nameA = "" } = robotA; +var { name: nameB = "", skill: skillB = "" } = robotB; +var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +if (nameA == nameB) { + console.log(skillB); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..a40e5f11ebb --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts @@ -0,0 +1,24 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary: string; + secondary: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts new file mode 100644 index 00000000000..95eda6f2050 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts @@ -0,0 +1,41 @@ +// @sourcemap: true +declare var console: { + log(msg: string): void; +} +interface Robot { + name: string; + skills: { + primary?: string; + secondary?: string; + }; +} +var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; + +var { + skills: { + primary: primaryA = "noSkill", + secondary: secondaryA = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotA; +var { + name: nameB = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = robotB; +var { + name: nameC = "noNameSpecified", + skills: { + primary: primaryB = "noSkill", + secondary: secondaryB = "noSkill" + } = { primary: "noSkill", secondary: "noSkill" } +} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; + +if (nameB == nameB) { + console.log(nameC); +} +else { + console.log(nameC); +} \ No newline at end of file diff --git a/tests/cases/compiler/thisTypeAsConstraint.ts b/tests/cases/compiler/thisTypeAsConstraint.ts new file mode 100644 index 00000000000..fcab82bc7cc --- /dev/null +++ b/tests/cases/compiler/thisTypeAsConstraint.ts @@ -0,0 +1,4 @@ +class C { + public m() { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/async/es6/asyncMethodWithSuper_es6.ts b/tests/cases/conformance/async/es6/asyncMethodWithSuper_es6.ts new file mode 100644 index 00000000000..795fe7defb0 --- /dev/null +++ b/tests/cases/conformance/async/es6/asyncMethodWithSuper_es6.ts @@ -0,0 +1,52 @@ +// @target: ES6 +// @noEmitHelpers: true +class A { + x() { + } +} + +class B extends A { + // async method with only call/get on 'super' does not require a binding + async simple() { + // call with property access + super.x(); + + // call with element access + super["x"](); + + // property access (read) + const a = super.x; + + // element access (read) + const b = super["x"]; + } + + // async method with assignment/destructuring on 'super' requires a binding + async advanced() { + const f = () => {}; + + // call with property access + super.x(); + + // call with element access + super["x"](); + + // property access (read) + const a = super.x; + + // element access (read) + const b = super["x"]; + + // property access (assign) + super.x = f; + + // element access (assign) + super["x"] = f; + + // destructuring assign with property access + ({ f: super.x } = { f }); + + // destructuring assign with element access + ({ f: super["x"] } = { f }); + } +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts b/tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts index 2acbbe53789..f30eafb3918 100644 --- a/tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts +++ b/tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts @@ -38,4 +38,13 @@ someOther = someDerived; // Error someOther = someBase; // Error someOther = someOther; +// Type assertion cannot be a type-predicate type +var numOrStr: number | string; +var str: string; +if((numOrStr === undefined)) { // Error + str = numOrStr; // Error, no narrowing occurred +} + +if((numOrStr === undefined) as numOrStr is string) { // Error +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfPrimitiveSubtype.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfPrimitiveSubtype.ts new file mode 100644 index 00000000000..b0493db428e --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfPrimitiveSubtype.ts @@ -0,0 +1,21 @@ +let a: {}; +let b: {toString(): string}; +if (typeof a === "number") { + let c: number = a; +} +if (typeof a === "string") { + let c: string = a; +} +if (typeof a === "boolean") { + let c: boolean = a; +} + +if (typeof b === "number") { + let c: number = b; +} +if (typeof b === "string") { + let c: string = b; +} +if (typeof b === "boolean") { + let c: boolean = b; +} diff --git a/tests/cases/conformance/jsx/tsxElementResolution9.tsx b/tests/cases/conformance/jsx/tsxElementResolution9.tsx index 7165f8277b3..4854484a225 100644 --- a/tests/cases/conformance/jsx/tsxElementResolution9.tsx +++ b/tests/cases/conformance/jsx/tsxElementResolution9.tsx @@ -1,7 +1,7 @@ //@filename: file.tsx //@jsx: preserve declare module JSX { - interface Element { } + interface Element { something; } interface IntrinsicElements { } } diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx new file mode 100644 index 00000000000..48ce5fb5efb --- /dev/null +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx @@ -0,0 +1,23 @@ +// @filename: file.tsx +// @jsx: preserve +// @module: amd +// @noLib: true +// @libFiles: react.d.ts,lib.d.ts + +import React = require('react'); + +const Foo = (props: any) =>
; +// Should be OK +const foo = ; + + +// Should be OK +var MainMenu: React.StatelessComponent<{}> = (props) => (
+

Main Menu

+
); + +var App: React.StatelessComponent<{ children }> = ({children}) => ( +
+ +
+); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPattern.ts new file mode 100644 index 00000000000..c87268684b5 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPattern.ts @@ -0,0 +1,94 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////let i: number; +////for ([, nameA] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([numberB] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([nameB] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..80e4a811fed --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForArrayBindingPatternDefaultValues.ts @@ -0,0 +1,109 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////let i: number; +////for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for ([numberB = -1] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for ([nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +//// ] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPattern.ts new file mode 100644 index 00000000000..298fb2f9580 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPattern.ts @@ -0,0 +1,107 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({ name: nameA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name, skill } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name, skills: { primary, secondary } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..161b58c91c2 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForObjectBindingPatternDefaultValues.ts @@ -0,0 +1,168 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name = "noName" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPattern.ts new file mode 100644 index 00000000000..5c30799813b --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPattern.ts @@ -0,0 +1,95 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////for ([, nameA] of robots) { +//// console.log(nameA); +////} +////for ([, nameA] of getRobots()) { +//// console.log(nameA); +////} +////for ([, nameA] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for ([, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for ([, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for ([numberB] of robots) { +//// console.log(numberB); +////} +////for ([numberB] of getRobots()) { +//// console.log(numberB); +////} +////for ([numberB] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for ([nameB] of multiRobots) { +//// console.log(nameB); +////} +////for ([nameB] of getMultiRobots()) { +//// console.log(nameB); +////} +////for ([nameB] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for ([numberA2, nameA2, skillA2] of robots) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] of getRobots()) { +//// console.log(nameA2); +////} +////for ([numberA2, nameA2, skillA2] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for ([nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for ([numberA3, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for ([numberA3, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +////for ([...multiRobotAInfo] of multiRobots) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] of getMultiRobots()) { +//// console.log(multiRobotAInfo); +////} +////for ([...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +//// console.log(multiRobotAInfo); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..8942987c468 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfArrayBindingPatternDefaultValues.ts @@ -0,0 +1,104 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primarySkillA: string, secondarySkillA: string; +////let numberB: number, nameB: string; +////let numberA2: number, nameA2: string, skillA2: string, nameMA: string; +////let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string | [string, string])[]; +////for ([, nameA = "noName"] of robots) { +//// console.log(nameA); +////} +////for ([, nameA = "noName"] of getRobots()) { +//// console.log(nameA); +////} +////for ([, nameA = "noName"] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for ([, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for ([numberB = -1] of robots) { +//// console.log(numberB); +////} +////for ([numberB = -1] of getRobots()) { +//// console.log(numberB); +////} +////for ([numberB = -1] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for ([nameB = "noName"] of multiRobots) { +//// console.log(nameB); +////} +////for ([nameB = "noName"] of getMultiRobots()) { +//// console.log(nameB); +////} +////for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +//// console.log(nameA2); +////} +////for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for ([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for ([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for ([numberA3 = -1, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPattern.ts new file mode 100644 index 00000000000..38a4832f14d --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPattern.ts @@ -0,0 +1,104 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({name: nameA } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({name } of robots) { +//// console.log(nameA); +////} +////for ({name } of getRobots()) { +//// console.log(nameA); +////} +////for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ skills: { primary, secondary } } of multiRobots) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({name: nameA, skill: skillA } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA, skill: skillA } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(nameA); +////} +////for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +////for ({name, skill } of robots) { +//// console.log(nameA); +////} +////for ({name, skill } of getRobots()) { +//// console.log(nameA); +////} +////for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({name, skills: { primary, secondary } } of multiRobots) { +//// console.log(nameA); +////} +////for ({name, skills: { primary, secondary } } of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..2ec090d716d --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentForOfObjectBindingPatternDefaultValues.ts @@ -0,0 +1,159 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////let nameA: string, primaryA: string, secondaryA: string, i: number, skillA: string; +////let name: string, primary: string, secondary: string, skill: string; +////for ({name: nameA = "noName" } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of +//// [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({ name = "noName" } of robots) { +//// console.log(nameA); +////} +////for ({ name = "noName" } of getRobots()) { +//// console.log(nameA); +////} +////for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(primaryA); +////} +////for ({ +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +//// console.log(nameA); +////} +////for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({ +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "noSkill" } of robots) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "noSkill" } of getRobots()) { +//// console.log(nameA); +////} +////for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(nameA); +////} +////for ({ +//// name = "noName", +//// skills: { +//// primary = "primary", +//// secondary = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPattern.ts new file mode 100644 index 00000000000..5fe69b42f1a --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPattern.ts @@ -0,0 +1,55 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +//// +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +//// +////let nameA: string, numberB: number, nameB: string, skillB: string; +////let robotAInfo: (number | string)[]; +//// +////let multiSkillB: [string, string], nameMB: string, primarySkillB: string, secondarySkillB: string; +////let multiRobotAInfo: (string | [string, string])[]; +//// +////[, nameA] = robotA; +////[, nameB] = getRobotB(); +////[, nameB] = [2, "trimmer", "trimming"]; +////[, multiSkillB] = multiRobotB; +////[, multiSkillB] = getMultiRobotB(); +////[, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; +//// +////[numberB] = robotB; +////[numberB] = getRobotB(); +////[numberB] = [2, "trimmer", "trimming"]; +////[nameMB] = multiRobotB; +////[nameMB] = getMultiRobotB(); +////[nameMB] = ["trimmer", ["trimming", "edging"]]; +//// +////[numberB, nameB, skillB] = robotB; +////[numberB, nameB, skillB] = getRobotB(); +////[numberB, nameB, skillB] = [2, "trimmer", "trimming"]; +////[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; +////[nameMB, [primarySkillB, secondarySkillB]] = getMultiRobotB(); +////[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; +//// +////[numberB, ...robotAInfo] = robotB; +////[numberB, ...robotAInfo] = getRobotB(); +////[numberB, ...robotAInfo] = [2, "trimmer", "trimming"]; +////[...multiRobotAInfo] = multiRobotA; +////[...multiRobotAInfo] = getMultiRobotB(); +////[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; +//// +////function getRobotB() { +//// return robotB; +////} +//// +////function getMultiRobotB() { +//// return multiRobotB; +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..354ec145aa4 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringAssignmentStatementArrayBindingPatternDefaultValues.ts @@ -0,0 +1,53 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, string[]]; +//// +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +//// +////let nameA: string, numberB: number, nameB: string, skillB: string; +////let robotAInfo: (number | string)[]; +//// +////let multiSkillB: string[], nameMB: string, primarySkillB: string, secondarySkillB: string; +////let multiRobotAInfo: (string | string[])[]; +//// +////[, nameA = "helloNoName"] = robotA; +////[, nameB = "helloNoName"] = getRobotB(); +////[, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; +////[, multiSkillB = []] = multiRobotB; +////[, multiSkillB = []] = getMultiRobotB(); +////[, multiSkillB = []] = ["roomba", ["vaccum", "mopping"]]; +//// +////[numberB = -1] = robotB; +////[numberB = -1] = getRobotB(); +////[numberB = -1] = [2, "trimmer", "trimming"]; +////[nameMB = "helloNoName"] = multiRobotB; +////[nameMB = "helloNoName"] = getMultiRobotB(); +////[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; +//// +////[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; +////[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); +////[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; +////[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; +////[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); +////[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = +//// ["trimmer", ["trimming", "edging"]]; +//// +////[numberB = -1, ...robotAInfo] = robotB; +////[numberB = -1, ...robotAInfo] = getRobotB(); +////[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; +//// +////function getRobotB() { +//// return robotB; +////} +//// +////function getMultiRobotB() { +//// return multiRobotB; +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPattern.ts new file mode 100644 index 00000000000..c86ac7b0f30 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPattern.ts @@ -0,0 +1,95 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +//// +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +//// +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +//// +////for (let [, nameA] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +//// +////for (let [numberB] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +//// +////for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +//// +////for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(multiRobotAInfo); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..2ea402297b8 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForArrayBindingPatternDefaultValues.ts @@ -0,0 +1,104 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, string[]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////function getRobot() { +//// return robotA; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////function getMultiRobot() { +//// return multiRobotA; +////} +////for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(primarySkillA); +////} +////for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberB); +////} +////for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameB); +////} +////for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(nameA2); +////} +////for (let +//// [nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +//// ] = multiRobotA, i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", +//// [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +//// ] = ["none", "none"] +////] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { +//// console.log(nameMA); +////} +////for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { +//// console.log(numberA3); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPattern.ts new file mode 100644 index 00000000000..fedbe748034 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPattern.ts @@ -0,0 +1,64 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////for (let {name: nameA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..9ee1e75b0bf --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForObjectBindingPatternDefaultValues.ts @@ -0,0 +1,96 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////let robot: Robot = { name: "mower", skill: "mowing" }; +////let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function getRobot() { +//// return robot; +////} +////function getMultiRobot() { +//// return multiRobot; +////} +////for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = multiRobot, i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = getMultiRobot(), i = 0; i < 1; i++) { +//// console.log(primaryA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "none", secondary: "none" } +////} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, +//// i = 0; i < 1; i++) { +//// console.log(primaryA); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPattern.ts new file mode 100644 index 00000000000..90a726c9066 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPattern.ts @@ -0,0 +1,91 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let [, nameA] of robots) { +//// console.log(nameA); +////} +////for (let [, nameA] of getRobots()) { +//// console.log(nameA); +////} +////for (let [, nameA] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for (let [, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for (let [, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for (let [numberB] of robots) { +//// console.log(numberB); +////} +////for (let [numberB] of getRobots()) { +//// console.log(numberB); +////} +////for (let [numberB] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for (let [nameB] of multiRobots) { +//// console.log(nameB); +////} +////for (let [nameB] of getMultiRobots()) { +//// console.log(nameB); +////} +////for (let [nameB] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for (let [numberA2, nameA2, skillA2] of robots) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] of getRobots()) { +//// console.log(nameA2); +////} +////for (let [numberA2, nameA2, skillA2] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] of multiRobots) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for (let [nameMA, [primarySkillA, secondarySkillA]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for (let [numberA3, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for (let [numberA3, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +////for (let [...multiRobotAInfo] of multiRobots) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] of getMultiRobots()) { +//// console.log(multiRobotAInfo); +////} +////for (let [...multiRobotAInfo] of [multiRobotA, multiRobotB]) { +//// console.log(multiRobotAInfo); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..12689236080 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfArrayBindingPatternDefaultValues.ts @@ -0,0 +1,100 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////type MultiSkilledRobot = [string, [string, string]]; +////let robotA: Robot = [1, "mower", "mowing"]; +////let robotB: Robot = [2, "trimmer", "trimming"]; +////let robots = [robotA, robotB]; +////function getRobots() { +//// return robots; +////} +////let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let multiRobots = [multiRobotA, multiRobotB]; +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let [, nameA = "noName"] of robots) { +//// console.log(nameA); +////} +////for (let [, nameA = "noName"] of getRobots()) { +//// console.log(nameA); +////} +////for (let [, nameA = "noName"] of [robotA, robotB]) { +//// console.log(nameA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(primarySkillA); +////} +////for (let [, [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(primarySkillA); +////} +////for (let [numberB = -1] of robots) { +//// console.log(numberB); +////} +////for (let [numberB = -1] of getRobots()) { +//// console.log(numberB); +////} +////for (let [numberB = -1] of [robotA, robotB]) { +//// console.log(numberB); +////} +////for (let [nameB = "noName"] of multiRobots) { +//// console.log(nameB); +////} +////for (let [nameB = "noName"] of getMultiRobots()) { +//// console.log(nameB); +////} +////for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { +//// console.log(nameB); +////} +////for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { +//// console.log(nameA2); +////} +////for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { +//// console.log(nameA2); +////} +////for (let [nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of multiRobots) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of getMultiRobots()) { +//// console.log(nameMA); +////} +////for (let [nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { +//// console.log(nameMA); +////} +////for (let [numberA3 = -1, ...robotAInfo] of robots) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { +//// console.log(numberA3); +////} +////for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { +//// console.log(numberA3); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPattern.ts new file mode 100644 index 00000000000..8fc1b29bbc0 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPattern.ts @@ -0,0 +1,63 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let {name: nameA } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for (let {name: nameA, skill: skillA } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of multiRobots) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of getMultiRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..ded0584ec43 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringForOfObjectBindingPatternDefaultValues.ts @@ -0,0 +1,85 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////interface Robot { +//// name: string; +//// skill: string; +////} +////interface MultiRobot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; +////let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; +////function getRobots() { +//// return robots; +////} +////function getMultiRobots() { +//// return multiRobots; +////} +////for (let {name: nameA = "noName" } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { +//// console.log(primaryA); +////} +////for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = +//// { primary: "nosKill", secondary: "noSkill" } } of +//// [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(primaryA); +////} +////for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { +//// console.log(nameA); +////} +////for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of multiRobots) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of getMultiRobots()) { +//// console.log(nameA); +////} +////for (let { +//// name: nameA = "noName", +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +//// { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { +//// console.log(nameA); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern.ts new file mode 100644 index 00000000000..c3f91122010 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern.ts @@ -0,0 +1,29 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////function foo1([, nameA]: Robot) { +//// console.log(nameA); +////} +////function foo2([numberB]: Robot) { +//// console.log(numberB); +////} +////function foo3([numberA2, nameA2, skillA2]: Robot) { +//// console.log(nameA2); +////} +////function foo4([numberA3, ...robotAInfo]: Robot) { +//// console.log(robotAInfo); +////} +////foo1(robotA); +////foo1([2, "trimmer", "trimming"]); +////foo2(robotA); +////foo2([2, "trimmer", "trimming"]); +////foo3(robotA); +////foo3([2, "trimmer", "trimming"]); +////foo4(robotA); +////foo4([2, "trimmer", "trimming"]); + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern2.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern2.ts new file mode 100644 index 00000000000..fbedbe4abb0 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPattern2.ts @@ -0,0 +1,29 @@ +/// + +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [string, [string, string]]; +////var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +////function foo1([, skillA]: Robot) { +//// console.log(skillA); +////} +////function foo2([nameMB]: Robot) { +//// console.log(nameMB); +////} +////function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { +//// console.log(nameMA); +////} +////function foo4([...multiRobotAInfo]: Robot) { +//// console.log(multiRobotAInfo); +////} +////foo1(robotA); +////foo1(["roomba", ["vaccum", "mopping"]]); +////foo2(robotA); +////foo2(["roomba", ["vaccum", "mopping"]]); +////foo3(robotA); +////foo3(["roomba", ["vaccum", "mopping"]]); +////foo4(robotA); +////foo4(["roomba", ["vaccum", "mopping"]]); + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..275135ca520 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues.ts @@ -0,0 +1,28 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { +//// console.log(nameA); +////} +////function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { +//// console.log(numberB); +////} +////function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { +//// console.log(nameA2); +////} +////function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { +//// console.log(robotAInfo); +////} +////foo1(robotA); +////foo1([2, "trimmer", "trimming"]); +////foo2(robotA); +////foo2([2, "trimmer", "trimming"]); +////foo3(robotA); +////foo3([2, "trimmer", "trimming"]); +////foo4(robotA); +////foo4([2, "trimmer", "trimming"]); + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues2.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..17d964618d1 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,25 @@ +/// +////declare var console: { +//// log(msg: any): void; +////} +////type Robot = [string, string[]]; +////var robotA: Robot = ["trimmer", ["trimming", "edging"]]; +////function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { +//// console.log(skillA); +////} +////function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { +//// console.log(nameMB); +////} +////function foo3([nameMA = "noName", [ +//// primarySkillA = "primary", +//// secondarySkillA = "secondary" +////] = ["noSkill", "noSkill"]]: Robot) { +//// console.log(nameMA); +////} +////foo1(robotA); +////foo1(["roomba", ["vaccum", "mopping"]]); +////foo2(robotA); +////foo2(["roomba", ["vaccum", "mopping"]]); +////foo3(robotA); +////foo3(["roomba", ["vaccum", "mopping"]]); +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..34b23d9fca2 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPattern.ts @@ -0,0 +1,28 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { +//// console.log(primaryA); +////} +////function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { +//// console.log(secondaryB); +////} +////function foo3({ skills }: Robot) { +//// console.log(skills.primary); +////} +////foo1(robotA); +////foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo2(robotA); +////foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo3(robotA); +////foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..8eab866428b --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts @@ -0,0 +1,41 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////function foo1( +//// { +//// skills: { +//// primary: primaryA = "primary", +//// secondary: secondaryA = "secondary" +//// } = { primary: "SomeSkill", secondary: "someSkill" } +//// }: Robot = robotA) { +//// console.log(primaryA); +////} +////function foo2( +//// { +//// name: nameC = "name", +//// skills: { +//// primary: primaryB = "primary", +//// secondary: secondaryB = "secondary" +//// } = { primary: "SomeSkill", secondary: "someSkill" } +//// }: Robot = robotA) { +//// console.log(secondaryB); +////} +////function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { +//// console.log(skills.primary); +////} +////foo1(robotA); +////foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo2(robotA); +////foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +////foo3(robotA); +////foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPattern.ts new file mode 100644 index 00000000000..1e3d7c905d4 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPattern.ts @@ -0,0 +1,26 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////function foo1({ name: nameA }: Robot) { +//// console.log(nameA); +////} +////function foo2({ name: nameB, skill: skillB }: Robot) { +//// console.log(nameB); +////} +////function foo3({ name }: Robot) { +//// console.log(name); +////} +////foo1(robotA); +////foo1({ name: "Edger", skill: "cutting edges" }); +////foo2(robotA); +////foo2({ name: "Edger", skill: "cutting edges" }); +////foo3(robotA); +////foo3({ name: "Edger", skill: "cutting edges" }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..bd87e346f6f --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringParameterObjectBindingPatternDefaultValues.ts @@ -0,0 +1,26 @@ +/// +////interface Robot { +//// name?: string; +//// skill?: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////function foo1({ name: nameA = "" }: Robot = { }) { +//// console.log(nameA); +////} +////function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { +//// console.log(nameB); +////} +////function foo3({ name = "" }: Robot = {}) { +//// console.log(name); +////} +////foo1(robotA); +////foo1({ name: "Edger", skill: "cutting edges" }); +////foo2(robotA); +////foo2({ name: "Edger", skill: "cutting edges" }); +////foo3(robotA); +////foo3({ name: "Edger", skill: "cutting edges" }); +verify.baselineCurrentFileBreakpointLocations(); diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement.ts new file mode 100644 index 00000000000..311b49c3f95 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement.ts @@ -0,0 +1,22 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////var robotB: Robot = { name: "trimmer", skill: "trimming" }; +////var { name: nameA } = robotA; +////var { name: nameB, skill: skillB } = robotB; +////var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +////if (nameA == nameB) { +//// console.log(skillB); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement1.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement1.ts new file mode 100644 index 00000000000..96dbd9d2ff6 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatement1.ts @@ -0,0 +1,30 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////var robotB: Robot = { name: "trimmer", skill: "trimming" }; +////var a: string, { name: nameA } = robotA; +////var b: string, { name: nameB, skill: skillB } = robotB; +////var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; +//// +////var { name: nameA } = robotA, a = hello; +////var { name: nameB, skill: skillB } = robotB, b = " hello"; +////var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; +//// +////var a = hello, { name: nameA } = robotA, a1= "hello"; +////var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; +////var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; +////if (nameA == nameB) { +//// console.log(skillB); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern.ts new file mode 100644 index 00000000000..eb4e3e17027 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern.ts @@ -0,0 +1,15 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////let [, nameA] = robotA; +////let [numberB] = robotB; +////let [numberA2, nameA2, skillA2] = robotA; +////let [numberC2] = [3, "edging", "Trimming edges"]; +////let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; +////let [numberA3, ...robotAInfo] = robotA; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern2.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern2.ts new file mode 100644 index 00000000000..265dae90ab9 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPattern2.ts @@ -0,0 +1,19 @@ +/// + +////declare var console: { +//// log(msg: string): void; +////} +////type MultiSkilledRobot = [string, [string, string]]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +//// +////let [, skillA] = multiRobotA; +////let [nameMB] = multiRobotB; +////let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; +//// +////let [nameMC] = ["roomba", ["vaccum", "mopping"]]; +////let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; +//// +////let [...multiRobotAInfo] = multiRobotA; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts new file mode 100644 index 00000000000..78b0646661e --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts @@ -0,0 +1,15 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////type Robot = [number, string, string]; +////var robotA: Robot = [1, "mower", "mowing"]; +////var robotB: Robot = [2, "trimmer", "trimming"]; +////let [, nameA = "noName"] = robotA; +////let [numberB = -1] = robotB; +////let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; +////let [numberC2 = -1] = [3, "edging", "Trimming edges"]; +////let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; +////let [numberA3 = -1, ...robotAInfo] = robotA; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts new file mode 100644 index 00000000000..ac25165696c --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts @@ -0,0 +1,14 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////type MultiSkilledRobot = [string, string[]]; +////var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; +////var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; +////let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; +////let [nameMB = "noName" ] = multiRobotB; +////let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; +////let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; +////let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementDefaultValues.ts new file mode 100644 index 00000000000..0e28887a4c3 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementDefaultValues.ts @@ -0,0 +1,22 @@ +/// +////interface Robot { +//// name: string; +//// skill: string; +////} +////declare var console: { +//// log(msg: string): void; +////} +////var hello = "hello"; +////var robotA: Robot = { name: "mower", skill: "mowing" }; +////var robotB: Robot = { name: "trimmer", skill: "trimming" }; +////var { name: nameA = "" } = robotA; +////var { name: nameB = "", skill: skillB = "" } = robotB; +////var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; +////if (nameA == nameB) { +//// console.log(skillB); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPattern.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPattern.ts new file mode 100644 index 00000000000..4656fd5c417 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPattern.ts @@ -0,0 +1,26 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary: string; +//// secondary: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +//// +////var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; +////var { name: nameB, skills: { primary: primaryB, secondary: secondaryB } } = robotB; +////var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +//// +////if (nameB == nameB) { +//// console.log(nameC); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts new file mode 100644 index 00000000000..282e91a57ce --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts @@ -0,0 +1,43 @@ +/// +////declare var console: { +//// log(msg: string): void; +////} +////interface Robot { +//// name: string; +//// skills: { +//// primary?: string; +//// secondary?: string; +//// }; +////} +////var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; +////var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; +//// +////var { +//// skills: { +//// primary: primaryA = "noSkill", +//// secondary: secondaryA = "noSkill" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} = robotA; +////var { +//// name: nameB = "noNameSpecified", +//// skills: { +//// primary: primaryB = "noSkill", +//// secondary: secondaryB = "noSkill" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} = robotB; +////var { +//// name: nameC = "noNameSpecified", +//// skills: { +//// primary: primaryB = "noSkill", +//// secondary: secondaryB = "noSkill" +//// } = { primary: "noSkill", secondary: "noSkill" } +////} = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; +//// +////if (nameB == nameB) { +//// console.log(nameC); +////} +////else { +//// console.log(nameC); +////} + +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionInJsDoc.ts b/tests/cases/fourslash/completionInJsDoc.ts index 80516303856..e5cc7a3d2b6 100644 --- a/tests/cases/fourslash/completionInJsDoc.ts +++ b/tests/cases/fourslash/completionInJsDoc.ts @@ -23,11 +23,8 @@ ////// @pa/*7*/ ////var v7; //// -/////** @param { n/*8*/ } */ +/////** @return { n/*8*/ } */ ////var v8; -//// -/////** @return { n/*9*/ } */ -////var v9; goTo.marker('1'); verify.completionListContains("constructor"); @@ -57,6 +54,3 @@ verify.completionListIsEmpty(); goTo.marker('8'); verify.completionListContains('number'); -goTo.marker('9'); -verify.completionListContains('number'); - diff --git a/tests/cases/fourslash/documentHighlightAtInheritedProperties1.ts b/tests/cases/fourslash/documentHighlightAtInheritedProperties1.ts new file mode 100644 index 00000000000..23f6445a004 --- /dev/null +++ b/tests/cases/fourslash/documentHighlightAtInheritedProperties1.ts @@ -0,0 +1,13 @@ +/// + +// @Filename: file1.ts +//// interface interface1 extends interface1 { +//// /*1*/doStuff(): void; +//// /*2*/propName: string; +//// } + +let markers = test.markers() +for (let marker of markers) { + goTo.position(marker.position); + verify.documentHighlightsAtPositionCount(1, ["file1.ts"]); +} diff --git a/tests/cases/fourslash/documentHighlightAtInheritedProperties2.ts b/tests/cases/fourslash/documentHighlightAtInheritedProperties2.ts new file mode 100644 index 00000000000..d4aadf96ed6 --- /dev/null +++ b/tests/cases/fourslash/documentHighlightAtInheritedProperties2.ts @@ -0,0 +1,13 @@ +/// + +// @Filename: file1.ts +//// class class1 extends class1 { +//// /*1*/doStuff() { } +//// /*2*/propName: string; +//// } + +let markers = test.markers() +for (let marker of markers) { + goTo.position(marker.position); + verify.documentHighlightsAtPositionCount(1, ["file1.ts"]); +} \ No newline at end of file diff --git a/tests/cases/fourslash/documentHighlightAtInheritedProperties3.ts b/tests/cases/fourslash/documentHighlightAtInheritedProperties3.ts new file mode 100644 index 00000000000..5e94bb387cd --- /dev/null +++ b/tests/cases/fourslash/documentHighlightAtInheritedProperties3.ts @@ -0,0 +1,17 @@ +/// + +// @Filename: file1.ts +//// interface interface1 extends interface1 { +//// /*1*/doStuff(): void; +//// /*2*/propName: string; +//// } +//// +//// var v: interface1; +//// v./*3*/propName; +//// v./*4*/doStuff(); + +let markers = test.markers() +for (let marker of markers) { + goTo.position(marker.position); + verify.documentHighlightsAtPositionCount(2, ["file1.ts"]); +} diff --git a/tests/cases/fourslash/documentHighlightAtInheritedProperties4.ts b/tests/cases/fourslash/documentHighlightAtInheritedProperties4.ts new file mode 100644 index 00000000000..50f459ebfdb --- /dev/null +++ b/tests/cases/fourslash/documentHighlightAtInheritedProperties4.ts @@ -0,0 +1,17 @@ +/// + +// @Filename: file1.ts +//// class class1 extends class1 { +//// /*1*/doStuff() { } +//// /*2*/propName: string; +//// } +//// +//// var c: class1; +//// c./*3*/doStuff(); +//// c./*4*/propName; + +let markers = test.markers() +for (let marker of markers) { + goTo.position(marker.position); + verify.documentHighlightsAtPositionCount(2, ["file1.ts"]); +} diff --git a/tests/cases/fourslash/documentHighlightAtInheritedProperties5.ts b/tests/cases/fourslash/documentHighlightAtInheritedProperties5.ts new file mode 100644 index 00000000000..b5f4cbb00a7 --- /dev/null +++ b/tests/cases/fourslash/documentHighlightAtInheritedProperties5.ts @@ -0,0 +1,30 @@ +/// + +// @Filename: file1.ts +//// interface C extends D { +//// /*0*/prop0: string; +//// /*1*/prop1: number; +//// } +//// +//// interface D extends C { +//// /*2*/prop0: string; +//// /*3*/prop1: number; +//// } +//// +//// var d: D; +//// d./*4*/prop1; + +goTo.marker("0"); +verify.documentHighlightsAtPositionCount(2, ["file1.ts"]); + +goTo.marker("1"); +verify.documentHighlightsAtPositionCount(3, ["file1.ts"]); + +goTo.marker("2"); +verify.documentHighlightsAtPositionCount(2, ["file1.ts"]); + +goTo.marker("3"); +verify.documentHighlightsAtPositionCount(3, ["file1.ts"]); + +goTo.marker("4"); +verify.documentHighlightsAtPositionCount(3, ["file1.ts"]); \ No newline at end of file diff --git a/tests/cases/fourslash/documentHighlightAtInheritedProperties6.ts b/tests/cases/fourslash/documentHighlightAtInheritedProperties6.ts new file mode 100644 index 00000000000..8f1089e567d --- /dev/null +++ b/tests/cases/fourslash/documentHighlightAtInheritedProperties6.ts @@ -0,0 +1,30 @@ +/// + +// @Filename: file1.ts +//// class C extends D { +//// /*0*/prop0: string; +//// /*1*/prop1: string; +//// } +//// +//// class D extends C { +//// /*2*/prop0: string; +//// /*3*/prop1: string; +//// } +//// +//// var d: D; +//// d./*4*/prop1; + +goTo.marker("0"); +verify.documentHighlightsAtPositionCount(1, ["file1.ts"]); + +goTo.marker("1"); +verify.documentHighlightsAtPositionCount(1, ["file1.ts"]); + +goTo.marker("2"); +verify.documentHighlightsAtPositionCount(1, ["file1.ts"]); + +goTo.marker("3"); +verify.documentHighlightsAtPositionCount(2, ["file1.ts"]); + +goTo.marker("4"); +verify.documentHighlightsAtPositionCount(2, ["file1.ts"]); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties1.ts b/tests/cases/fourslash/findAllRefsInheritedProperties1.ts new file mode 100644 index 00000000000..b2755923d37 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsInheritedProperties1.ts @@ -0,0 +1,25 @@ +/// + +//// class class1 extends class1 { +//// [|doStuff|]() { } +//// [|propName|]: string; +//// } +//// +//// var v: class1; +//// v.[|doStuff|](); +//// v.[|propName|]; + +function verifyReferences(query: FourSlashInterface.Range, references: FourSlashInterface.Range[]) { + goTo.position(query.start); + for (const ref of references) { + verify.referencesAtPositionContains(ref); + } +} + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +const [r0, r1, r2, r3] = ranges; +verifyReferences(r0, [r0, r2]); +verifyReferences(r1, [r1, r3]); +verifyReferences(r2, [r0, r2]); +verifyReferences(r3, [r1, r3]); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties2.ts b/tests/cases/fourslash/findAllRefsInheritedProperties2.ts new file mode 100644 index 00000000000..1ab92c251da --- /dev/null +++ b/tests/cases/fourslash/findAllRefsInheritedProperties2.ts @@ -0,0 +1,25 @@ +/// + +//// interface interface1 extends interface1 { +//// [|doStuff|](): void; // r0 +//// [|propName|]: string; // r1 +//// } +//// +//// var v: interface1; +//// v.[|doStuff|](); // r2 +//// v.[|propName|]; // r3 + +function verifyReferences(query: FourSlashInterface.Range, references: FourSlashInterface.Range[]) { + goTo.position(query.start); + for (const ref of references) { + verify.referencesAtPositionContains(ref); + } +} + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +const [r0, r1, r2, r3] = ranges; +verifyReferences(r0, [r0, r2]); +verifyReferences(r1, [r1, r3]); +verifyReferences(r2, [r0, r2]); +verifyReferences(r3, [r1, r3]); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties3.ts b/tests/cases/fourslash/findAllRefsInheritedProperties3.ts new file mode 100644 index 00000000000..9a46b08f357 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsInheritedProperties3.ts @@ -0,0 +1,37 @@ +/// + +//// class class1 extends class1 { +//// [|doStuff|]() { } // r0 +//// [|propName|]: string; // r1 +//// } +//// interface interface1 extends interface1 { +//// [|doStuff|](): void; // r2 +//// [|propName|]: string; // r3 +//// } +//// class class2 extends class1 implements interface1 { +//// [|doStuff|]() { } // r4 +//// [|propName|]: string; // r5 +//// } +//// +//// var v: class2; +//// v.[|propName|]; // r6 +//// v.[|doStuff|](); // r7 + +function verifyReferences(query: FourSlashInterface.Range, references: FourSlashInterface.Range[]) { + goTo.position(query.start); + for (const ref of references) { + verify.referencesAtPositionContains(ref); + } +} + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +const [r0, r1, r2, r3, r4, r5, r6, r7] = ranges; +verifyReferences(r0, [r0]); +verifyReferences(r1, [r1, r5, r6]); +verifyReferences(r2, [r2, r4, r7]); +verifyReferences(r3, [r3, r5, r6]); +verifyReferences(r4, [r2, r4, r7]); +verifyReferences(r5, [r1, r3, r5, r6]); +verifyReferences(r6, [r1, r3, r5, r6]); +verifyReferences(r7, [r2, r4, r7]); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties4.ts b/tests/cases/fourslash/findAllRefsInheritedProperties4.ts new file mode 100644 index 00000000000..bcd41331f73 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsInheritedProperties4.ts @@ -0,0 +1,30 @@ +/// + +//// interface C extends D { +//// [|prop0|]: string; // r0 +//// [|prop1|]: number; // r1 +//// } +//// +//// interface D extends C { +//// [|prop0|]: string; // r2 +//// } +//// +//// var d: D; +//// d.[|prop0|]; // r3 +//// d.[|prop1|]; // r4 + +function verifyReferences(query: FourSlashInterface.Range, references: FourSlashInterface.Range[]) { + goTo.position(query.start); + for (const ref of references) { + verify.referencesAtPositionContains(ref); + } +} + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +const [r0, r1, r2, r3, r4] = ranges; +verifyReferences(r0, [r0, r2, r3]); +verifyReferences(r1, [r1]); +verifyReferences(r2, [r0, r2, r3]); +verifyReferences(r3, [r0, r2, r3]); +verifyReferences(r4, []); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInheritedProperties5.ts b/tests/cases/fourslash/findAllRefsInheritedProperties5.ts new file mode 100644 index 00000000000..d4e02a36b09 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsInheritedProperties5.ts @@ -0,0 +1,30 @@ +/// + +//// class C extends D { +//// [|prop0|]: string; // r0 +//// [|prop1|]: number; // r1 +//// } +//// +//// class D extends C { +//// [|prop0|]: string; // r2 +//// } +//// +//// var d: D; +//// d.[|prop0|]; // r3 +//// d.[|prop1|]; // r4 + +function verifyReferences(query: FourSlashInterface.Range, references: FourSlashInterface.Range[]) { + goTo.position(query.start); + for (const ref of references) { + verify.referencesAtPositionContains(ref); + } +} + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +const [r0, r1, r2, r3, r4] = ranges; +verifyReferences(r0, [r0]); +verifyReferences(r1, [r1]); +verifyReferences(r2, [r2, r3]); +verifyReferences(r3, [r2, r3]); +verifyReferences(r4, []); diff --git a/tests/cases/fourslash/formattingGlobalAugmentation1.ts b/tests/cases/fourslash/formattingGlobalAugmentation1.ts new file mode 100644 index 00000000000..04991006534 --- /dev/null +++ b/tests/cases/fourslash/formattingGlobalAugmentation1.ts @@ -0,0 +1,8 @@ +/// + +/////*1*/declare global { +////} + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("declare global {"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingGlobalAugmentation2.ts b/tests/cases/fourslash/formattingGlobalAugmentation2.ts new file mode 100644 index 00000000000..74f05e1a936 --- /dev/null +++ b/tests/cases/fourslash/formattingGlobalAugmentation2.ts @@ -0,0 +1,10 @@ +/// + +////declare module "A" { +/////*1*/ global { +//// } +////} + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs(" global {"); \ No newline at end of file diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 0e83189dd8e..b69a757f01e 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -338,6 +338,36 @@ declare namespace FourSlashInterface { text: string; textSpan?: TextSpan; }; + function jsxOpenTagName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxCloseTagName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxSelfClosingTagName(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxAttribute(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxText(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; + function jsxAttributeStringLiteralValue(text: string, position?: number): { + classificationType: string; + text: string; + textSpan?: TextSpan; + }; } } declare function verifyOperationIsCancelled(f: any): void; diff --git a/tests/cases/fourslash/getJavaScriptCompletions1.ts b/tests/cases/fourslash/getJavaScriptCompletions1.ts new file mode 100644 index 00000000000..6d8f36aac1b --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions1.ts @@ -0,0 +1,10 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @type {number} */ +////var v; +////v./**/ + +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/getJavaScriptCompletions10.ts b/tests/cases/fourslash/getJavaScriptCompletions10.ts new file mode 100644 index 00000000000..5fbd91e8988 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions10.ts @@ -0,0 +1,11 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** +//// * @type {function(this:number)} +//// */ +////function f() { this./**/ } + +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions11.ts b/tests/cases/fourslash/getJavaScriptCompletions11.ts new file mode 100644 index 00000000000..f12f53fa960 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions11.ts @@ -0,0 +1,11 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @type {number|string} */ +////var v; +////v./**/ + +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +verify.completionListContains("charCodeAt", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions12.ts b/tests/cases/fourslash/getJavaScriptCompletions12.ts new file mode 100644 index 00000000000..99b14828854 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions12.ts @@ -0,0 +1,36 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** +//// * @param {number} input +//// * @param {string} currency +//// * @returns {number} +//// */ +////var convert = function(input, currency) { +//// switch(currency./*1*/) { +//// case "USD": +//// input./*2*/; +//// case "EUR": +//// return "" + rateToUsd.EUR; +//// case "CNY": +//// return {} + rateToUsd.CNY; +//// } +////} +////convert(1, "")./*3*/ +/////** +//// * @param {number} x +//// */ +////var test1 = function(x) { return x./*4*/ }, test2 = function(a) { return a./*5*/ }; + + +goTo.marker("1"); +verify.completionListContains("charCodeAt", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +goTo.marker("2"); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +goTo.marker("3"); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +goTo.marker("4"); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); +goTo.marker("5"); +verify.completionListContains("test1", /*displayText:*/ undefined, /*documentation*/ undefined, "warning"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions13.ts b/tests/cases/fourslash/getJavaScriptCompletions13.ts new file mode 100644 index 00000000000..438c73e304c --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions13.ts @@ -0,0 +1,26 @@ +/// +// @allowNonTsExtensions: true + +// @Filename: file1.js + +////var file1Identifier = 1; +////interface Foo { FooProp: number }; + +// @Filename: file2.js + +////var file2Identifier1 = 2; +////var file2Identifier2 = 2; +/////*1*/ +////file2Identifier2./*2*/ + +goTo.marker("1"); +verify.completionListContains("file2Identifier1"); +verify.completionListContains("file2Identifier2"); +verify.completionListContains("file1Identifier"); +verify.not.completionListContains("FooProp"); + +goTo.marker("2"); +verify.completionListContains("file2Identifier1"); +verify.completionListContains("file2Identifier2"); +verify.not.completionListContains("file1Identifier") +verify.not.completionListContains("FooProp"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions14.ts b/tests/cases/fourslash/getJavaScriptCompletions14.ts new file mode 100644 index 00000000000..52a23065a5e --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions14.ts @@ -0,0 +1,13 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: file1.js +/////// +////interface Number { +//// toExponential(fractionDigits?: number): string; +////} +////var x = 1; +////x./*1*/ + +goTo.marker("1"); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/getJavaScriptCompletions15.ts b/tests/cases/fourslash/getJavaScriptCompletions15.ts new file mode 100644 index 00000000000..fbcbc2d4692 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions15.ts @@ -0,0 +1,29 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: refFile1.ts +//// export var V = 1; + +// @Filename: refFile2.ts +//// export var V = "123" + +// @Filename: refFile3.ts +//// export var V = "123" + +// @Filename: main.js +//// import ref1 = require("refFile1"); +//// var ref2 = require("refFile2"); +//// ref1.V./*1*/; +//// ref2.V./*2*/; +//// var v = { x: require("refFile3") }; +//// v.x./*3*/; +//// v.x.V./*4*/; + +goTo.marker("1"); +verify.completionListContains("toExponential"); +goTo.marker("2"); +verify.completionListContains("toLowerCase"); +goTo.marker("3"); +verify.completionListContains("V"); +goTo.marker("4"); +verify.completionListContains("toLowerCase"); diff --git a/tests/cases/fourslash/getJavaScriptCompletions2.ts b/tests/cases/fourslash/getJavaScriptCompletions2.ts new file mode 100644 index 00000000000..0cb2de046a6 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions2.ts @@ -0,0 +1,10 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @type {(number|string)} */ +////var v; +////v./**/ + +goTo.marker(); +verify.completionListContains("valueOf", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions3.ts b/tests/cases/fourslash/getJavaScriptCompletions3.ts new file mode 100644 index 00000000000..13a6f1673e6 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions3.ts @@ -0,0 +1,10 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @type {Array.} */ +////var v; +////v./**/ + +goTo.marker(); +verify.completionListContains("concat", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions4.ts b/tests/cases/fourslash/getJavaScriptCompletions4.ts new file mode 100644 index 00000000000..3719b8e1258 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions4.ts @@ -0,0 +1,10 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @return {number} */ +////function foo(a,b) { } +////foo(1,2)./**/ + +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions5.ts b/tests/cases/fourslash/getJavaScriptCompletions5.ts new file mode 100644 index 00000000000..348feef94c3 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions5.ts @@ -0,0 +1,15 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +//// /** +//// * @template T +//// * @param {T} a +//// * @return {T} */ +//// function foo(a) { } +//// let x = /*1*/foo; +//// foo(1)./**/ + +goTo.marker('1'); +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); diff --git a/tests/cases/fourslash/getJavaScriptCompletions6.ts b/tests/cases/fourslash/getJavaScriptCompletions6.ts new file mode 100644 index 00000000000..9f9a42b5762 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions6.ts @@ -0,0 +1,13 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** +//// * @param {...number} a +//// */ +////function foo(a) { +//// a./**/ +////} + +goTo.marker(); +verify.completionListContains("concat", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions7.ts b/tests/cases/fourslash/getJavaScriptCompletions7.ts new file mode 100644 index 00000000000..d8b01cfb757 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions7.ts @@ -0,0 +1,13 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** +//// * @param {...number} a +//// */ +////function foo(a) { +//// a[0]./**/ +////} + +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions8.ts b/tests/cases/fourslash/getJavaScriptCompletions8.ts new file mode 100644 index 00000000000..418aae676be --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions8.ts @@ -0,0 +1,12 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** +//// * @type {function(): number} +//// */ +////var v; +////v()./**/ + +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptCompletions9.ts b/tests/cases/fourslash/getJavaScriptCompletions9.ts new file mode 100644 index 00000000000..1619a2ca9fc --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptCompletions9.ts @@ -0,0 +1,12 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** +//// * @type {function(new:number)} +//// */ +////var v; +////new v()./**/ + +goTo.marker(); +verify.completionListContains("toExponential", /*displayText:*/ undefined, /*documentation*/ undefined, "method"); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo1.ts b/tests/cases/fourslash/getJavaScriptQuickInfo1.ts new file mode 100644 index 00000000000..71072f1699a --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptQuickInfo1.ts @@ -0,0 +1,9 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @type {function(new:string,number)} */ +////var /**/v; + +goTo.marker(); +verify.quickInfoIs('var v: new (p1: number) => string'); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo2.ts b/tests/cases/fourslash/getJavaScriptQuickInfo2.ts new file mode 100644 index 00000000000..ce347a62b27 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptQuickInfo2.ts @@ -0,0 +1,9 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @param {number} [a] */ +////function /**/f(a) { } + +goTo.marker(); +verify.quickInfoIs('function f(a?: number): void'); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo3.ts b/tests/cases/fourslash/getJavaScriptQuickInfo3.ts new file mode 100644 index 00000000000..2e094bd21f6 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptQuickInfo3.ts @@ -0,0 +1,9 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @param {number[]} [a] */ +////function /**/f(a) { } + +goTo.marker(); +verify.quickInfoIs('function f(a?: number[]): void'); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo4.ts b/tests/cases/fourslash/getJavaScriptQuickInfo4.ts new file mode 100644 index 00000000000..34ee10d97b7 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptQuickInfo4.ts @@ -0,0 +1,9 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @param {[number,string]} [a] */ +////function /**/f(a) { } + +goTo.marker(); +verify.quickInfoIs('function f(a?: [number, string]): void'); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo5.ts b/tests/cases/fourslash/getJavaScriptQuickInfo5.ts new file mode 100644 index 00000000000..004af0811b7 --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptQuickInfo5.ts @@ -0,0 +1,9 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @param {{b:number}} [a] */ +////function /**/f(a) { } + +goTo.marker(); +verify.quickInfoIs('function f(a?: {\n b: number;\n}): void'); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo6.ts b/tests/cases/fourslash/getJavaScriptQuickInfo6.ts new file mode 100644 index 00000000000..3aebd19deda --- /dev/null +++ b/tests/cases/fourslash/getJavaScriptQuickInfo6.ts @@ -0,0 +1,9 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +/////** @type {function(this:number)} */ +////function f() { /**/this } + +goTo.marker(); +verify.quickInfoIs('number'); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics20.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics20.ts deleted file mode 100644 index c34f860b5fe..00000000000 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics20.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// - -// @allowJs: true -// @Filename: a.js -//// var v = undefined; - -verify.getSyntacticDiagnostics(`[]`); -verify.getSemanticDiagnostics(`[ - { - "message": "'type assertion expressions' can only be used in a .ts file.", - "start": 9, - "length": 6, - "category": "error", - "code": 8016 - } -]`); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts index ba2d9faae8c..562f42124ae 100644 --- a/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts +++ b/tests/cases/fourslash/getJavaScriptSemanticDiagnostics8.ts @@ -7,8 +7,8 @@ verify.getSemanticDiagnostics(`[ { "message": "'type aliases' can only be used in a .ts file.", - "start": 0, - "length": 11, + "start": 5, + "length": 1, "category": "error", "code": 8008 } diff --git a/tests/cases/fourslash/getPropertySymbolsFromBaseTypesDoesntCrash.ts b/tests/cases/fourslash/getPropertySymbolsFromBaseTypesDoesntCrash.ts new file mode 100644 index 00000000000..0c89de63a43 --- /dev/null +++ b/tests/cases/fourslash/getPropertySymbolsFromBaseTypesDoesntCrash.ts @@ -0,0 +1,9 @@ +/// + +// @Filename: file1.ts +//// class ClassA implements IInterface { +//// private /*1*/value: number; +//// } + +goTo.marker("1"); +verify.documentHighlightsAtPositionCount(1, ["file1.ts"]); \ No newline at end of file diff --git a/tests/cases/fourslash/indentationInAugmentations1.ts b/tests/cases/fourslash/indentationInAugmentations1.ts new file mode 100644 index 00000000000..8a9b81fdd67 --- /dev/null +++ b/tests/cases/fourslash/indentationInAugmentations1.ts @@ -0,0 +1,9 @@ +/// + +// @module: amd +//// export {} +//// declare global {/*1*/ + +goTo.marker("1"); +edit.insertLine(""); +verify.indentationIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/indentationInAugmentations2.ts b/tests/cases/fourslash/indentationInAugmentations2.ts new file mode 100644 index 00000000000..df2400207bb --- /dev/null +++ b/tests/cases/fourslash/indentationInAugmentations2.ts @@ -0,0 +1,8 @@ +/// + +//// declare module "A" { +//// global {/*1*/ + +goTo.marker("1"); +edit.insertLine(""); +verify.indentationIs(8); \ No newline at end of file diff --git a/tests/cases/fourslash/javaScriptModulesError1.ts b/tests/cases/fourslash/javaScriptModulesError1.ts new file mode 100644 index 00000000000..f13b25a182e --- /dev/null +++ b/tests/cases/fourslash/javaScriptModulesError1.ts @@ -0,0 +1,12 @@ +/// + +// Error: Having more function parameters than entries in the dependency array + +// @allowNonTsExtensions: true +// @Filename: Foo.js +//// define('mod1', ['a'], /**/function(a, b) { +//// +//// }); + +// TODO: what should happen? +goTo.marker(); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForInheritedProperties3.ts b/tests/cases/fourslash/referencesForInheritedProperties3.ts new file mode 100644 index 00000000000..134f75da84b --- /dev/null +++ b/tests/cases/fourslash/referencesForInheritedProperties3.ts @@ -0,0 +1,15 @@ +/// + +//// interface interface1 extends interface1 { +//// /*1*/doStuff(): void; +//// /*2*/propName: string; +//// } +//// +//// var v: interface1; +//// v./*3*/propName; +//// v./*4*/doStuff(); + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(2); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForInheritedProperties4.ts b/tests/cases/fourslash/referencesForInheritedProperties4.ts new file mode 100644 index 00000000000..10dcc9c77a2 --- /dev/null +++ b/tests/cases/fourslash/referencesForInheritedProperties4.ts @@ -0,0 +1,15 @@ +/// + +//// class class1 extends class1 { +//// /*1*/doStuff() { } +//// /*2*/propName: string; +//// } +//// +//// var c: class1; +//// c./*3*/doStuff(); +//// c./*4*/propName; + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(2); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForInheritedProperties5.ts b/tests/cases/fourslash/referencesForInheritedProperties5.ts new file mode 100644 index 00000000000..722c5c96f0a --- /dev/null +++ b/tests/cases/fourslash/referencesForInheritedProperties5.ts @@ -0,0 +1,19 @@ +/// + +//// interface interface1 extends interface1 { +//// /*1*/doStuff(): void; +//// /*2*/propName: string; +//// } +//// interface interface2 extends interface1 { +//// /*3*/doStuff(): void; +//// /*4*/propName: string; +//// } +//// +//// var v: interface1; +//// v./*5*/propName; +//// v./*6*/doStuff(); + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(3); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForInheritedProperties6.ts b/tests/cases/fourslash/referencesForInheritedProperties6.ts new file mode 100644 index 00000000000..de6a2f2eba1 --- /dev/null +++ b/tests/cases/fourslash/referencesForInheritedProperties6.ts @@ -0,0 +1,32 @@ +/// + +//// class class1 extends class1 { +//// /*1*/doStuff() { } +//// /*2*/propName: string; +//// } +//// class class2 extends class1 { +//// /*3*/doStuff() { } +//// /*4*/propName: string; +//// } +//// +//// var v: class2; +//// v./*5*/propName; +//// v./*6*/doStuff(); + +goTo.marker("1"); +verify.referencesCountIs(1); + +goTo.marker("2"); +verify.referencesCountIs(3); + +goTo.marker("3"); +verify.referencesCountIs(2); + +goTo.marker("4"); +verify.referencesCountIs(3); + +goTo.marker("5"); +verify.referencesCountIs(3); + +goTo.marker("6"); +verify.referencesCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForInheritedProperties7.ts b/tests/cases/fourslash/referencesForInheritedProperties7.ts new file mode 100644 index 00000000000..000d4922222 --- /dev/null +++ b/tests/cases/fourslash/referencesForInheritedProperties7.ts @@ -0,0 +1,42 @@ +/// + +//// class class1 extends class1 { +//// /*1*/doStuff() { } +//// /*2*/propName: string; +//// } +//// interface interface1 extends interface1 { +//// /*3*/doStuff(): void; +//// /*4*/propName: string; +//// } +//// class class2 extends class1 implements interface1 { +//// /*5*/doStuff() { } +//// /*6*/propName: string; +//// } +//// +//// var v: class2; +//// v./*7*/propName; +//// v./*8*/doStuff(); + +goTo.marker("1"); +verify.referencesCountIs(1); + +goTo.marker("2"); +verify.referencesCountIs(3); + +goTo.marker("3"); +verify.referencesCountIs(3); + +goTo.marker("4"); +verify.referencesCountIs(3); + +goTo.marker("5"); +verify.referencesCountIs(3); + +goTo.marker("6"); +verify.referencesCountIs(4); + +goTo.marker("7"); +verify.referencesCountIs(4); + +goTo.marker("8"); +verify.referencesCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForInheritedProperties8.ts b/tests/cases/fourslash/referencesForInheritedProperties8.ts new file mode 100644 index 00000000000..f34b327a472 --- /dev/null +++ b/tests/cases/fourslash/referencesForInheritedProperties8.ts @@ -0,0 +1,27 @@ +/// + +//// interface C extends D { +//// /*0*/propD: number; +//// } +//// interface D extends C { +//// /*1*/propD: string; +//// /*3*/propC: number; +//// } +//// var d: D; +//// d./*2*/propD; +//// d./*4*/propC; + +goTo.marker("0"); +verify.referencesCountIs(3); + +goTo.marker("1"); +verify.referencesCountIs(3); + +goTo.marker("2"); +verify.referencesCountIs(3); + +goTo.marker("3"); +verify.referencesCountIs(2); + +goTo.marker("4"); +verify.referencesCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForInheritedProperties9.ts b/tests/cases/fourslash/referencesForInheritedProperties9.ts new file mode 100644 index 00000000000..b348d6e8cf6 --- /dev/null +++ b/tests/cases/fourslash/referencesForInheritedProperties9.ts @@ -0,0 +1,21 @@ +/// + +//// class D extends C { +//// /*0*/prop1: string; +//// } +//// +//// class C extends D { +//// /*1*/prop1: string; +//// } +//// +//// var c: C; +//// c./*2*/prop1; + +goTo.marker("0"); +verify.referencesCountIs(1); + +goTo.marker("1"); +verify.referencesCountIs(2) + +goTo.marker("2"); +verify.referencesCountIs(2) \ No newline at end of file diff --git a/tests/cases/fourslash/renameImportAndExport.ts b/tests/cases/fourslash/renameImportAndExport.ts new file mode 100644 index 00000000000..495e15c1e7e --- /dev/null +++ b/tests/cases/fourslash/renameImportAndExport.ts @@ -0,0 +1,10 @@ +/// + +////import [|a|] from "module"; +////export { [|a|] }; + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} diff --git a/tests/cases/fourslash/renameImportAndShorthand.ts b/tests/cases/fourslash/renameImportAndShorthand.ts new file mode 100644 index 00000000000..bc4746aebdd --- /dev/null +++ b/tests/cases/fourslash/renameImportAndShorthand.ts @@ -0,0 +1,10 @@ +/// + +////import [|foo|] from 'bar'; +////const bar = { [|foo|] }; + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} diff --git a/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts b/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts new file mode 100644 index 00000000000..a6b06c11408 --- /dev/null +++ b/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts @@ -0,0 +1,10 @@ +/// + +////import * as [|foo|] from 'bar'; +////const bar = { [|foo|] }; + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} diff --git a/tests/cases/fourslash/renameImportOfExportEquals.ts b/tests/cases/fourslash/renameImportOfExportEquals.ts new file mode 100644 index 00000000000..9d71ee907c8 --- /dev/null +++ b/tests/cases/fourslash/renameImportOfExportEquals.ts @@ -0,0 +1,18 @@ +/// + +////declare namespace N { +//// export var x: number; +////} +////declare module "mod" { +//// export = N; +////} +////declare module "test" { +//// import * as [|N|] from "mod"; +//// export { [|N|] }; // Renaming N here would rename +////} + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} diff --git a/tests/cases/fourslash/renameImportRequire.ts b/tests/cases/fourslash/renameImportRequire.ts new file mode 100644 index 00000000000..c26cc80b616 --- /dev/null +++ b/tests/cases/fourslash/renameImportRequire.ts @@ -0,0 +1,12 @@ +/// + +////import [|e|] = require("mod4"); +////[|e|]; +////a = { [|e|] }; +////export { [|e|] }; + +let ranges = test.ranges() +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} diff --git a/tests/cases/fourslash/renameInheritedProperties1.ts b/tests/cases/fourslash/renameInheritedProperties1.ts new file mode 100644 index 00000000000..4698fe3d97b --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties1.ts @@ -0,0 +1,15 @@ +/// + +//// class class1 extends class1 { +//// [|propName|]: string; +//// } +//// +//// var v: class1; +//// v.[|propName|]; + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (const range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameInheritedProperties2.ts b/tests/cases/fourslash/renameInheritedProperties2.ts new file mode 100644 index 00000000000..ed99ec3e013 --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties2.ts @@ -0,0 +1,15 @@ +/// + +//// class class1 extends class1 { +//// [|doStuff|]() { } +//// } +//// +//// var v: class1; +//// v.[|doStuff|](); + +let ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameInheritedProperties3.ts b/tests/cases/fourslash/renameInheritedProperties3.ts new file mode 100644 index 00000000000..17e7785fbc7 --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties3.ts @@ -0,0 +1,15 @@ +/// + +//// interface interface1 extends interface1 { +//// [|propName|]: string; +//// } +//// +//// var v: interface1; +//// v.[|propName|]; + +let ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameInheritedProperties4.ts b/tests/cases/fourslash/renameInheritedProperties4.ts new file mode 100644 index 00000000000..ea2f7c40fbf --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties4.ts @@ -0,0 +1,15 @@ +/// + +//// interface interface1 extends interface1 { +//// [|doStuff|](): string; +//// } +//// +//// var v: interface1; +//// v.[|doStuff|](); + +let ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (let range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameInheritedProperties5.ts b/tests/cases/fourslash/renameInheritedProperties5.ts new file mode 100644 index 00000000000..45058827747 --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties5.ts @@ -0,0 +1,17 @@ +/// + +//// interface C extends D { +//// propC: number; +//// } +//// interface D extends C { +//// [|propD|]: string; +//// } +//// var d: D; +//// d.[|propD|]; + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (const range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} diff --git a/tests/cases/fourslash/renameInheritedProperties6.ts b/tests/cases/fourslash/renameInheritedProperties6.ts new file mode 100644 index 00000000000..6bdd32ce3e0 --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties6.ts @@ -0,0 +1,17 @@ +/// + +//// interface C extends D { +//// propD: number; +//// } +//// interface D extends C { +//// [|propC|]: number; +//// } +//// var d: D; +//// d.[|propC|]; + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (const range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameInheritedProperties7.ts b/tests/cases/fourslash/renameInheritedProperties7.ts new file mode 100644 index 00000000000..a2f8c5a2b51 --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties7.ts @@ -0,0 +1,19 @@ +/// + +//// class C extends D { +//// [|prop1|]: string; +//// } +//// +//// class D extends C { +//// prop1: string; +//// } +//// +//// var c: C; +//// c.[|prop1|]; + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (const range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/renameInheritedProperties8.ts b/tests/cases/fourslash/renameInheritedProperties8.ts new file mode 100644 index 00000000000..119e1a477aa --- /dev/null +++ b/tests/cases/fourslash/renameInheritedProperties8.ts @@ -0,0 +1,19 @@ +/// + +//// class C implements D { +//// [|prop1|]: string; +//// } +//// +//// interface D extends C { +//// [|prop1|]: string; +//// } +//// +//// var c: C; +//// c.[|prop1|]; + +const ranges = test.ranges(); +verify.assertHasRanges(ranges); +for (const range of ranges) { + goTo.position(range.start); + verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); +} \ No newline at end of file diff --git a/tests/cases/fourslash/syntacticClassificationsJsx1.ts b/tests/cases/fourslash/syntacticClassificationsJsx1.ts new file mode 100644 index 00000000000..e9de07c759b --- /dev/null +++ b/tests/cases/fourslash/syntacticClassificationsJsx1.ts @@ -0,0 +1,27 @@ +/// + +// @Filename: file1.tsx +////let x =
+//// some jsx text +////
; +//// +////let y = + +const c = classification; +verify.syntacticClassificationsAre( + c.keyword("let"), c.identifier("x"), c.operator("="), + c.punctuation("<"), + c.jsxOpenTagName("div"), + c.jsxAttribute("a"), c.operator("="), c.jsxAttributeStringLiteralValue(`"some-value"`), + c.jsxAttribute("b"), c.operator("="), c.punctuation("{"), c.numericLiteral("1"), c.punctuation("}"), + c.punctuation(">"), + c.jsxText(` + some jsx text +`), + c.punctuation("<"), c.punctuation("/"), c.jsxCloseTagName("div"), c.punctuation(">"), c.punctuation(";"), + c.keyword("let"), c.identifier("y"), c.operator("="), + c.punctuation("<"), + c.jsxSelfClosingTagName("element"), + c.jsxAttribute("attr"), c.operator("="), c.jsxAttributeStringLiteralValue(`"123"`), + c.punctuation("/"), c.punctuation(">") +) \ No newline at end of file diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts b/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts new file mode 100644 index 00000000000..54a0b61879f --- /dev/null +++ b/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts @@ -0,0 +1,14 @@ +/// + +//@Filename: file.tsx +//// declare module JSX { +//// interface Element { } +//// interface IntrinsicElements { +//// div: { ONE: string; TWO: number; } +//// } +//// } +//// var x1 =
+ +//@Filename: file.tsx +//// declare module JSX { +//// interface Element { } +//// interface IntrinsicElements { +//// div: { ONE: string; TWO: number; } +//// } +//// } +//// var x1 =
+////

Hello world +//// + +goTo.marker("1"); +verify.memberListCount(1); +verify.completionListContains('div'); + +goTo.marker("2"); +verify.memberListCount(1); +verify.completionListContains('h1') diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts new file mode 100644 index 00000000000..742009b487e --- /dev/null +++ b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts @@ -0,0 +1,8 @@ +/// + +//@Filename: file.tsx +//// var x1 =
+ +//@Filename: file.tsx +//// var x1 =
+////

Hello world +//// + +goTo.marker("1"); +verify.memberListCount(1); +verify.completionListContains('div'); + +goTo.marker("2"); +verify.memberListCount(1); +verify.completionListContains('h1') diff --git a/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts b/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts new file mode 100644 index 00000000000..1b745f6e418 --- /dev/null +++ b/tests/cases/fourslash/tsxCompletionOnOpeningTagWithoutJSX1.ts @@ -0,0 +1,7 @@ +/// + +//@Filename: file.tsx +//// var x = + +//@Filename: file.tsx +//// var x1 = +//// class MyElement {} +//// var z = + +goTo.marker("1"); +verify.quickInfoIs("any", undefined); + +goTo.marker("2"); +verify.quickInfoIs("any", undefined);; + +goTo.marker("3"); +verify.quickInfoIs("class MyElement", undefined);; + +goTo.marker("4"); +verify.quickInfoIs("class MyElement", undefined);; \ No newline at end of file diff --git a/tests/cases/fourslash/tsxQuickInfo2.ts b/tests/cases/fourslash/tsxQuickInfo2.ts new file mode 100644 index 00000000000..0eb7a5100c4 --- /dev/null +++ b/tests/cases/fourslash/tsxQuickInfo2.ts @@ -0,0 +1,24 @@ +/// + +//@Filename: file.tsx +//// declare module JSX { +//// interface Element { } +//// interface IntrinsicElements { +//// div: any +//// } +//// } +//// var x1 = +//// class MyElement {} +//// var z = + +goTo.marker("1"); +verify.quickInfoIs("(property) JSX.IntrinsicElements.div: any", undefined); + +goTo.marker("2"); +verify.quickInfoIs("(property) JSX.IntrinsicElements.div: any", undefined);; + +goTo.marker("3"); +verify.quickInfoIs("class MyElement", undefined);; + +goTo.marker("4"); +verify.quickInfoIs("class MyElement", undefined);; \ No newline at end of file diff --git a/tests/cases/unittests/jsDocParsing.ts b/tests/cases/unittests/jsDocParsing.ts index ebba6e8a1a6..9988383b467 100644 --- a/tests/cases/unittests/jsDocParsing.ts +++ b/tests/cases/unittests/jsDocParsing.ts @@ -1,4 +1,5 @@ /// +/// /// /// @@ -985,15 +986,29 @@ module ts { describe("DocComments", () => { function parsesCorrectly(content: string, expected: string) { let comment = parseIsolatedJSDocComment(content); - Debug.assert(comment && comment.diagnostics.length === 0); + if (!comment) { + Debug.fail('Comment failed to parse entirely'); + } + if (comment.diagnostics.length > 0) { + Debug.fail('Comment has at least one diagnostic: ' + comment.diagnostics[0].messageText); + } let result = JSON.stringify(comment.jsDocComment, (k, v) => { return v && v.pos !== undefined ? JSON.parse(Utils.sourceFileToJSON(v)) : v; - }, " "); + }, 4); - assert.equal(result, expected); + if (result !== expected) { + // Turn on a human-readable diff + if (typeof require !== 'undefined') { + require('chai').config.showDiff = true; + chai.expect(JSON.parse(result)).equal(JSON.parse(expected)); + } + else { + assert.equal(result, expected); + } + } } function parsesIncorrectly(content: string) { @@ -1577,7 +1592,7 @@ module ts { "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 30, + "end": 31, "atToken": { "kind": "AtToken", "pos": 8, @@ -1609,7 +1624,7 @@ module ts { }, "length": 1, "pos": 8, - "end": 30 + "end": 31 } }`); }); @@ -1627,7 +1642,7 @@ module ts { "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 31, + "end": 36, "atToken": { "kind": "AtToken", "pos": 8, @@ -1659,7 +1674,7 @@ module ts { }, "length": 1, "pos": 8, - "end": 31 + "end": 36 } }`); }); @@ -2113,7 +2128,7 @@ module ts { "0": { "kind": "JSDocTemplateTag", "pos": 8, - "end": 24, + "end": 23, "atToken": { "kind": "AtToken", "pos": 8, @@ -2150,12 +2165,12 @@ module ts { }, "length": 2, "pos": 17, - "end": 24 + "end": 23 } }, "length": 1, "pos": 8, - "end": 24 + "end": 23 } }`); });